Node.js 18+
Texkit is built on modern JavaScript. Ensure you have Node.js version 18 or higher installed on your system.
Compose. Compile. Ship.
Get up and running with Texkit in minutes. Install the CLI, initialize a project, and render your first document.
Ensure your development environment is ready for the Texkit CLI.
Texkit is built on modern JavaScript. Ensure you have Node.js version 18 or higher installed on your system.
Both package managers are supported for global installation. If you use Yarn, the command syntax remains identical.
A command-line interface is required to run the Texkit CLI and manage your project files.
Open your terminal and install the Texkit global CLI package. This gives you access to the texkit command from anywhere.
Create a new directory for your project and initialize it using the init command. This scaffolds the necessary configuration files and folder structure.
Once initialized, navigate into your project folder. You will see a standard Texkit layout:
src/ — Your source Markdown and template files.dist/ — The output directory where compiled files will be saved.texkit.config.json — The pipeline configuration file.The texkit init command creates a minimal but functional configuration. It sets up a default pipeline that looks for Markdown files in src and renders them to HTML in dist. You can edit this configuration later to add custom templates or data sources.
For a quick visual check, run ls -la in your terminal to see the generated files.
Texkit uses a simple, logic-aware templating language. Create a file named base.txk in your src folder. This template will wrap your content.
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
</head>
<body>
<header>
<h1>{{ title }}</h1>
<p>Published on {{ date }}</p>
</header>
<main>
{{ content }}
</main>
</body>
</html>
Open texkit.config.json. This file defines the variables available to your templates. You can hardcode values here or point to external JSON/YAML files.
{
"pipeline": "default",
"input": "src/**/*.md",
"template": "src/base.txk",
"output": "dist",
"data": {
"title": "My First Pipeline",
"date": "2023-10-27",
"author": "Jane Developer"
}
}
With your configuration and template in place, execute the pipeline using the run command. Texkit will parse your Markdown, inject the data, and render the output.
Check the dist folder. You should see an HTML file generated from your template and Markdown content. Open it in your browser to verify the result.
You've successfully run your first pipeline. Explore the full capabilities of Texkit.