Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add literal formatting for extlinks and get rid of custom extension
  • Loading branch information
SilverRainZ committed Mar 24, 2024
commit f6f0d97358b83c06007f329f6692d52ab985f9c9
43 changes: 0 additions & 43 deletions _extensions/custom_roles.py

This file was deleted.

18 changes: 12 additions & 6 deletions conf.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import os
import sys
import time

# Location of custom extensions.
sys.path.insert(0, os.path.abspath(".") + "/_extensions")

extensions = [
'custom_roles',
'notfound.extension',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
Expand All @@ -15,6 +9,7 @@
'sphinx_inline_tabs',
'sphinxext.opengraph',
'sphinxext.rediraffe',
'sphinxnotes.comboroles',
]

# The master toctree document.
Expand Down Expand Up @@ -178,6 +173,10 @@
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
extlinks = {
"github": ("https://github.com/%s/", "%s"),

# Not used directly in document, see sphinxnotes-comborole config.
"_cpy-file": ("https://github.com/python/cpython/blob/main/%s", "%s"),
"_gh-label": ("https://github.com/python/cpython/labels/%s", "%s"),
}

# sphinxext-opengraph config
Expand All @@ -195,3 +194,10 @@
copybutton_prompt_text = "$ "
# https://sphinx-copybutton.readthedocs.io/en/latest/use.html#honor-line-continuation-characters-when-copying-multline-snippets
copybutton_line_continuation_character = "\\"

# sphinxnotes-comboroles config.
comboroles_roles = {
# Add literal formatting for extlink roles.
"cpy-file": ["literal", "_cpy-file"],
"gh-label": ["literal", "_gh-label"],
}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ sphinx_copybutton>=0.3.3
sphinxext-opengraph>=0.7.1
sphinxext-rediraffe
Sphinx~=7.2.6
sphinxnotes-comboroles>=1.0