mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-31 04:58:12 +00:00
Docs base plate?
This commit is contained in:
parent
359c483c66
commit
187f15f8bc
29 changed files with 3493 additions and 52 deletions
22
docs/extensions/nitpick_file_ignorer.py
Normal file
22
docs/extensions/nitpick_file_ignorer.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import logging
|
||||
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.util import logging as sphinx_logging
|
||||
|
||||
|
||||
class NitpickFileIgnorer(logging.Filter):
|
||||
|
||||
def __init__(self, app: Sphinx) -> None:
|
||||
self.app = app
|
||||
super().__init__()
|
||||
|
||||
def filter(self, record: sphinx_logging.SphinxLogRecord) -> bool:
|
||||
if getattr(record, 'type', None) == 'ref':
|
||||
return record.location.get('refdoc') not in self.app.config.nitpick_ignore_files
|
||||
return True
|
||||
|
||||
|
||||
def setup(app: Sphinx):
|
||||
app.add_config_value('nitpick_ignore_files', [], '')
|
||||
f = NitpickFileIgnorer(app)
|
||||
sphinx_logging.getLogger('sphinx.transforms.post_transforms').logger.addFilter(f)
|
Loading…
Add table
Add a link
Reference in a new issue