docs: add sphinx-copybutton and sphinx-codeautolink - #223
Open
petercorke wants to merge 4 commits into
Open
petercorke wants to merge 4 commits into
petercorke wants to merge 4 commits into
Conversation
sphinx-codeautolink's own parsing pass over code blocks is stricter than plain docutils about this pre-existing 3-space/4-space mismatch between the :linenos: option and the code content, surfacing a new 'unexpected indent' warning that was previously silently tolerated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings SMTB's docs config in line with RTB and MVTB, which both already have these two extensions:
sphinx-copybutton: adds a copy button to code blocks, stripping interactive>>>/.../$prompts so copied code actually runs.sphinx-codeautolink: turns code identifiers in examples into links to their API docs.Config (extensions list,
suppress_warningsfor codeautolink's own match warnings,copybutton_prompt_text/etc.,codeautolink_custom_blocks/codeautolink_search_css_classes) mirrors RTB'sconf.pyexactly.Also fixes a small pre-existing formatting wart in
intro.rst: two.. code-block:: pythonblocks had:linenos:indented 3 spaces against 4-space code content. Plain docutils tolerated this silently, butsphinx-codeautolink's own parsing pass over code blocks is stricter and surfaced it as a new "unexpected indent" warning -- fixed rather than left as a regression.Test plan
sphinx-build -b html, isolated venv, against both master and this branch