-
Notifications
You must be signed in to change notification settings - Fork 122
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
Is there a way to link to CSS instead of embedding it? #729
Comments
OK, I am stupid and ugly: <configuration>
<attributes>
<!-- Create separate CSS files, rather than embedding CSS into each HTML file -->
<linkcss>true</linkcss>
<preserveDirectories>true</preserveDirectories>
<relativeBaseDir>true</relativeBaseDir>
</attributes>
</configuration> Now, the total size of my documentation is significantly smaller, even though the asciidoctor and coderay CSS files are still created once per subdirectory, probably because I use relative directories and want to preserve the directory structure. This is mainly due to the fact that I also want asciidoc preview to look nice when browsing the docs on GitHub, and there I do not have any root folder like on the website. And because I am generating different types of manuals residing in different subdirectories with one command, I do not want everything to be flattened. Do you have any idea how to still use just one set of CSS files for everything without manually adding information to the header of each ADOC file? |
The plugin is a wrapper around
It's tough to decide what we put in the examples, we can't cover everything, At the end we settled to focus on integration configuration, not options/attributes configurations, sorry.
You can hack it with multiple executions:
For this to work in a published site, I think (not CSS expert myself) you'll need to set the path as absolute in the root "/my-style.css", that will work on a web environment, but not locally though.
The best way to get general asciidoctor support is in Zulip http://chat.asciidoctor.org/.
Apologies in advance, I don't mean to be rude, but my suggestion is to not try. GitHub does not use the most recent version of Asciidoctor and does not support all features (links and includes for instance). GitLab offers a better experience and even then it's not going to be the same as rendering your content. If you have a WIP public repo, feel free to point it. |
I understand. I was mentioning it, because I wanted you to know that I searched before asking - due diligence.
Good to know, thanks for the link. Yet another new chat tool, sigh. I already use so many: Telegram, Gitter, WhatsApp, Slack, Teams. But at least, it is not IRC, which would be worse. 😉
I know it does not support includes and GitLab does, but I will not move the repo just because of that. And I said "nice", not "perfect". If at least each single ADOC is rendered correctly with included pics, that is good enough for now. Currently, this is the case.
Well, that is the exact reason why I am using the Maven plugin: to create static HTML for GH Pages and for packaging the docs into the binary distro used in the executable JAR installer. But still, when simply browsing the GH repo while looking for something, it is desirable to me to be able to see something meaningful when clicking on an ADOC file. I might have changed something, but not updated the website, because I only plan to do that for releases, not in between - at least not often.
The project is Eclipse AspectJ. Start at this landing page ADOC in my asciidoc branch: The current count is 118 asciidoc files. Then look around, especially in parts of the table for which there are 3 links (multi page HTML, single page HTML, PDF). The latter two will only work on the website, because rendered PDF and HTML are not in the SCM, of course. Multi page HTML would work on GitLab, I know, but... see above. |
TODO: There still is one set of CSS files per subdirectory due to the way the docs directories are organised. It would be better to have them just once. But to achieve that, the ADOC-to-HTML conversion would have to be changed, e.g. using one central directory for images and reorganisation of the overall directory structure and build options. See asciidoctor/asciidoctor-maven-plugin#729. Signed-off-by: Alexander Kriegisch <[email protected]>
TODO: There still is one set of CSS files per subdirectory due to the way the docs directories are organised. It would be better to have them just once. But to achieve that, the ADOC-to-HTML conversion would have to be changed, e.g. using one central directory for images and reorganisation of the overall directory structure and build options. See asciidoctor/asciidoctor-maven-plugin#729. Signed-off-by: Alexander Kriegisch <[email protected]>
TODO: There still is one set of CSS files per subdirectory due to the way the docs directories are organised. It would be better to have them just once. But to achieve that, the ADOC-to-HTML conversion would have to be changed, e.g. using one central directory for images and reorganisation of the overall directory structure and build options. See asciidoctor/asciidoctor-maven-plugin#729. Signed-off-by: Alexander Kriegisch <[email protected]>
TODO: There still is one set of CSS files per subdirectory due to the way the docs directories are organised. It would be better to have them just once. But to achieve that, the ADOC-to-HTML conversion would have to be changed, e.g. using one central directory for images and reorganisation of the overall directory structure and build options. See asciidoctor/asciidoctor-maven-plugin#729. Signed-off-by: Alexander Kriegisch <[email protected]>
TODO: There still is one set of CSS files per subdirectory due to the way the docs directories are organised. It would be better to have them just once. But to achieve that, the ADOC-to-HTML conversion would have to be changed, e.g. using one central directory for images and reorganisation of the overall directory structure and build options. See asciidoctor/asciidoctor-maven-plugin#729. Signed-off-by: Alexander Kriegisch <[email protected]>
Description
Using the Maven plugin, I am creating dozens of HTML files from asciidoc files. Each one of them embeds a significant amount of CSS. As all the generated docs will end up on the same website, I am wondering if there is any way to generate CSS just once and automatically link to it from each HTML file.
I am not very experienced in all things Asciidoctor, but I read about safe mode and
linkcss
. What I do not know, is whether I can set those options centrally as a Maven plugin option or need to edit each single file to have the same settings. I found no examples setting those attributes here or in the Maven plugin examples repository.If it is relevant, I still need to be using
include::
in some documents.BTW, I searched the web and Stack Overflow for an answer, but did not find any.
The text was updated successfully, but these errors were encountered: