Glyph - Adding Stylesheets

← XML Fallback | Contents | Content Reuse →

Currently, Glyph does not provide any native way to format text and pages. The reason is that there's absolutely no need for that: CSS does the job just fine. In particular, CSS3 offers specific attributes and elements that can be used specifically for paginated documents. That's no replacement for LaTeX by any means, but it is enough if you're not looking for advanced typographical features.

You can embed CSS files using the style macro, like this:

style[default.css]

In this case, the style macro looks for a default.css file in the /styles folder of your Glyph project and among the default Glyph stylesheets, and embeds it within a <style> tag. If you supply a file with a .sass or .scss extension, it will interpret it as a Sass file and convert it to CSS automatically (if the Haml gem is installed).

TipBy default, stylesheets are embedded within text files. If necessary, you can choose to link them or import them by changing the values of the document.styles setting.

Default Stylesheets

Glyph provides the following default stylesheets, that can be referenced directly using the style macro:

File name Notes
default.css The stylesheet used for this book.
pagination.css A CSS3-compliant stylesheet used for pagination, suitable for PDF generation using Prince.
coderay.css The default Coderay stylesheet, used for syntax highlighting.
ultraviolet/* This folder contains the following Ultraviolet stylesheets, used for syntax highlighting: active4d.css, all_hallows_eve.css, amy.css, blackboard.css, brilliance_black.css, brilliance_dull.css, cobalt.css, dawn.css, eiffel.css, espresso_libre.css, idle.css, iplastic.css, lazy.css, mac_classic.css, magicwb_amiga.css, pastels_on_dark.css, slush_poppies.css, spacecadet.css, sunburst.css, twilight.css, zenburnesque.css
← XML Fallback | Contents | Content Reuse →