John Otander: Remark comes with the command line interface, or CLI, that can be used to automate tasks. First, just go ahead and inspect the document. Inspect option logs out the entire AST, which can be used for debugging plugins.
As we also see here, we have the "Table of contents" heading and no children beneath it. We can automatically populate this by using the remark toc plugin as part of the CLI command. Now the table of contents has been populated.
However, if you run the inspect command one more time, we'll see that the table of contents has not been persisted. That's because we didn't specify the output.
With the output options specified, we can now inspect one more time and see that it has been populated. In addition to plugins that manipulate your markdown, you can also use plugins for linting.
Here, we'll lint against our markdown style guide. When we run the command, we'll see a list of errors that have been generated based off our preferences. We can additionally run commands based off whether the linting passed or failed. Though for this to work we'll have to specify the frail option, which means it will error out. This results in us seeing fail rather than pass.