Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@5db542db3336:/workspace# diff a.py b.py
- 1c1
- < class LiteralInclude(SphinxDirective):
- ---
- > class ExampleInclude(SphinxDirective):
- 3,5c3,7
- < Like ``.. include:: :literal:``, but only warns if the include file is
- < not found, and does not raise errors. Also has several options for
- < selecting what to include.
- ---
- > Like ``.. literalinclude:: ``, but it does not support caption option.
- > Adds a header with a reference to the full source code
- >
- > Based on:
- > https://raw.githubusercontent.com/sphinx-doc/sphinx/v1.8.3/sphinx/directives/code.py
- 29d30
- < "caption": directives.unchanged,
- 36d36
- < # type: () -> List[nodes.Node]
- 68,70c68
- < __("line number spec is out of range(1-%d): %r")
- < % (lines, self.options["emphasize-lines"]),
- < location=location,
- ---
- > "line number spec is out of range(1-%d): %r", lines, self.options["emphasize-lines"]
- 75,81c73,76
- < if "caption" in self.options:
- < caption = self.options["caption"] or self.arguments[0]
- < retnode = container_wrapper(self, retnode, caption)
- <
- < # retnode will be note_implicit_target that is linked from caption and numref.
- < # when options['name'] is provided, it should be primary ID.
- < self.add_name(retnode)
- ---
- > container_node = nodes.container("", literal_block=True, classes=["example-block-wrapper"])
- > container_node += example_header(filename=filename)
- > container_node += retnode
- > retnode = container_node
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement