Skip to content

Allow cells to have line numbers #324

Description

@choldgraf

When people use Jupyter Notebook cells, they often want to refer to specific lines as part of explaining something. This would be easier if it were possible to trigger "line numbering" for each code block.

See executablebooks/meta#343 for one example but a few folks have asked about this over time.

I think that one implementation could be to adopt a cell tag like line-numbers. If this tag exists, then when the input is converted to a literal block (somewhere around here?) we could try adding in the line numbers. It seems like this could be as simple as copying what the code-block directive does.

Another option would be to let users define cell-level metadata that exactly matches the metadata one can provide with code-block. Though then it'd be harder for users to do this because the UX around editing cell-level metadata is not great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    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