Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement start line number for source listing #752

Closed
mojavelinux opened this issue Feb 13, 2017 · 4 comments
Closed

Implement start line number for source listing #752

mojavelinux opened this issue Feb 13, 2017 · 4 comments
Assignees

Comments

@mojavelinux
Copy link
Member

Implement a line number offset for source listing (specifically for Rouge, which supports this feature). To be consistent with ordered lists, we should use the attribute name start for this purpose.

[source,java,numbered,start=10]
----
public Long getId() {
    return id;
}
----

(Rouge uses the option name start_line and Pygments uses linenostart, so "start" seems to be the key term).

@mojavelinux mojavelinux added this to the v1.5.0.alpha.15 milestone Feb 13, 2017
@mojavelinux mojavelinux self-assigned this Feb 13, 2017
@mojavelinux mojavelinux changed the title Implement line number offset for source listing Implement start line number for source listing Feb 13, 2017
@mojavelinux
Copy link
Member Author

mojavelinux commented Feb 13, 2017

There's a related issue for this in core. See asciidoctor/asciidoctor#1742.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Feb 13, 2017
@mojavelinux
Copy link
Member Author

We can only support this for Rouge at the moment since Rouge is the only highlighter that currently supports line numbering.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Feb 13, 2017
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Feb 14, 2017
@bwittman
Copy link

Pygments also supports line numbering, and I believe that it supports start line number through the linenostart option. Could this feature be extended to Pygments?

@mojavelinux
Copy link
Member Author

The linenostart option from Pygments doesn't help us because of where Pygments puts line numbers. However, I found another way to implement it. I'm looking for feedback on the change. Please see #226.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants