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

Adding line-number info to rendered HTML element #127

Closed
rahmanusta opened this issue Sep 26, 2015 · 5 comments
Closed

Adding line-number info to rendered HTML element #127

rahmanusta opened this issue Sep 26, 2015 · 5 comments

Comments

@rahmanusta
Copy link
Contributor

Hello;

We are following complex path to feature smooth scrolling in AsciidocFX. Is it possible to add line-number info to rendered HTML elements by it's number? Or do you have any idea for the smooth scrolling (scrolling by asciidoc content line position)?

@mojavelinux
Copy link
Member

The line number info is available at the block level if you add the following option when invoking the processor:

sourcemap: true

However, you'd still need to modify the converter (or templates) to pull information from the source_location field (if available) and add it to the HTML. I have not yet attempted to do something like this, but in theory it should work.

@rahmanusta
Copy link
Contributor Author

I'm thinking to implement a new TreeProcessor for this need. Is it possible to get all nodes as an array in a Asciidoctor document?

@mojavelinux
Copy link
Member

I'm pretty sure calling find_by on the document returns all nodes.

@rahmanusta
Copy link
Contributor Author

Yes, I tried it and find_bywith no argument returns all nodes 👍

@mojavelinux
Copy link
Member

👍

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

No branches or pull requests

2 participants