.. video:: local_link.mp4 :alt: local link :align: center
Three steps to quickly run CodeLinks to generate links to your source code:
- Configure Sphinx
- Add a one-line comment to your source code to define a
Sphinx-Needsitem. - Use the
src-tracedirective in your documentation.
extensions = [
'sphinx_needs',
'sphinx_codelinks'
]
src_trace_config_from_toml = "src_trace.toml".. literalinclude:: ./../../src_trace.toml :caption: src_trace.toml :language: toml
.. literalinclude:: ./../../../tests/doc_test/minimum_config/dummy_src.cpp :caption: dummy_src.cpp :language: cpp
.. literalinclude:: ./../../../tests/doc_test/minimum_config/index.rst :caption: index.rst :language: rst
.. src-trace:: dummy src :project: src
Note
local-url is not working on the website as it only supports local browse
Section :ref:`Directive <directive>` provides more advanced usage.