Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #349 create HTML from IDE using an editor action #354

Merged
merged 3 commits into from
Oct 18, 2019

Conversation

balabarath
Copy link
Contributor

@balabarath balabarath commented Oct 16, 2019

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing documents:

The PR fulfills these requirements:

If adding a new feature:

Other information:

fixes #349

@balabarath balabarath changed the title Fix #349 create HTML from IDE using an editor action fix #349[,#349] create HTML from IDE using an editor action Oct 16, 2019
@balabarath balabarath changed the title fix #349[,#349] create HTML from IDE using an editor action fix #349 create HTML from IDE using an editor action Oct 16, 2019
@ahus1
Copy link
Contributor

ahus1 commented Oct 16, 2019

Thank you for your pull request - looks great! Thank you for including docs and tests already.

Please have a look at the following elements:

  • when converting adoc to HTML, don't call asciidoctor.render(), instead call asciidoctor.convertFile() with the backend "html5" -- this will give you a file on disk that is already renamed; no need to write the file by hand and figuring out a file name.
  • Refactoring: the methods convertToHtml() and convertToPdf() will be so similar after this, maybe you can combine them in into one method with an extra parameter.
  • to add proper HTML header/footer with CSS use OptionsBuilder....headerFooter(true). The result will be way more standard than doing it manually; but this should be done only for convertToHtml()
  • I tried out the PR and the HTML file opened in the IDE, not in a browser. Please use BrowserUtil.browse(virtualFile) to ensure that it opens in a browser, not in an IDE

Please have a look. After the change it will be ready to merge.

@balabarath
Copy link
Contributor Author

@ahus1 I'm facing trouble with including font-awesome css file to the export. The exported html file needs font-awesome css file for the icons.
The convertFile() method doesn't add the font-awesome css file.

@ahus1
Copy link
Contributor

ahus1 commented Oct 17, 2019

The convertFile() method will add the font awesome icon if (and only if) you set the icons attribute. It will include a link to a file on the CDN.

The following example works for me:

:icons: font

NOTE: Hi

From my point of view it is now ready to be merged. Let me know if you agree; I'll then squash-and-merge the change.

@balabarath
Copy link
Contributor Author

Please go ahead and merge the change.

@ahus1 ahus1 merged commit 8f1d4ed into asciidoctor:master Oct 18, 2019
@ahus1
Copy link
Contributor

ahus1 commented Oct 18, 2019

Thank you for this pull request to add this new functionality! I hope the documentation like the contribution guide helped. Let me know if you missed something or think something could be improved for contributors.

@balabarath
Copy link
Contributor Author

@ahus1 Thanks for the excellent support that you have provided. The contribution document is so helpful for the new contributors like me right from setting up the environment, running tests till the development of the plugin. This is my first pull request in my entire development career. I would like to contribute more to the community. Once again thank you so much for the support you provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export to HTML from menu bar
3 participants