Closed joaompinto closed 6 years ago
Hello @joaompinto, I think what you are looking for is the sourcemap
option: https://asciidoctor.org/docs/user-manual/#ruby-api-options
You can look at the Atom source code where @ldez implemented a "scroll to source" feature.
sourcemap
option: https://github.com/asciidoctor/atom-asciidoc-preview/blob/11a702bb804497a5c02544b9e6e71e0384f80322/lib/worker.coffee#L30lineno
): https://github.com/asciidoctor/atom-asciidoc-preview/blob/11a702bb804497a5c02544b9e6e71e0384f80322/lib/worker.coffee#L55-L77@Mogztter , thanks for the help.
I have looked at the AsciidoctorJS source to figure how to use loadFile(), findBy(), getLineNumber(). addRole() .
https://github.com/joaompinto/asciidoctor-vscode/commit/9f04dad0852532f0b52ce42346f58076d3af61dc
I am closing the issue, when I have some more time I will open a new issue for the documentation, https://github.com/asciidoctor/asciidoctor.js/blob/master/docs/manual.adoc did not provide any hint to the available options and how to explore the document content (besides converting).
In order to address https://github.com/joaompinto/asciidoctor-vscode/issues/11, which relies on Asciidocttor(.js) the Asciidoctor html output would need to include source line meta data.
As an example, te VS Code markdown extension which provides this feature, relies on extra meta data added to the html elements: e.g.. class="code-line" data-line="10>.. html content .