Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify doc/Makefile with sphinx-build make-mode #3761

Merged
merged 2 commits into from
Jan 11, 2025

Conversation

seisman
Copy link
Member

@seisman seisman commented Jan 9, 2025

sphinx-build started to provide the so-called make-mode since v1.2.0, which has been the default mode since v1.5.0.

Here is a simple comparison for the make-mode and the "normal" mode:

Old normal mode:

$(SPHINXBUILD) -b html $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html

make mode:

$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)

These two modes are very similar, but in make-mode, we use $(BUILDDIR) not $(BUILDDIR)/html.

A good advantage is that we can use the same command for different Sphinx builders.

This PR updates doc/Makefile with the make-mode and also adds the latex target to generate LaTeX source files.

Address #1606.

@seisman seisman added the maintenance Boring but important stuff for the core devs label Jan 9, 2025
@echo
# Set PYGMT_USE_EXTERNAL_DISPLAY to "false" to disable external display
PYGMT_USE_EXTERNAL_DISPLAY="false" $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
PYGMT_USE_EXTERNAL_DISPLAY="false" $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$@ is the target, i.e., html when running make html.

@seisman seisman force-pushed the maintenance/sphinx-make branch from 5b132d1 to 410b8e7 Compare January 9, 2025 14:15
@@ -28,20 +26,20 @@ api:
@echo
$(SPHINXAUTOGEN) -i -t _templates -o api/generated api/*.rst

html: api
html latex: api
Copy link
Member Author

@seisman seisman Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latex is added here to support PDF documentation (xref #1606).

@seisman seisman added this to the 0.15.0 milestone Jan 10, 2025
@seisman seisman added skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Jan 10, 2025
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Jan 10, 2025
@seisman seisman merged commit 2bd524e into main Jan 11, 2025
10 checks passed
@seisman seisman deleted the maintenance/sphinx-make branch January 11, 2025 05:58
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants