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

Export to HTML from menu bar #349

Closed
thorstenkampe opened this issue Oct 13, 2019 · 7 comments · Fixed by #354
Closed

Export to HTML from menu bar #349

thorstenkampe opened this issue Oct 13, 2019 · 7 comments · Fixed by #354

Comments

@thorstenkampe
Copy link

There seems to be not "export to HTML" - just PDF. Any chance on implementing this?

@ahus1
Copy link
Contributor

ahus1 commented Oct 13, 2019

Sounds like a good enhancement. For now you can use "open in browser" (hover your mouse at the upper right corner of the editor to make the controls appear) and "save as..." in the browser.

Please be aware that any built-in export as PDF or HTML will not provide the flexibility a small build script calling the Ruby or JavaScript variants of Asciidoctor can provide.

@warmachinesocial
Copy link

Hi Sir, i like this plugin though i never knew about it. I would like to ask you that is there an inbuilt option for pdf and not html?

@jalispran
Copy link

Hi! I would like to take this up as a part of hacktoberfest.

@ahus1
Copy link
Contributor

ahus1 commented Oct 14, 2019

@nishp77 - the primary use of this plugin is to support writers of documentation by providing a live preview. While the preview uses HTML, it provides a good estimate on how the final document might look like. To also provide a quick preview of PDF output the conversion button for PDF was added.

That's the history of the PDF functionality. If there is someone who wants to add HTML support, I'm happy to support her/him writing a pull request.

@ahus1
Copy link
Contributor

ahus1 commented Oct 14, 2019

@jalispran - thanks for volunteering! You'll need some Java skills and some endurance to find your way around the APIs of IntelliJ.

There is a CONTRIBUTING.adoc file that guides you through the process to setup a local development environment.

Using the guide, you should be able to do the following: Check out the source of the plugin, open it in IntelliJ and ensure that you can debug the plugin through the IntelliJ's launch configuration. You'll need to use a JDK 8 setup as described in the contributing guide.
The convert-to-HTML will be quite similar to convert-to-PDF: place a break point in CreatePdfAction.java to see that your development setup is working.

To see what needs to be done, please have a look at the changes for #325. While some of the commits were necessary to make the following work:

  • add a new menu item in plugin.xml
  • create a new action CreateHtmlAction similar to CreatePdfAction
  • in the class AsciiDoc.java add a new method convertToHtml() similar to convertToPdf() [in the old commits it still called renderToPdf(), don't get confused here]

When everything works,

  • write one test case for AsciiDocTest.java similar to testShouldRenderPdf()
  • add 2-3 sentences to FEATURES.adoc

You can create the pull request any time once you have the first lines of code running. Once you've opened the pull request, I can assist you with any obstacles there might be. You can push more changes to the pull request's branch while the pull request is open.

@ahus1 ahus1 changed the title Export to HTML? Export to HTML from menu bar Oct 14, 2019
@balabarath
Copy link
Contributor

balabarath commented Oct 16, 2019

@ahus1 I'm interested in working on this issue. I'm halfway through.
Do I need to include the css as well as it rendered in the side Brower panel?

ahus1 pushed a commit that referenced this issue Oct 18, 2019
* create HTML from IDE using an editor action
@ahus1 ahus1 added this to the 0.30.11 milestone Oct 19, 2019
@ahus1
Copy link
Contributor

ahus1 commented Oct 19, 2019

This is part of the 0.30.11 pre-release. The new pre-release of the plugin is available from GitHub releases and the IntelliJ AsciiDoc EAP repository.

Thank you to @balabarath for providing the PR for this feature!

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

Successfully merging a pull request may close this issue.

5 participants