reStructuredText

Front ends

  • Docutils package
    • (X)HTML documents
      • rst2html.py [options] [<source> [<destination>]]
    • LaTeX documents
      • rst2latex.py [options] [<source> [<destination>]]
      • rst2newlatex.py [options] [<source> [<destination>]]
    • S5 (X)HTML slideshow documents
      • rst2s5.py [options] [<source> [<destination>]]
    • man — plain unix manual documents
      • rst2man.py [options] [<source> [<destination>]]
    • XML
      • rst2xml.py [options] [<source> [<destination>]]
    • pseudo-XML
      • rst2pseudoxml.py [options] [<source> [<destination>]]
    • OpenDocument/OpenOffice/ODF documents
      • rst2odt.py [options] [<source> [<destination>]]
    • (X)HTML from reStructuredText-format PEP files
      • rstpep2html.py [options] [<source> [<destination>]]
  • Sphinx package
    • HTML
      • sphinx-build sourcedir builddir
    • LaTex
      • sphinx-build -b latex sourcedir builddir
  • rst2pdf package
    • PDF documents
      • rst2pdf in.txt [-o out.pdf]
  • rst2chm script
    • CHM Help files
      • rst2chm.py [options] out.chm in.txt [in2.txt…]

See Also

rst2html

Stylesheets

for Watermark:

body {
    background-image: url(watermark.png);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center center;
}

For layout images with tables:

table.imagetable th, table.imagetable td {
    border-style: none;
    text-align: center;
}

See Also

rst2chm

patch of rst2chm.py v0.3 for compatible with docutils version 0.7

replace line 314:

pub.apply_transforms(document)

with:

document.transformer.apply_transforms()

install

copy rst2chm.py %PYTHON_HOME%\Scripts

See Also

rst2pdf

A Manual Stylesheet

{
    pageTemplates: {
        # for watermark
        oneColumn: {
            background: watermark.png
        }
    },
 
    # for the support of Chinese characters
    embeddedFonts : [[kaiu.ttf, kaiu.ttf, kaiu.ttf, kaiu.ttf]],
    fontsAlias : {
        stdFont: kaiu,
        stdBold: kaiu,
        stdItalic: kaiu,
        stdBoldItalic: kaiu,
        stdMono: kaiu
    },
 
    styles: {
        # for correcting layout of inline images in tables
        base: {
            autoLeading: max
        },
 
        # for Layout with tables
        layout-table: {
            parent: table,
            commands: []
        },
        imagetable: {
            parent: layout-table,
            commands: [
                [BOX, [ 0, 0 ], [ -1, -1 ], 0.25, gray ]
            ]
        },
        footertable: {
            parent: layout-table
        },
        headertable: {
            parent: layout-table
        },
        table-body : {
            alignment: TA_CENTER
        }
    }
}

See Also

Other Links

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License