mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-14 17:21:50 +00:00
docs: add new top-level docs builder that builds docs for a single chip
This commit is contained in:
committed by
Angus Gratton
parent
783856d557
commit
e6211c7864
18
docs/include_build_file.py
Normal file
18
docs/include_build_file.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import os.path
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
from docutils.parsers.rst.directives.misc import Include as BaseInclude
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
|
||||
class IncludeBuildFile(BaseInclude, SphinxDirective):
|
||||
"""
|
||||
Like the standard "Include" directive, but relative to the app
|
||||
build directory
|
||||
"""
|
||||
def run(self):
|
||||
abspath = os.path.join(self.env.config.build_dir, self.arguments[0])
|
||||
self.arguments[0] = abspath
|
||||
self.env.note_included(abspath)
|
||||
return super(IncludeBuildFile, self).run()
|
||||
|
||||
def setup(app):
|
||||
directives.register_directive('include-build-file', IncludeBuildFile)
|
||||
Reference in New Issue
Block a user