asciidoctor-intellij-plugin icon indicating copy to clipboard operation
asciidoctor-intellij-plugin copied to clipboard

Remote :pdf-theme: support

Open GauntletPL opened this issue 11 months ago • 3 comments

Why the new feature should be added

The setup for creating AciiDoc documentation in my company is such that we have a centralized repository (standard HTTP server) where all the common files are stored (e.g., common includes, css themes for both AsciiDoc and highlight.js). This worked fine for as long as we prioritized HTML as our primary output format. However, with the recent requirement to produce the documents as PDF files, we've found out that an attempt to use the same centralized approach to storing PDF themes is not feasible. PDF themes are only applied if the theme.yml file is stored locally and the :pdf-theme: :pdf-themesdir: config points to a file in a local file system. This makes it difficult to easily synchronise theme changes across the team or on-board new team members.

How the new feature should work

PDF theme configuration should allow specifying theme location on a remote server:

:pdf-theme: https://storage.company.com/asciidoc/css/pdf/company-theme.yml

GauntletPL avatar Mar 04 '24 11:03 GauntletPL

Hi @GauntletPL - thank you for reaching out. The feature you're looking for is located in one of the libraries used in the plugin, which is https://github.com/asciidoctor/asciidoctor-pdf

@mojavelinux - could you please transfer this issue?

As an alternative, you could use Git submodules to track a specific branch in a common repository and "mount" it as a subfolder in another Git repository, or have a build script which downloads those files.

I know Git submodules need some explaining to users, and a lot of questions arise when they forget to issue the right command to check out also the submodules, so a build script might be a better option.

ahus1 avatar Mar 04 '24 21:03 ahus1

We're not going to add support for a remote theme file as that breaks a number of assumptions about how the theme system is designed (such as how assets in the theme file are resolved). The theme file and its relative assets have to be local. If you want to use a theme that is stored remotely, you'll need to fetch it first. One idea is to use a git submodule. Another is just to clone the git repository that has the theme.

mojavelinux avatar Mar 04 '24 23:03 mojavelinux

@GauntletPL - I've change the type of this issue to "question".

With the answer from Dan and me, I suppose this is answered. With the provided options, can you solve the situation you have at hand?

ahus1 avatar Mar 05 '24 17:03 ahus1

@ahus1 - I mean, it would be nice for the plugin to fetch it for me based on the path specified in the config 😈, but I understand this is quite hermetic use case and I seem to be the only one after it. I'll think of something. Thank you for responding so fast.

GauntletPL avatar Mar 06 '24 08:03 GauntletPL