From: Pascal Cotret Date: Sat, 29 Dec 2018 15:49:32 +0000 (+0100) Subject: Cannot build docs X-Git-Url: https://git.ralfj.de/rust-101.git/commitdiff_plain/17f70b80eaa7615c07d3c94861e5177d417df0c0?hp=801f2b59728fba1e13d3e34a08457b812f8c0f56 Cannot build docs In an issue, @chinanf-boy gave some hints to repare this script in order to build docs: https://github.com/RalfJung/rust-101/issues/23#issuecomment-427308420 Here is a pull request with his codes. --- diff --git a/pycco-rs b/pycco-rs index d250b20..c884311 100755 --- a/pycco-rs +++ b/pycco-rs @@ -11,16 +11,16 @@ def patch_html(source, marker, new_text): return source.replace(marker, marker + new_text, 1) # now, monkey-patch pycco for Rust support -pycco.main.languages[".rs"] = { "name": "rust", "symbol": "//"} -for ext, l in pycco.main.languages.items(): +pycco.main.supported_languages[".rs"] = { "name": "rust", "comment_symbol": "//"} +for ext, l in pycco.main.supported_languages.items(): # Does the line begin with a comment? - l["comment_matcher"] = re.compile(r"^\s*" + l["symbol"] + "\s?") + l["comment_matcher"] = re.compile(r"^\s*" + l["comment_symbol"] + "\s?") # The dividing token we feed into Pygments, to delimit the boundaries between # sections. - l["divider_text"] = "\n" + l["symbol"] + "DIVIDER\n" + l["divider_text"] = "\n" + l["comment_symbol"] + "DIVIDER\n" # The mirror of `divider_text` that we expect Pygments to return. We can split # on this to recover the original sections. - l["divider_html"] = re.compile(r'\n*' + l["symbol"] + 'DIVIDER\n*') + l["divider_html"] = re.compile(r'\n*' + l["comment_symbol"] + 'DIVIDER\n*') # Get the Pygments Lexer for this language. l["lexer"] = lexers.get_lexer_by_name(l["name"])