This commit is contained in:
Fabian Homborg
2020-11-22 14:39:48 +01:00
parent e30f661867
commit 2e55e34544
52 changed files with 370 additions and 239 deletions

View File

@@ -114,8 +114,8 @@ pygments_style = None
# of _static/pygments.css
html_theme_path = ["."]
html_theme = "python_docs_theme"
#html_theme_path = ["./cloud_sptheme/themes"]
#html_theme = "cloud"
# html_theme_path = ["./cloud_sptheme/themes"]
# html_theme = "cloud"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@@ -196,7 +196,13 @@ man_pages = [
("tutorial", "fish-tutorial", "fish-shell tutorial", [author], 1),
("CHANGELOG", "fish-changelog", "fish-shell changelog", [author], 1),
("completions", "fish-completions", "Writing fish completions", [author], 1),
("fish_for_bash_users", "fish-for-bash-users", "A quick fish primer for those coming from bash", [author], 1),
(
"fish_for_bash_users",
"fish-for-bash-users",
"A quick fish primer for those coming from bash",
[author],
1,
),
("faq", "fish-faq", "fish-shell faq", [author], 1),
]
for path in sorted(glob.glob("cmds/*")):

View File

@@ -62,9 +62,9 @@ ROLE_TO_TOKEN = {
def token_for_text_and_role(text, role):
""" Return the pygments token for some input text and a fish role
This applies any special cases of ROLE_TO_TOKEN.
"""Return the pygments token for some input text and a fish role
This applies any special cases of ROLE_TO_TOKEN.
"""
if text.isspace():
# Here fish will return 'normal' or 'statement_terminator' for newline.
@@ -77,13 +77,13 @@ def token_for_text_and_role(text, role):
def tokenize_fish_command(code, offset):
""" Tokenize some fish code, offset in a parent string, by shelling
out to fish_indent.
fish_indent will output a list of csv lines: start,end,type.
"""Tokenize some fish code, offset in a parent string, by shelling
out to fish_indent.
This function returns a list of (start, tok, value) tuples, as
Pygments expects.
fish_indent will output a list of csv lines: start,end,type.
This function returns a list of (start, tok, value) tuples, as
Pygments expects.
"""
proc = subprocess.Popen(
["fish_indent", "--pygments"],
@@ -108,11 +108,11 @@ class FishIndentLexer(Lexer):
filenames = ["*.fish"]
def get_tokens_unprocessed(self, input_text):
""" Return a list of (start, tok, value) tuples.
"""Return a list of (start, tok, value) tuples.
start is the index into the string
tok is the token type (as above)
value is the string contents of the token
start is the index into the string
tok is the token type (as above)
value is the string contents of the token
"""
result = []
if not any(s.startswith(">") for s in input_text.splitlines()):

View File

@@ -3,10 +3,9 @@ import os
def setup(app):
current_dir = os.path.abspath(os.path.dirname(__file__))
app.add_html_theme(
'python_docs_theme', current_dir)
app.add_html_theme("python_docs_theme", current_dir)
return {
'parallel_read_safe': True,
'parallel_write_safe': True,
"parallel_read_safe": True,
"parallel_write_safe": True,
}