NetBSD-Docs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Markdown analyzer/verifier?



On 07/10, Martin Husemann wrote:
> Is there some easy to use analyzer/verifier (that does not require a docker
> or nodejs or similar big hammers)?

Maybe the following?

* Markdownlint (requires Ruby)
  https://github.com/markdownlint/markdownlint

* Pandoc (requires Haskell)
  https://pandoc.org/

I've never used Markdownlint, but it looks like it might do what you
want.

I have used Pandoc, and it works well, and it will emit warnings for
some things that are not right.  But depending on your issue, it might
not be a syntax error or warning because the original Markdown grammar
was so loosely defined, and so Pandoc might not tell you what's wrong.
(There is a properly defined spec, though, called CommonMark [1].)

You could also specify "json" as the Pandoc output format which will
produce a JSON representation of the AST which would let you see exactly
where it's going wrong.  Or, depending on your preference, you could
instead specify "docbook" or "html" as the Pandoc output format to see
where it's going wrong in an easier-to-read format than the JSON AST.

The downside of Pandoc is its dependency on the Haskell platform which
probably qualifies as a "big hammer" that you're trying to avoid.

Lewis

[1] https://commonmark.org/


Home | Main Index | Thread Index | Old Index