Install the Official TapirMD Renderer

The page is written in TapirMD (source is available here).

This page shows the steps of installing and using the official TapirMD renderer locally. You can also experience the renderer online.

Installation steps

TapirMD hasn't yet reached version 1.0.0 (or even 0.1.0). At this stage, building from source is the only way to run the offcial TapirMD commands locally.

  1. Install Zig, if haven't. The latest version tip (master) version is recommended.

  2. Get the source code of the TapirMD project. You can download its source code or clone it (install Git if needed).

  3. Open your terminal or command prompt, and change directory to the TapirMD project folder, then run
        zig build -Doptimize=ReleaseSafe
    
    If the build is successful, the tmd command binary file will be located in the bin folder under the project local zig-out folder.

  4. (Optional), copy the tmd binary file to a directory configured in the PATH enviroment variable, or add the path of the bin folder to the PATH enviroment variable, so that you can run the tmd command anywhere.

  1. Install Go, if haven't. The latest version stable version is recommended.

  2. Install the renderer in either of the following two ways:

    • Run
           go install go101.org/tmd@latest
      

    • Or get the source code of the go-tmd project. You can download its source code or clone it (install Git if needed).

      Then open your terminal or command prompt, and change directory to the go-tmd project folder, then run
          go install
      

  3. The tmd command binary file is installed in the Go binary installation path specified by the GOBIN environment variable, which defaults to the path of the bin subfolder under the first path specified in the GOPATH environment variable, which defaults to the path of the go subfolder under the path specified by the HOME environment variable.

  4. (Optional), add the Go binary installation path to the PATH enviroment variable, or copy the tmd binary file to a directory configured in the PATH enviroment variable, so that you can run the tmd command anywhere.

Use the renderer

  1. Edit a TapirMD document and save it in a file with the recommended .tmd extension. Assume the file name is mydoc.tmd.

  2. Run
        tmd render --full-html mydoc.tmd
    
    to generate a mydoc.html file for your TapirMD document. Then you can open the mydoc.html file in a web browser to view the render result.

    You can also run
        tmd render mydoc.tmd
    
    to geneate an incomplete HTML file for embedding purpose.