mirror of https://github.com/mitsuhiko/flask.git
David Lord
7 years ago
25 changed files with 190 additions and 590 deletions
@ -1,118 +1,20 @@ |
|||||||
# Makefile for Sphinx documentation
|
# Minimal makefile for Sphinx documentation
|
||||||
#
|
#
|
||||||
|
|
||||||
# You can set these variables from the command line.
|
# You can set these variables from the command line.
|
||||||
SPHINXOPTS =
|
SPHINXOPTS =
|
||||||
SPHINXBUILD = sphinx-build
|
SPHINXBUILD = sphinx-build
|
||||||
PAPER =
|
SPHINXPROJ = Flask
|
||||||
|
SOURCEDIR = .
|
||||||
BUILDDIR = _build
|
BUILDDIR = _build
|
||||||
|
|
||||||
# Internal variables.
|
# Put it first so that "make" without argument is like "make help".
|
||||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
|
||||||
PAPEROPT_letter = -D latex_paper_size=letter
|
|
||||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
|
||||||
|
|
||||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp epub latex changes linkcheck doctest |
|
||||||
|
|
||||||
help: |
help: |
||||||
@echo "Please use \`make <target>' where <target> is one of"
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
@echo " html to make standalone HTML files"
|
|
||||||
@echo " dirhtml to make HTML files named index.html in directories"
|
|
||||||
@echo " singlehtml to make a single large HTML file"
|
|
||||||
@echo " pickle to make pickle files"
|
|
||||||
@echo " json to make JSON files"
|
|
||||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
|
||||||
@echo " qthelp to make HTML files and a qthelp project"
|
|
||||||
@echo " devhelp to make HTML files and a Devhelp project"
|
|
||||||
@echo " epub to make an epub"
|
|
||||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
|
||||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
|
||||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
|
||||||
@echo " linkcheck to check all external links for integrity"
|
|
||||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
|
||||||
|
|
||||||
clean: |
|
||||||
-rm -rf $(BUILDDIR)/*
|
|
||||||
|
|
||||||
html: |
|
||||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
|
||||||
|
|
||||||
dirhtml: |
|
||||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
|
||||||
|
|
||||||
singlehtml: |
|
||||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
|
||||||
|
|
||||||
pickle: |
|
||||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can process the pickle files."
|
|
||||||
|
|
||||||
json: |
|
||||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can process the JSON files."
|
|
||||||
|
|
||||||
htmlhelp: |
|
||||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
|
||||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
|
||||||
|
|
||||||
qthelp: |
|
||||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
|
||||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
|
||||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Flask.qhcp"
|
|
||||||
@echo "To view the help file:"
|
|
||||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Flask.qhc"
|
|
||||||
|
|
||||||
devhelp: |
|
||||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) _build/devhelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished."
|
|
||||||
@echo "To view the help file:"
|
|
||||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/Flask"
|
|
||||||
@echo "# ln -s _build/devhelp $$HOME/.local/share/devhelp/Flask"
|
|
||||||
@echo "# devhelp"
|
|
||||||
|
|
||||||
epub: |
|
||||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
|
||||||
|
|
||||||
latex: |
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
|
||||||
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
|
|
||||||
"run these through (pdf)latex."
|
|
||||||
|
|
||||||
latexpdf: latex |
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex
|
|
||||||
@echo "Running LaTeX files through pdflatex..."
|
|
||||||
make -C _build/latex all-pdf
|
|
||||||
@echo "pdflatex finished; the PDF files are in _build/latex."
|
|
||||||
|
|
||||||
changes: |
|
||||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
|
||||||
@echo
|
|
||||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
|
||||||
|
|
||||||
linkcheck: |
.PHONY: help Makefile |
||||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
|
||||||
@echo
|
|
||||||
@echo "Link check complete; look for any errors in the above output " \
|
|
||||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
|
||||||
|
|
||||||
doctest: |
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||||
@echo "Testing of doctests in the sources finished, look at the " \
|
%: Makefile |
||||||
"results in $(BUILDDIR)/doctest/output.txt."
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
@ -1,22 +0,0 @@ |
|||||||
<h3>About Flask</h3> |
|
||||||
<p> |
|
||||||
Flask is a micro web development framework for Python. You are currently |
|
||||||
looking at the documentation of the development version. |
|
||||||
</p> |
|
||||||
<h3>Other Formats</h3> |
|
||||||
<p> |
|
||||||
You can download the documentation in other formats as well: |
|
||||||
</p> |
|
||||||
<ul> |
|
||||||
<li><a href="http://flask.pocoo.org/docs/flask-docs.pdf">as PDF</a> |
|
||||||
<li><a href="http://flask.pocoo.org/docs/flask-docs.epub">as ePub</a> |
|
||||||
<li><a href="http://flask.pocoo.org/docs/flask-docs.mobi">as .mobi</a> |
|
||||||
<li><a href="http://flask.pocoo.org/docs/flask-docs.zip">as zipped HTML</a> |
|
||||||
</ul> |
|
||||||
<h3>Useful Links</h3> |
|
||||||
<ul> |
|
||||||
<li><a href="http://flask.pocoo.org/">The Flask Website</a></li> |
|
||||||
<li><a href="https://pypi.python.org/pypi/Flask">Flask @ PyPI</a></li> |
|
||||||
<li><a href="https://github.com/pallets/flask">Flask @ GitHub</a></li> |
|
||||||
<li><a href="https://github.com/pallets/flask/issues">Issue Tracker</a></li> |
|
||||||
</ul> |
|
@ -1,3 +0,0 @@ |
|||||||
<p class="logo"><a href="{{ pathto(master_doc) }}"> |
|
||||||
<img class="logo" src="{{ pathto('_static/flask.png', 1) }}" alt="Logo"/> |
|
||||||
</a></p> |
|
@ -1,16 +0,0 @@ |
|||||||
import re |
|
||||||
import inspect |
|
||||||
|
|
||||||
|
|
||||||
_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)') |
|
||||||
|
|
||||||
|
|
||||||
def skip_member(app, what, name, obj, skip, options): |
|
||||||
docstring = inspect.getdoc(obj) |
|
||||||
if skip: |
|
||||||
return True |
|
||||||
return _internal_mark_re.search(docstring or '') is not None |
|
||||||
|
|
||||||
|
|
||||||
def setup(app): |
|
||||||
app.connect('autodoc-skip-member', skip_member) |
|
@ -1,139 +1,36 @@ |
|||||||
@ECHO OFF |
@ECHO OFF |
||||||
|
|
||||||
|
pushd %~dp0 |
||||||
|
|
||||||
REM Command file for Sphinx documentation |
REM Command file for Sphinx documentation |
||||||
|
|
||||||
if "%SPHINXBUILD%" == "" ( |
if "%SPHINXBUILD%" == "" ( |
||||||
set SPHINXBUILD=sphinx-build |
set SPHINXBUILD=sphinx-build |
||||||
) |
) |
||||||
|
set SOURCEDIR=. |
||||||
set BUILDDIR=_build |
set BUILDDIR=_build |
||||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . |
set SPHINXPROJ=Flask |
||||||
if NOT "%PAPER%" == "" ( |
|
||||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "" goto help |
if "%1" == "" goto help |
||||||
|
|
||||||
if "%1" == "help" ( |
%SPHINXBUILD% >NUL 2>NUL |
||||||
:help |
if errorlevel 9009 ( |
||||||
echo.Please use `make ^<target^>` where ^<target^> is one of |
|
||||||
echo. html to make standalone HTML files |
|
||||||
echo. dirhtml to make HTML files named index.html in directories |
|
||||||
echo. singlehtml to make a single large HTML file |
|
||||||
echo. pickle to make pickle files |
|
||||||
echo. json to make JSON files |
|
||||||
echo. htmlhelp to make HTML files and a HTML help project |
|
||||||
echo. qthelp to make HTML files and a qthelp project |
|
||||||
echo. devhelp to make HTML files and a Devhelp project |
|
||||||
echo. epub to make an epub |
|
||||||
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 |
|
||||||
echo. linkcheck to check all external links for integrity |
|
||||||
echo. doctest to run all doctests embedded in the documentation if enabled |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "clean" ( |
|
||||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i |
|
||||||
del /q /s %BUILDDIR%\* |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "html" ( |
|
||||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html |
|
||||||
echo. |
|
||||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "dirhtml" ( |
|
||||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml |
|
||||||
echo. |
|
||||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "singlehtml" ( |
|
||||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml |
|
||||||
echo. |
|
||||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "pickle" ( |
|
||||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle |
|
||||||
echo. |
echo. |
||||||
echo.Build finished; now you can process the pickle files. |
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx |
||||||
goto end |
echo.installed, then set the SPHINXBUILD environment variable to point |
||||||
) |
echo.to the full path of the 'sphinx-build' executable. Alternatively you |
||||||
|
echo.may add the Sphinx directory to PATH. |
||||||
if "%1" == "json" ( |
|
||||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json |
|
||||||
echo. |
echo. |
||||||
echo.Build finished; now you can process the JSON files. |
echo.If you don't have Sphinx installed, grab it from |
||||||
goto end |
echo.http://sphinx-doc.org/ |
||||||
|
exit /b 1 |
||||||
) |
) |
||||||
|
|
||||||
if "%1" == "htmlhelp" ( |
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% |
||||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp |
goto end |
||||||
echo. |
|
||||||
echo.Build finished; now you can run HTML Help Workshop with the ^ |
|
||||||
.hhp project file in %BUILDDIR%/htmlhelp. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "qthelp" ( |
:help |
||||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp |
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% |
||||||
echo. |
|
||||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^ |
|
||||||
.qhcp project file in %BUILDDIR%/qthelp, like this: |
|
||||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Flask.qhcp |
|
||||||
echo.To view the help file: |
|
||||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Flask.ghc |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "devhelp" ( |
|
||||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% _build/devhelp |
|
||||||
echo. |
|
||||||
echo.Build finished. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "epub" ( |
|
||||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub |
|
||||||
echo. |
|
||||||
echo.Build finished. The epub file is in %BUILDDIR%/epub. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "latex" ( |
|
||||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex |
|
||||||
echo. |
|
||||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "changes" ( |
|
||||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes |
|
||||||
echo. |
|
||||||
echo.The overview file is in %BUILDDIR%/changes. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "linkcheck" ( |
|
||||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck |
|
||||||
echo. |
|
||||||
echo.Link check complete; look for any errors in the above output ^ |
|
||||||
or in %BUILDDIR%/linkcheck/output.txt. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
if "%1" == "doctest" ( |
|
||||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest |
|
||||||
echo. |
|
||||||
echo.Testing of doctests in the sources finished, look at the ^ |
|
||||||
results in %BUILDDIR%/doctest/output.txt. |
|
||||||
goto end |
|
||||||
) |
|
||||||
|
|
||||||
:end |
:end |
||||||
|
popd |
||||||
|
Loading…
Reference in new issue