17
Dokumentation von Softwareprojekten mit Sphinx Markus Zapke-Gründemann Chemnitzer Linux-Tage 2011

Sphinx

Embed Size (px)

DESCRIPTION

Mit Hilfe von Sphinx lassen sich Softwareprojekte einfach und trotzdem visuell ansprechend dokumentieren.Ursprünglich zur Dokumentation der Programmiersprache Python geschrieben benutzen inzwischen auch viele andere Projekte Sphinx.Mit Hilfe einer einfachen Markup-Sprache werden Sphinx-Dokumente formatiert und in einer Baumstruktur abgelegt. Es werden diverse Ausgabeformate unterstützt: HTML, LaTeX (zur Erzeugung von PDF-Dateien), Manual Pages und Plain Text.Sphinx ist Open Source Software (BSD Lizenz).

Citation preview

Page 1: Sphinx

Dokumentation von Softwareprojekten mit SphinxMarkus Zapke-Gründemann

Chemnitzer Linux-Tage 2011

Page 2: Sphinx

Überblick

Vorstellung

Was ist Sphinx?

Das Projekt

Projekte, die Sphinx nutzen

Installation

Erste Schritte

HTML Themes

Extensions

Read the Docs

Page 3: Sphinx

Markus Zapke-Gründemann

Softwareentwickler seit 2001

Softwareentwicklung mit Python, Django und Mercurial

Freier Softwareentwickler und Berater seit 2008

www.keimlink.de

Page 4: Sphinx

Was ist Sphinx?

Dokumentationssystem

Verarbeitet reStructuredText

Ausgabeformate: HTML, PDF, LaTeX, epub, manpages

Open Source Software (BSD Lizenz)

http://sphinx.pocoo.org

Page 5: Sphinx

Das Projekt

Autor und Maintainer: Georg Brandl

Python

Jinja2 (Templates)

Pygments (Syntax Highlighting)

Docutils (reStructuredText)

Page 6: Sphinx

Projekte, die Sphinx nutzen

Blender

Django

Drizzle

Python

SQLAlchemy

Zope

Page 7: Sphinx

Installation$ pip install sphinx

oder

http://pypi.python.org/pypi/Sphinx$ tar xzf Sphinx-1.0.7.tar.gz$ python setup.py build$ sudo python setup.py install

Page 8: Sphinx

Erste Schritte

$ sphinx-quickstart

Page 9: Sphinx

Erste Schritteindex.rst

.. toctree:: :maxdepth: 2

intro tutorial ...

Page 10: Sphinx

Erste SchritteFirst Steps with Sphinx=======================

Setting up the documentation sources------------------------------------

The root directory of a documentation collection is called the :term:`sourcedirectory`. This directory also contains the Sphinx configuration file:file:`conf.py`, where you can configure all aspects of how Sphinx reads yoursources and builds your documentation. [#]_

Sphinx comes with a script called :program:`sphinx-quickstart` that sets up asource directory and creates a default :file:`conf.py` with the most usefulconfiguration values from a few questions it asks you. Just run ::

$ sphinx-quickstart

and answer its questions. (Be sure to say yes to the "autodoc" extension.)

http://sphinx.pocoo.org/rest.html

Page 11: Sphinx

Erste Schritte

$ make html

Page 12: Sphinx

Erste Schritte

First Steps with SphinxSetting up the documentation sourcesThe root directory of a documentation collection is called the source directory. This directory also contains the Sphinx configuration file conf.py, where you can configure all aspects of how Sphinx reads your sources and builds your documentation. [1]

Sphinx comes with a script called sphinx-quickstart that sets up a source directory and creates a default conf.py with the most useful configuration values from a few questions it asks you. Just run

$ sphinx-quickstart

and answer its questions. (Be sure to say yes to the “autodoc” extension.)

Page 13: Sphinx

HTML Themes

html_theme = "default"

Page 14: Sphinx

HTML Themes

html_theme = "nature"

Page 15: Sphinx

Extensions

autodoc

doctest

intersphinx

graphviz

coverage

todo

Page 16: Sphinx

Read the Docs

http://readthedocs.org

Page 17: Sphinx

Lizenz

Dieses Werk ist unter einem Creative Commons Namensnennung-Weitergabe unter gleichen

Bedingungen 3.0 Unported Lizenzvertrag lizenziert. Um die Lizenz anzusehen, gehen Sie bitte zu

http://creativecommons.org/licenses/by-sa/3.0/ oder schicken Sie einen Brief an Creative Commons, 171 Second Street, Suite 300, San Francisco, California

94105, USA.