AI Features

Updating Functions to Improve the Markdown Preview Tool

Learn how updating the functions can improve the Markdown preview tool.

Updating the run() function

Let’s update the definition of the run() function so it accepts another string input parameter called tFname that will represent the name of an alternate template file:

func run(filename, tFname string, out io.Writer, skipPreview bool) error {

Since the parseContent() function now also returns an error, we update the run() function to handle this condition when calling parseContent(), like this: ...