Skip to content

Commit

Permalink
Add single-file HTML builder. Closes #151.
Browse files Browse the repository at this point in the history
  • Loading branch information
birkenfeld committed Jan 17, 2010
1 parent f3fc36b commit 744a519
Show file tree
Hide file tree
Showing 8 changed files with 343 additions and 177 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Release 1.0 (in development)
============================

* Added single-file HTML builder.

* Added ``tab-width`` option to ``literalinclude`` directive.

* The ``html_sidebars`` config value can now contain patterns as
Expand Down
5 changes: 5 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ dirhtml:
@echo
@echo "Build finished. The HTML pages are in _build/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) _build/singlehtml
@echo
@echo "Build finished. The HTML page is in _build/singlehtml."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) _build/text
@echo
Expand Down
10 changes: 10 additions & 0 deletions doc/builders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ The builder's "name" must be given to the **-b** command-line option of

.. versionadded:: 0.6

.. class:: SingleFileHTMLBuilder

This is an HTML builder that combines the whole project in one output file.
(Obviously this only works with smaller projects.) The file is named like
the master document. No indices will be generated.

Its name is ``singlehtml``.

.. versionadded:: 1.0

.. module:: sphinx.builders.htmlhelp
.. class:: HTMLHelpBuilder

Expand Down
27 changes: 14 additions & 13 deletions sphinx/builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,17 +380,18 @@ def cleanup(self):


BUILTIN_BUILDERS = {
'html': ('html', 'StandaloneHTMLBuilder'),
'dirhtml': ('html', 'DirectoryHTMLBuilder'),
'pickle': ('html', 'PickleHTMLBuilder'),
'json': ('html', 'JSONHTMLBuilder'),
'web': ('html', 'PickleHTMLBuilder'),
'htmlhelp': ('htmlhelp', 'HTMLHelpBuilder'),
'devhelp': ('devhelp', 'DevhelpBuilder'),
'qthelp': ('qthelp', 'QtHelpBuilder'),
'epub': ('epub', 'EpubBuilder'),
'latex': ('latex', 'LaTeXBuilder'),
'text': ('text', 'TextBuilder'),
'changes': ('changes', 'ChangesBuilder'),
'linkcheck': ('linkcheck', 'CheckExternalLinksBuilder'),
'html': ('html', 'StandaloneHTMLBuilder'),
'dirhtml': ('html', 'DirectoryHTMLBuilder'),
'singlehtml': ('html', 'SingleFileHTMLBuilder'),
'pickle': ('html', 'PickleHTMLBuilder'),
'json': ('html', 'JSONHTMLBuilder'),
'web': ('html', 'PickleHTMLBuilder'),
'htmlhelp': ('htmlhelp', 'HTMLHelpBuilder'),
'devhelp': ('devhelp', 'DevhelpBuilder'),
'qthelp': ('qthelp', 'QtHelpBuilder'),
'epub': ('epub', 'EpubBuilder'),
'latex': ('latex', 'LaTeXBuilder'),
'text': ('text', 'TextBuilder'),
'changes': ('changes', 'ChangesBuilder'),
'linkcheck': ('linkcheck', 'CheckExternalLinksBuilder'),
}
Loading

0 comments on commit 744a519

Please sign in to comment.