Errors and Warnings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Errors and Warnings

wimalopaan
Hi all,

just two questions:

1) Is it possible to get errors / warnings in standard format (as compilers like gcc do)? This would be of great help
if you write your docs within an IDE.

2) Is it possible to be more verbose (get warnings) about undefined (aka misspelled) inline/block-macros?

Thanks,
 Wilhelm
Reply | Threaded
Open this post in threaded view
|

Re: Errors and Warnings

mojavelinux
Administrator

On Mon, Oct 13, 2014 at 8:24 AM, wimalopaan [via Asciidoctor :: Discussion] <[hidden email]> wrote:
1) Is it possible to get errors / warnings in standard format (as compilers like gcc do)? This would be of great help
if you write your docs within an IDE.

This is planned. I've described a way to capture the error / warning channel in another thread (redirect $stderr variable), but it's a bit hacky at the moment. Since Asciidoctor was originally designed to mimic AsciiDoc Python, it spits out these messages to stderr by default. However, it won't be a huge task to hook this into a logging system.


2) Is it possible to be more verbose (get warnings) about undefined (aka misspelled) inline/block-macros? 

This goes against the philosophy of AsciiDoc, which assumes that any syntax which isn't mapped is user content. Otherwise, we'd likely be throwing a lot of superfluous warnings because authors would have to worry about avoiding all syntax that looks close to real syntax, but isn't. This is where a custom validator is appropriate. You can implement such a validator using a Treeprocessor, which walks the AST and seeks out stuff that didn't match.

Cheers,

-Dan 

--
Reply | Threaded
Open this post in threaded view
|

Re: Errors and Warnings

wimalopaan
Ok, thanks for the info!

--
 Wilhelm