Skip to content

📚[DOC]: Code Block Line Offset in Sphinx Documentation Due to File Headers #217

@kjrstory

Description

@kjrstory

How would you describe the priority of this documentation request

Low (would be nice)

Is this for new documentation, or an update to existing docs?

New

Describe the incorrect/future/missing documentation

The documentation pages are generated from the docs folder in this repository. These documents include code blocks, such as:

.. literalinclude:: ../../../examples/ldc/ldc_2d.py
   :language: python
   :lines: 14-38

The content of these code blocks reflects the actual files in the repository. However, it seems that all code blocks in the documentation are consistently offset by 2 (or 3) lines, likely due to comments or similar headers in the example files.

While I could manually adjust the line numbers, I currently cannot set up a Sphinx environment to verify the changes.

Could someone assist with resolving this issue? Additionally, since example code files may change frequently, I wonder if there’s a fundamental way to address this problem to avoid future discrepancies.

If this is a correction, please provide a link to the incorrect documentation. If this is a new documentation request, please link to where you have looked.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ? - Needs TriageNeed team to review and classifydocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions