Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

📚[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

Labels

documentationImprovements or additions to documentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions