Pelican plugin to include source code file in your post by reStructuredText directive.
Follow the instructions in official Pelican documentation.
Use the following reStructuredText directive in your post:
.. code-file:: {{ filename }}
:encoding: (optional)
:tab-width: (optional)
:start-line: (optional)
:end-line: (optional)
:start-after: (optional)
:end-before: (optional)
:class: (optional)
:name: (optional)
The source code file must be put in the same directory of your post. The only necessary argument is {{ filename }}. For details descriptions of options, please see the options of Including an External Document Fragment (This directive is derived from it.).
This plugin is released in public domain. See UNLICENSE.
- Including an External Document Fragment
- source code of "Including an External Document Fragment"
- Creating reStructuredText Directives
- Introduction and Quickstart - Pygments