docsets.python3-std: remove a lot of noise from the python docs
This commit is contained in:
@@ -11,7 +11,8 @@ runCommandLocal "docsets-python3-std" {
|
||||
cp -R ${python3.doc}/share/doc/* doc
|
||||
chmod -R u+w doc
|
||||
|
||||
doc2dash --index-page library/index.html doc/html
|
||||
# `--parser ...` lets me inject my own module that doc2dash loads and delegates docset styling to
|
||||
PYTHONPATH=${./.} doc2dash --parser sparse_sphinx_parser.InterSphinxParserLessNoise --index-page library/index.html doc/html
|
||||
|
||||
mkdir -p $out/share/docsets
|
||||
cp -R *.docset $out/share/docsets
|
||||
|
10
pkgs/by-name/docsets/python3-std/sparse_sphinx_parser.py
Normal file
10
pkgs/by-name/docsets/python3-std/sparse_sphinx_parser.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from doc2dash.parsers.intersphinx import InterSphinxParser
|
||||
from doc2dash.parsers.types import EntryType
|
||||
|
||||
class InterSphinxParserLessNoise(InterSphinxParser):
|
||||
def convert_type(self, inv_type: str) -> EntryType | None:
|
||||
# Sphinx is too noisy: we don't want page labels etc to drown out the actual API references
|
||||
if inv_type.split(":")[-1] in [ "cmdoption", "doc", "envvar", "label", "macro", "opcode", "option", "term" ]:
|
||||
return
|
||||
|
||||
return super().convert_type(inv_type)
|
Reference in New Issue
Block a user