diff options
| author | Russ White <russ@riw.us> | 2018-05-12 06:23:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-12 06:23:03 -0400 |
| commit | 6b50b12ac75d635e78bee46d40bca936d03d1bc8 (patch) | |
| tree | 10a0faa2f2796a3b37e0394cd48cad0156887256 /doc/developer/conf.py | |
| parent | 71ef4ee49a54ba651f0aaf27d3197ca6d617fafd (diff) | |
| parent | 524ada7f2356a4f6cba31f07a75896681be105bc (diff) | |
Merge pull request #2162 from qlyoung/fix-vpath-build
doc: support VPATH builds
Diffstat (limited to 'doc/developer/conf.py')
| -rw-r--r-- | doc/developer/conf.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/developer/conf.py b/doc/developer/conf.py index a3968b60ff..61253c4b2f 100644 --- a/doc/developer/conf.py +++ b/doc/developer/conf.py @@ -342,6 +342,14 @@ texinfo_documents = [ # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False +# contents of ../extra/frrlexer.py. +# This is read here to support VPATH build. Since this section is execfile()'d +# with the file location, we can safely use a relative path here to save the +# contents of the lexer file for later use even if our relative path changes +# due to VPATH. +with open('../extra/frrlexer.py', 'rb') as lex: + frrlexerpy = lex.read() + # custom extensions here def setup(app): # object type for FRR CLI commands, can be extended to document parent CLI @@ -357,5 +365,5 @@ def setup(app): # # frrlexer = pygments.lexers.load_lexer_from_file('../extra/frrlexer.py', lexername="FRRLexer") custom_namespace = {} - exec(open('../extra/frrlexer.py', 'rb').read(), custom_namespace) + exec(frrlexerpy, custom_namespace) lexers['frr'] = custom_namespace['FRRLexer']() |
