...

/

Adding an Auto-Preview Feature

Adding an Auto-Preview Feature

Learn how to add an auto-preview feature in the Markdown preview tool.

At the moment, our tool isn’t automating the entire process. It converts the Markdown to HTML, but the user still has to open the file in a browser to see the results. While this is a valid approach, it would be nice for the user to be able to run the tool and automatically see the results. We’re assuming that most users want this feature, but it’s nice to provide an option to disable it in case they prefer to open the file at a different time.

As part of this implementation, we’ll add another flag -s (skip-preview) to skip the auto-preview. This option also helps with executing the tests by avoiding automatically opening the files in the browser for every test.

The preview()

...