Install the Document

Sphinx

  1. Write the ‘setup.py’

    Write a setup with imported setupdocx classes, for a complete example refer to Source.

    1
    2
    3
    4
    5
    6
    7
    #
    # setup extension modules
    #
    from setupdocx import usage, sed
    
    # documents
    from setupdocx.install_docx import InstallDocX
    

    Add a custom class:

    1
    2
    3
    4
    5
    6
    7
    class install_docx(BuildDocX):
        """Defines additional text processing.
        """
    
        def __init__(self, *args, **kargs):
            BuildDocX.__init__(self, *args, **kargs)
            self.name = 'setupdocx'
    

    Integrate into distutils [distutils]:

    1
    2
    3
    4
    setup(
        cmdclass={
            'install_docx': install_docx,
        },
    
  2. Call the ‘setup.py’

    Install the document:

    python setup.py install_docx --name-in=<your-docname>
    

    The document is installed by default in the directory:

    doc/<docname>
    
  3. Read the Document

    In case of the document type html this contains by default the main page:

    doc/<docname>/index.html
    

See also EXAMPLES.