...

/

Adding Temporary Files to the Markdown Preview Tool

Adding Temporary Files to the Markdown Preview Tool

Learn how to create temporary files in the Markdown preview tool to prevent clashes.

In its current version, the mdp tool creates an HTML file with the same name as the Markdown file in the current directory. This isn’t ideal, as these files can accumulate in our system or could cause a clash if two or more users are previewing the same file simultaneously.

Change to the mdp tool

To address this issue, let’s make a change to the mdp tool to create and use temporary files instead of local files. The ioutil package provides a function ...