Getting Started

Quickstart: Run Your First Texkit Pipeline in 10 Minutes

Compose. Compile. Ship.

Get up and running with Texkit in minutes. Install the CLI, initialize a project, and render your first document.

Terminal showing Texkit installation and initialization commands
Prerequisites

Before you begin

Ensure your development environment is ready for the Texkit CLI.

Node.js 18+

Texkit is built on modern JavaScript. Ensure you have Node.js version 18 or higher installed on your system.

npm or Yarn

Both package managers are supported for global installation. If you use Yarn, the command syntax remains identical.

Terminal Access

A command-line interface is required to run the Texkit CLI and manage your project files.

Step 1-3

Installation & Project Setup

1. Install the CLI

Open your terminal and install the Texkit global CLI package. This gives you access to the texkit command from anywhere.

$ npm install -g texkit

2. Initialize a Project

Create a new directory for your project and initialize it using the init command. This scaffolds the necessary configuration files and folder structure.

$ texkit init my-first-pipeline

3. Explore the 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.

What happens during init?

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.

Step 4-5

Define Data & Templates

4. Write Your First Template

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>

5. Define Input Data

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"
  }
}
Step 6-7

Run & Inspect

6. Run the Pipeline

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.

$ texkit run

7. Inspect 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.

$ open dist/index.html
Next Steps

Ready to go deeper?

You've successfully run your first pipeline. Explore the full capabilities of Texkit.