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

Expose adoc line numbers to end user at errors #1632

Closed
rillbert opened this issue Apr 5, 2020 · 1 comment
Closed

Expose adoc line numbers to end user at errors #1632

rillbert opened this issue Apr 5, 2020 · 1 comment

Comments

@rillbert
Copy link

rillbert commented Apr 5, 2020

Would it be possible to expose the line numbers to the end user for errors (and warnings as well)?

I submitted the issue #1608 a while ago and, while understanding that this is the expected behaviour, it nevertheless makes it difficult for the end user (me in this case) to understand where the offending asciidoc source is.

My use case is that we have large (+200 pages) technical docs with many tables. The stack trace emitted for issue #1608 will not help much when it comes to finding the offending table.

After poking around in the code a bit, it seems that there is a 'sourcemap' option usable from the API that is not set by the asciidoctor-pdf cli invokation (for performance reasons??). If I understand the code correctly it is not possible to set this from the user's perspective using the cli.

To solve my particular problem, I made a short proof-of-concept to expose the line numbers for the case of issue #1608 in

https://github.com/rillbert/asciidoctor-pdf/tree/personal/rillbert/report_line_at_cannotfit

but as you can see it is neither very generic or pretty. I also patched asciidoctor cli to set the sourcemap option to true.

So, do I miss some other way of accomplishing what I want with the current versions or is a generic solution out-of-scope for now?

@mojavelinux
Copy link
Member

This was covered by the fix for #2009. To get the file and line number, you do need to enable the sourcemap.

@mojavelinux mojavelinux self-assigned this Apr 16, 2022
@mojavelinux mojavelinux added this to the v2.0.0 milestone Apr 16, 2022
@mojavelinux mojavelinux removed their assignment Apr 16, 2022
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