Prev Next | Back Along | Up Home

Stylesheets

html.py inserts into the generated HTML a link to a cascading stylesheet, defaulting to "default.css" (override with a "--stylesheet" or "--stylesheet-path" command-line option or with configuration file settings). The "tools/stylesheets/default.css" stylesheet is provided for basic use. To experiment with styles, rather than editing the default stylesheet (which will be updated as the project evolves), it is recommended to use an "@import" statement to create a "wrapper" stylesheet. For example, a "my.css" stylesheet could contain the following:

@import url(default.css);

h1, h2, h3, h4, h5, h6, p.topic-title {
  font-family: sans-serif }

Generate HTML with the following command:

html.py -stg --stylesheet my.css test.txt test.html

When viewed in a browser, the new "wrapper" stylesheet will change the typeface family of titles to "sans serif", typically Helvetica or Arial. Other styles will not be affected. Styles in wrapper stylesheets override styles in imported stylesheets, enabling incremental experimentation.

Prev Next | Back Along | Up Home