Advertisement
Guest User

Untitled

a guest
Mar 15th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.65 KB | None | 0 0
  1. root@5db542db3336:/workspace# diff a.py b.py
  2. 1c1
  3. < class LiteralInclude(SphinxDirective):
  4. ---
  5. > class ExampleInclude(SphinxDirective):
  6. 3,5c3,7
  7. <     Like ``.. include:: :literal:``, but only warns if the include file is
  8. <     not found, and does not raise errors.  Also has several options for
  9. <     selecting what to include.
  10. ---
  11. >     Like ``.. literalinclude:: ``, but it does not support caption option.
  12. >     Adds a header with a reference to  the full source code
  13. >
  14. >     Based on:
  15. >     https://raw.githubusercontent.com/sphinx-doc/sphinx/v1.8.3/sphinx/directives/code.py
  16. 29d30
  17. <         "caption": directives.unchanged,
  18. 36d36
  19. <         # type: () -> List[nodes.Node]
  20. 68,70c68
  21. <                         __("line number spec is out of range(1-%d): %r")
  22. <                         % (lines, self.options["emphasize-lines"]),
  23. <                         location=location,
  24. ---
  25. >                         "line number spec is out of range(1-%d): %r", lines, self.options["emphasize-lines"]
  26. 75,81c73,76
  27. <             if "caption" in self.options:
  28. <                 caption = self.options["caption"] or self.arguments[0]
  29. <                 retnode = container_wrapper(self, retnode, caption)
  30. <
  31. <             # retnode will be note_implicit_target that is linked from caption and numref.
  32. <             # when options['name'] is provided, it should be primary ID.
  33. <             self.add_name(retnode)
  34. ---
  35. >             container_node = nodes.container("", literal_block=True, classes=["example-block-wrapper"])
  36. >             container_node += example_header(filename=filename)
  37. >             container_node += retnode
  38. >             retnode = container_node
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement