mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix a few overlong lines, and use \t instead of literal tabs.
This commit is contained in:
parent
5f78bc436b
commit
637b1379bc
@ -392,7 +392,8 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
# the sorted list of all modules, for the global module index
|
# the sorted list of all modules, for the global module index
|
||||||
modules = sorted(((mn, (self.get_relative_uri('modindex', fn) +
|
modules = sorted(((mn, (self.get_relative_uri('modindex', fn) +
|
||||||
'#module-' + mn, sy, pl, dep))
|
'#module-' + mn, sy, pl, dep))
|
||||||
for (mn, (fn, sy, pl, dep)) in self.env.modules.iteritems()),
|
for (mn, (fn, sy, pl, dep)) in
|
||||||
|
self.env.modules.iteritems()),
|
||||||
key=lambda x: x[0].lower())
|
key=lambda x: x[0].lower())
|
||||||
# collect all platforms
|
# collect all platforms
|
||||||
platforms = set()
|
platforms = set()
|
||||||
|
@ -327,7 +327,8 @@ class BuildEnvironment:
|
|||||||
added.add(docname)
|
added.add(docname)
|
||||||
else:
|
else:
|
||||||
# if the doctree file is not there, rebuild
|
# if the doctree file is not there, rebuild
|
||||||
if not path.isfile(self.doc2path(docname, self.doctreedir, '.doctree')):
|
if not path.isfile(self.doc2path(docname, self.doctreedir,
|
||||||
|
'.doctree')):
|
||||||
changed.add(docname)
|
changed.add(docname)
|
||||||
continue
|
continue
|
||||||
mtime, md5sum = self.all_docs[docname]
|
mtime, md5sum = self.all_docs[docname]
|
||||||
@ -376,7 +377,8 @@ class BuildEnvironment:
|
|||||||
self.read_doc(docname, app=app)
|
self.read_doc(docname, app=app)
|
||||||
|
|
||||||
if config.master_doc not in self.all_docs:
|
if config.master_doc not in self.all_docs:
|
||||||
self.warn(None, 'master file %s not found' % self.doc2path(config.master_doc))
|
self.warn(None, 'master file %s not found' %
|
||||||
|
self.doc2path(config.master_doc))
|
||||||
|
|
||||||
# --------- SINGLE FILE BUILDING -------------------------------------------
|
# --------- SINGLE FILE BUILDING -------------------------------------------
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class PygmentsBridge(object):
|
|||||||
# maybe Python -- try parsing it
|
# maybe Python -- try parsing it
|
||||||
src = source + '\n'
|
src = source + '\n'
|
||||||
|
|
||||||
# Replace "..." by a special mark, which is also a valid python expression
|
# Replace "..." by a mark which is also a valid python expression
|
||||||
# (Note, the highlighter gets the original source, this is only done
|
# (Note, the highlighter gets the original source, this is only done
|
||||||
# to allow "..." in code and still highlight it as Python code.)
|
# to allow "..." in code and still highlight it as Python code.)
|
||||||
mark = "__highlighting__ellipsis__"
|
mark = "__highlighting__ellipsis__"
|
||||||
@ -133,7 +133,8 @@ class PygmentsBridge(object):
|
|||||||
fmter = (self.dest == 'html' and self.hfmter or self.lfmter)[bool(linenos)]
|
fmter = (self.dest == 'html' and self.hfmter or self.lfmter)[bool(linenos)]
|
||||||
return highlight(source, lexer, fmter)
|
return highlight(source, lexer, fmter)
|
||||||
except ErrorToken:
|
except ErrorToken:
|
||||||
# this is most probably not the selected language, so let it pass unhighlighted
|
# this is most probably not the selected language,
|
||||||
|
# so let it pass unhighlighted
|
||||||
return unhighlighted()
|
return unhighlighted()
|
||||||
|
|
||||||
def get_stylesheet(self):
|
def get_stylesheet(self):
|
||||||
|
@ -100,7 +100,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
'release': builder.config.release,
|
'release': builder.config.release,
|
||||||
'date': date,
|
'date': date,
|
||||||
}
|
}
|
||||||
self.highlighter = highlighting.PygmentsBridge('latex', builder.config.pygments_style)
|
self.highlighter = highlighting.PygmentsBridge(
|
||||||
|
'latex', builder.config.pygments_style)
|
||||||
self.context = []
|
self.context = []
|
||||||
self.descstack = []
|
self.descstack = []
|
||||||
self.highlightlang = 'python'
|
self.highlightlang = 'python'
|
||||||
|
@ -187,58 +187,58 @@ ALLSPHINXOPTS = -d %(rbuilddir)s/doctrees -D latex_paper_size=$(PAPER) \\
|
|||||||
.PHONY: help clean html web htmlhelp latex changes linkcheck
|
.PHONY: help clean html web htmlhelp latex changes linkcheck
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Please use \\`make <target>' where <target> is one of"
|
\t@echo "Please use \\`make <target>' where <target> is one of"
|
||||||
@echo " html to make standalone HTML files"
|
\t@echo " html to make standalone HTML files"
|
||||||
@echo " web to make files usable by Sphinx.web"
|
\t@echo " web to make files usable by Sphinx.web"
|
||||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
\t@echo " htmlhelp to make HTML files and a HTML help project"
|
||||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
\t@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||||
@echo " changes to make an overview over all changed/added/deprecated items"
|
\t@echo " changes to make an overview over all changed/added/deprecated items"
|
||||||
@echo " linkcheck to check all external links for integrity"
|
\t@echo " linkcheck to check all external links for integrity"
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -rf %(rbuilddir)s/*
|
\t-rm -rf %(rbuilddir)s/*
|
||||||
|
|
||||||
html:
|
html:
|
||||||
mkdir -p %(rbuilddir)s/html %(rbuilddir)s/doctrees
|
\tmkdir -p %(rbuilddir)s/html %(rbuilddir)s/doctrees
|
||||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) %(rbuilddir)s/html
|
\t$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) %(rbuilddir)s/html
|
||||||
@echo
|
\t@echo
|
||||||
@echo "Build finished. The HTML pages are in %(rbuilddir)s/html."
|
\t@echo "Build finished. The HTML pages are in %(rbuilddir)s/html."
|
||||||
|
|
||||||
web:
|
web:
|
||||||
mkdir -p %(rbuilddir)s/web %(rbuilddir)s/doctrees
|
\tmkdir -p %(rbuilddir)s/web %(rbuilddir)s/doctrees
|
||||||
$(SPHINXBUILD) -b web $(ALLSPHINXOPTS) %(rbuilddir)s/web
|
\t$(SPHINXBUILD) -b web $(ALLSPHINXOPTS) %(rbuilddir)s/web
|
||||||
@echo
|
\t@echo
|
||||||
@echo "Build finished; now you can run"
|
\t@echo "Build finished; now you can run"
|
||||||
@echo " python -m sphinx.web %(rbuilddir)s/web"
|
\t@echo " python -m sphinx.web %(rbuilddir)s/web"
|
||||||
@echo "to start the server."
|
\t@echo "to start the server."
|
||||||
|
|
||||||
htmlhelp:
|
htmlhelp:
|
||||||
mkdir -p %(rbuilddir)s/htmlhelp %(rbuilddir)s/doctrees
|
\tmkdir -p %(rbuilddir)s/htmlhelp %(rbuilddir)s/doctrees
|
||||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) %(rbuilddir)s/htmlhelp
|
\t$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) %(rbuilddir)s/htmlhelp
|
||||||
@echo
|
\t@echo
|
||||||
@echo "Build finished; now you can run HTML Help Workshop with the" \\
|
\t@echo "Build finished; now you can run HTML Help Workshop with the" \\
|
||||||
".hhp project file in %(rbuilddir)s/htmlhelp."
|
\t ".hhp project file in %(rbuilddir)s/htmlhelp."
|
||||||
|
|
||||||
latex:
|
latex:
|
||||||
mkdir -p %(rbuilddir)s/latex %(rbuilddir)s/doctrees
|
\tmkdir -p %(rbuilddir)s/latex %(rbuilddir)s/doctrees
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) %(rbuilddir)s/latex
|
\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) %(rbuilddir)s/latex
|
||||||
@echo
|
\t@echo
|
||||||
@echo "Build finished; the LaTeX files are in %(rbuilddir)s/latex."
|
\t@echo "Build finished; the LaTeX files are in %(rbuilddir)s/latex."
|
||||||
@echo "Run \\`make all-pdf' or \\`make all-ps' in that directory to" \\
|
\t@echo "Run \\`make all-pdf' or \\`make all-ps' in that directory to" \\
|
||||||
"run these through (pdf)latex."
|
\t "run these through (pdf)latex."
|
||||||
|
|
||||||
changes:
|
changes:
|
||||||
mkdir -p %(rbuilddir)s/changes %(rbuilddir)s/doctrees
|
\tmkdir -p %(rbuilddir)s/changes %(rbuilddir)s/doctrees
|
||||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) %(rbuilddir)s/changes
|
\t$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) %(rbuilddir)s/changes
|
||||||
@echo
|
\t@echo
|
||||||
@echo "The overview file is in %(rbuilddir)s/changes."
|
\t@echo "The overview file is in %(rbuilddir)s/changes."
|
||||||
|
|
||||||
linkcheck:
|
linkcheck:
|
||||||
mkdir -p %(rbuilddir)s/linkcheck %(rbuilddir)s/doctrees
|
\tmkdir -p %(rbuilddir)s/linkcheck %(rbuilddir)s/doctrees
|
||||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) %(rbuilddir)s/linkcheck
|
\t$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) %(rbuilddir)s/linkcheck
|
||||||
@echo
|
\t@echo
|
||||||
@echo "Link check complete; look for any errors in the above output " \\
|
\t@echo "Link check complete; look for any errors in the above output " \\
|
||||||
"or in %(rbuilddir)s/linkcheck/output.txt."
|
\t "or in %(rbuilddir)s/linkcheck/output.txt."
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
{%- block beforerelbar %}{% endblock %}
|
{%- block beforerelbar %}{% endblock %}
|
||||||
{%- block relbar1 %}{{ relbar() }}{% endblock %}
|
{%- block relbar1 %}{{ relbar() }}{% endblock %}
|
||||||
{%- block afterrelbar %}{% endblock %}
|
{%- block afterrelbar %}{% endblock %}
|
||||||
|
|
||||||
{%- block beforesidebar1 %}{% endblock %}
|
{%- block beforesidebar1 %}{% endblock %}
|
||||||
@ -114,7 +114,7 @@
|
|||||||
<div class="clearer"></div>
|
<div class="clearer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{%- block relbar2 %}{{ relbar() }}{% endblock %}
|
{%- block relbar2 %}{{ relbar() }}{% endblock %}
|
||||||
|
|
||||||
{%- block beforefooter %}{% endblock %}
|
{%- block beforefooter %}{% endblock %}
|
||||||
{%- block footer %}
|
{%- block footer %}
|
||||||
|
@ -139,7 +139,7 @@ def check_fileheader(fn, lines):
|
|||||||
yield 0, "no correct copyright info"
|
yield 0, "no correct copyright info"
|
||||||
|
|
||||||
|
|
||||||
@checker('.py', '.html', '.js')
|
@checker('.py', '.html')
|
||||||
def check_whitespace_and_spelling(fn, lines):
|
def check_whitespace_and_spelling(fn, lines):
|
||||||
for lno, line in enumerate(lines):
|
for lno, line in enumerate(lines):
|
||||||
if "\t" in line:
|
if "\t" in line:
|
||||||
|
Loading…
Reference in New Issue
Block a user