Server IP : 127.0.0.2 / Your IP : 18.222.48.95 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/docutils-doc/docs/howto/ |
Upload File : |
<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <title>Writing HTML (CSS) Stylesheets for Docutils</title> <meta name="author" content="Lea Wiemann" /> <meta name="date" content="2012-01-03" /> <meta name="copyright" content="This document has been placed in the public domain." /> <link rel="stylesheet" href="../../css/html4css1.css" type="text/css" /> </head> <body> <div class="document" id="writing-html-css-stylesheets-for-docutils"> <h1 class="title">Writing HTML (CSS) Stylesheets for <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a></h1> <table class="docinfo" frame="void" rules="none"> <col class="docinfo-name" /> <col class="docinfo-content" /> <tbody valign="top"> <tr><th class="docinfo-name">Author:</th> <td>Lea Wiemann</td></tr> <tr><th class="docinfo-name">Contact:</th> <td><a class="first last reference external" href="mailto:docutils-develop@lists.sourceforge.net">docutils-develop@lists.sourceforge.net</a></td></tr> <tr><th class="docinfo-name">Date:</th> <td>2012-01-03</td></tr> <tr><th class="docinfo-name">Revision:</th> <td>7302</td></tr> <tr><th class="docinfo-name">Copyright:</th> <td>This document has been placed in the public domain.</td></tr> </tbody> </table> <p>The look of Docutils' HTML output is customizable via CSS stylesheets. The default stylesheet is called <tt class="docutils literal">html4css1.css</tt> and can be found in the <tt class="docutils literal">writers/html4css1/</tt> directory of the Docutils installation. Use the command <tt class="docutils literal">rst2html.py <span class="pre">--help</span></tt> and look at the description of the <tt class="docutils literal"><span class="pre">--stylesheet-path</span></tt> command-line option for the exact machine-specific location.</p> <p>To customize the stylesheet, first copy <tt class="docutils literal">html4css1.css</tt> to the same place as your output HTML files will go. Next, place a new file (e.g. called <tt class="docutils literal"><span class="pre">my-docutils.css</span></tt>) in the same directory and use the following template:</p> <pre class="literal-block"> /* :Author: Your Name :Contact: Your Email Address :Copyright: This stylesheet has been placed in the public domain. Stylesheet for use with Docutils. [Optionally place a more detailed description here.] */ @import url(html4css1.css); /* Your customizations go here. For example: */ h1, h2, h3, h4, h5, h6, p.topic-title { font-family: sans-serif } </pre> <p>For help on the CSS syntax, please see <a class="reference external" href="http://www.htmlhelp.com/reference/css/">the WDG's guide to Cascading Style Sheets</a> and, in particular, their <a class="reference external" href="http://www.htmlhelp.com/reference/css/all-properties.html">list of CSS1 properties</a>. Another good reference site is <a class="reference external" href="http://selfhtml.org">http://selfhtml.org</a> (German and French).</p> <p>It is important that you do not edit a copy of <tt class="docutils literal">html4css1.css</tt> directly because <tt class="docutils literal">html4css1.css</tt> is frequently updated with each new release of Docutils.</p> <p>Also make sure that you import <tt class="docutils literal">html4css1.css</tt> (using "<tt class="docutils literal">@import url(html4css1.css);</tt>") because the definitions contained in the default stylesheet are required for correct rendering (margins, alignment, etc.).</p> <p>Alternatively, specify both, the default stylesheet and your stylesheet to the <tt class="docutils literal"><span class="pre">--stylesheet</span></tt> or <tt class="docutils literal"><span class="pre">--stylesheet-path</span></tt> command line option (or the corresponding settings in a <a class="reference external" href="../user/config.txt">configuration</a> file), e.g.</p> <pre class="literal-block"> rst2html.py --stylesheet=html4css1.css,transition-stars.css </pre> <p>This is the preferable approach if you want to embed the stylesheet(s), as this ensures that an up-to-date version of <tt class="docutils literal">html4css1.css</tt> is embedded.</p> <p>If you think your stylesheet is fancy and you would like to let others benefit from your efforts, you are encouraged to post the stylesheet to the <a class="reference external" href="../user/mailing-lists.html#docutils-users">Docutils-users</a> mailing list. It might find its place in the <a class="reference external" href="../../../sandbox/stylesheets/">stylesheet collection</a> in the Docutils <a class="reference external" href="../../../sandbox">Sandbox</a>.</p> <p>If you decide to share your stylesheet with other users of Docutils, please keep website-specific customizations not applicable to Docutils' HTML code in a separate stylesheet.</p> <!-- base for relative links is /docutils/docs/howto/ --> <!-- Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End: --> </div> </body> </html>