Install the Official TapirMD Toolset
This page outlines the steps to install the official TapirMD toolchain and introduces some basic commands it provides.
You can also try TapirMD formatting syntax 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.
-
Install Zig, if haven't. The latest minor version is recommended.
-
Get the source code of the TapirMD project. You can clone it (install Git if needed) or download its source code.
-
Open your terminal or command prompt, navigate to the TapirMD project folder, and run the following command to build the project:
zig build -Doptimize=ReleaseSafe
If the build is successful, thetmdcommand binary file will be generated in thebinfolder under the project localzig-outfolder.TheReleaseSafeoptimization mode produces a fast binary with safety checks. For an even faster binary, use theReleaseFastoptimization mode instead:zig build -Doptimize=ReleaseFast
Or you can just build a debug version:zig build
The debug version will print more readable information when problems are encountered. As the toolchain is still in its early development phase, bugs are inevitable. Bug reports are seriously welcome here. -
(Optional), copy the
tmdbinary file to a directory configured in thePATHenviroment variable, or add the path of thebinfolder to thePATHenviroment variable, so that you can run thetmdcommand anywhere.
Use the toolchain
-
Run
tmdwithout arguments to show the help information. -
Run the following command to format
.tmdfiles:tmd fmt foo.tmd path-to-a-tmd-folderRuntmd fmtwith no arguments to format all.tmdfiles within the current directory: -
Run the following command to generate HTML snippet files for embedding purpose in the same directories of corresponding
.tmdfiles.tmd gen foo.tmd path-to-a-tmd-folderRuntmd genwith no arguments to generate HTML snippet files for all.tmdfiles within the current directory: -
Run the following command to generate full HTML page files in the same directories of corresponding
.tmdfiles.tmd gen-full-page foo.tmd path-to-a-tmd-folderRuntmd gen-full-pagewith no arguments to generate full HTML page files for all.tmdfiles within the current directory: -
Run the following commands to build a TapirMD project located at the specified directory and output target files in
@tmd-buildfolder in the workspace directory of the project.tmd build project-dir tmd build project-config-fileRuntmd buildwith no arguments to build the TapirMD project located at the current directory.