asciidoctor / asciidoctor-intellij-plugin

AsciiDoc plugin for products on the IntelliJ platform (IDEA, RubyMine, etc)
https://intellij-asciidoc-plugin.ahus1.de/
Apache License 2.0
347 stars 146 forks source link

Generate DOCX and PDF file to a separate folder #1087

Open ahus1 opened 2 years ago

ahus1 commented 2 years ago

Would it be possible to identify an AsciiDoc file that's in an Antora repository and give the user the option to save the DOCX file elsewhere? Most of the team gets it (don't just dump random files in the Antora repository if they're not explicitly used by Antora to create sites), but it wouldn't hurt to remind them.

Originally posted by @KLynn2019 in https://github.com/asciidoctor/asciidoctor-intellij-plugin/issues/1074#issuecomment-1167851560

ahus1 commented 2 years ago

Thanks for this improvement idea. It makes sense, still I don't know yet how this should work from a UX perspective.

For the time being, as a workaround, I suggest adding a specially crafted .gitignore file that would prevent users from accidentally committing these files (for example "all *.docx files in the pages folder should be ignored").

KLynn2019 commented 2 years ago

Thanks. We've already got DOCX in .gitignore. It's mainly a matter of keeping repositories clean since people sometimes forget what should and should not be there.

ahus1 commented 2 years ago

I'll have to settle the UX for this feature ... I am not sure how this could work.

I am not a fan of pop-ups, and plugin's settings are user specific, not project specific (at least at the moment). Once those can b project specific, they could eventually be checked into the repository of the project.

In Gradle projects there is usually a build folder, in Maven projects there is a target folder, maybe use some convention here?

ahus1 commented 2 years ago

About the scope of this issue: At least PDF could work the same way as DOCX, as images are embedded in the created file. With HTML, this is a bit more difficult, as with a destination folder the images in the HTML might be broken? Let's see what we come up with.

For now, I'm changing the title to include PDF as well, and I'm happy to hear thoughts about HTML.

KerimG commented 2 years ago

@ahus1

My order of preference would be:

  1. using an existing AsciiDoc attribute would be the best. Might also help migrations from one setup to the other if people want to start using the plugin with an existing AsciiDoc project
  2. project-specific settings entry
  3. I'd still prefer user-level settings entry over option 4
  4. fixed convention like target or build.

Option 3 might currently be the best option for minimal effort for max flexibility.

I think the HTML relative links issue can be fixed by placing assets into their own folder in the root. E.g:

myproject
-> assets
     --> images
     --> fonts
-> src
     --> something.adoc
-> build (target folder for HTML build)
     --> something.html

The URLs will remain the same, no?