asciidoctor / asciidoctor-latex

:triangular_ruler: Add LaTeX features to AsciiDoc & convert AsciiDoc to LaTeX
http://asciidoctor.org
Other
112 stars 26 forks source link

Add style sheet? #30

Closed jxxcarlson closed 9 years ago

jxxcarlson commented 9 years ago

Is there a way to package a CSS style sheet with the distribution of Asciidoctor-latex? This would be a small file that would be loaded after the main Asciidoctor CSS file.

jxxcarlson commented 9 years ago

I suppose one could put foo.css in the data directory. But how would asciidoctor-latex know it is there?

mojavelinux commented 9 years ago

Yes, I recommend putting stylesheets in the data directory. That's how Asciidoctor core does it. You can see how Asciidoctore core locates this file by looking at the following lines of code:

Essentially, you use the main source file in the gem to get the path of the gem. From there, you build the path to the data directory. (There is a built-in way in RubyGems to get the path to the data directory for a gem, but it's questionable whether it's a public API).

I may have mentioned this already, but you can now use a DocinfoProcessor to contribute additional content to the <head> of the HTML document. For an example, see https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/license-url-docinfoprocessor.rb (that's the shorthand version of an extension...you can also see the longhand here https://github.com/asciidoctor/asciidoctor/blob/master/test/extensions_test.rb#L120).

jxxcarlson commented 9 years ago

Done

mojavelinux commented 9 years ago

:+1: