File: //usr/share/doc/varnish-6.0.3/html/phk/sphinx.html
<!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">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Why Sphinx and reStructuredText ? — Varnish version 6.0.3 documentation</title>
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Notes from the Architect" href="notes.html" />
<link rel="prev" title="Did you call them autocrap tools ?" href="autocrap.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="notes.html" title="Notes from the Architect"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="autocrap.html" title="Did you call them autocrap tools ?"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Varnish version 6.0.3 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Poul-Hennings random outbursts</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="why-sphinx-and-restructuredtext">
<span id="phk-sphinx"></span><h1>Why <a class="reference external" href="http://sphinx.pocoo.org/">Sphinx</a> and <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> ?<a class="headerlink" href="#why-sphinx-and-restructuredtext" title="Permalink to this headline">¶</a></h1>
<p>The first school of thought on documentation, is the one we subscribe
to in Varnish right now: “Documentation schmocumentation…” It does
not work for anybody.</p>
<p>The second school is the “Write a {La}TeX document” school, where
the documentation is seen as a stand alone product, which is produced
independently. This works great for PDF output, and sucks royally
for HTML and TXT output.</p>
<p>The third school is the “Literate programming” school, which abandons
readability of <em>both</em> the program source code <em>and</em> the documentation
source, which seems to be one of the best access protections
one can put on the source code of either.</p>
<p>The fourth school is the “DoxyGen” school, which lets a program
collect a mindless list of hyperlinked variable, procedure, class
and filenames, and call that “documentation”.</p>
<p>And the fifth school is anything that uses a fileformat that
cannot be put into a version control system, because it is
binary and non-diff’able. It doesn’t matter if it is
OpenOffice, LyX or Word, a non-diffable doc source is a no go
with programmers.</p>
<p>Quite frankly, none of these works very well in practice.</p>
<p>One of the very central issues, is that writing documentation must
not become a big and clear context-switch from programming. That
precludes special graphical editors, browser-based (wiki!) formats
etc.</p>
<p>Yes, if you write documentation for half your workday, that works,
but if you write code most of your workday, that does not work.
Trust me on this, I have 25 years of experience avoiding using such
tools.</p>
<p>I found one project which has thought radically about the problem,
and their reasoning is interesting, and quite attractive to me:</p>
<ol class="arabic simple">
<li>TXT files are the lingua franca of computers, even if
you are logged with TELNET using IP over Avian Carriers
(Which is more widespread in Norway than you would think)
you can read documentation in a .TXT format.</li>
<li>TXT is the most restrictive typographical format, so
rather than trying to neuter a high-level format into .TXT,
it is smarter to make the .TXT the source, and reinterpret
it structurally into the more capable formats.</li>
</ol>
<p>In other words: we are talking about the <a class="reference external" href="http://docutils.sourceforge.net/rst.html">ReStructuredText</a> of the
Python project, as wrapped by the <a class="reference external" href="http://sphinx.pocoo.org/">Sphinx</a> project.</p>
<p>Unless there is something I have totally failed to spot, that is
going to be the new documentation platform in Varnish.</p>
<p>Take a peek at the Python docs, and try pressing the “show source”
link at the bottom of the left menu:</p>
<p>(link to random python doc page:)</p>
<blockquote>
<div><a class="reference external" href="https://docs.python.org/py3k/reference/expressions.html">https://docs.python.org/py3k/reference/expressions.html</a></div></blockquote>
<p>Dependency wise, that means you can edit docs with no special
tools, you need python+docutils+sphinx to format HTML and a LaTex
(pdflatex ?) to produce PDFs, something I only expect to happen
on the project server on a regular basis.</p>
<p>I can live with that, I might even rewrite the VCC scripts
from Tcl to Python in that case.</p>
<p>Poul-Henning, 2010-04-11</p>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="autocrap.html"
title="previous chapter">Did you call them <em>autocrap</em> tools ?</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="notes.html"
title="next chapter">Notes from the Architect</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/phk/sphinx.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="notes.html" title="Notes from the Architect"
>next</a> |</li>
<li class="right" >
<a href="autocrap.html" title="Did you call them autocrap tools ?"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Varnish version 6.0.3 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="index.html" >Poul-Hennings random outbursts</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2010-2014, Varnish Software AS.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.6.
</div>
</body>
</html>