Skip to content

Commit

Permalink
fix: Use same doctree dir
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverRainZ committed Jul 8, 2024
1 parent a32bb68 commit 1ebc74f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
8 changes: 5 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SPHINXBUILD = python3 -msphinx
SOURCEDIR = .
BUILDDIR = _build

default: fast
default: fasthtml

# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -22,5 +22,7 @@ help:
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

fast: Makefile
@$(SPHINXBUILD) -b fasthtml "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
# Without "make mode" we can specify OUTPUTDIR and DOCTREEDIR precisely
# so that we can make sure to share all output with the HTML builder.
fasthtml: Makefile
@$(SPHINXBUILD) -b $@ "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O) -d "$(BUILDDIR)/doctrees"
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@
autoclass_content = 'init'
autodoc_typehints = 'description'

extensions.append('sphinx.ext.intersphinx')
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'sphinx': ('https://www.sphinx-doc.org/en/master', None),
'jinja': ('https://jinja.palletsprojects.com/en/latest/', None),
}
# extensions.append('sphinx.ext.intersphinx')
# intersphinx_mapping = {
# 'python': ('https://docs.python.org/3', None),
# 'sphinx': ('https://www.sphinx-doc.org/en/master', None),
# 'jinja': ('https://jinja.palletsprojects.com/en/latest/', None),
# }

#
extensions.append('sphinxnotes.comboroles')
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ builtin ``html`` builder:
:language: make
:lines: 25-

Then use ``make fast`` to run the fast HTML build.
Then use ``make fasthtml`` to run the fast HTML build.

.. ADDITIONAL CONTENT END
Expand Down
8 changes: 4 additions & 4 deletions utils/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ compare() {
make SPHINXOPTS=-Q html
echo ">>> Fast build"
echo "Another line" >> index.rst
time make SPHINXOPTS=-Q fast
time make SPHINXOPTS=-Q html
echo ">>> Standard build"
echo "Another line" >> index.rst
time make SPHINXOPTS=-Q html
time make SPHINXOPTS=-Q fasthtml
}

echo "=== Sphinx"
git clone --quiet --branch v7.3.7 --depth 1 https://github.com/sphinx-doc/sphinx.git >/dev/null
cd sphinx/doc
echo "extensions.append('sphinxnotes.fasthtml')" >> conf.py
cat <<'EOF' >> Makefile
fast: Makefile
@$(SPHINXBUILD) -b fasthtml "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
fasthtml: Makefile
@$(SPHINXBUILD) -b $@ "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O) -d "$(BUILDDIR)/doctrees"
EOF
compare
cd ..
Expand Down

0 comments on commit 1ebc74f

Please sign in to comment.