Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ target/

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

*.mp4
# End of https://www.toptal.com/developers/gitignore/api/rust

.mimocode/
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ Texforge is a unified LaTeX workspace — one tool for writing, rendering diagra

---

### Demo CLI

![Demo CLI](assets/texforge.gif)

---

## Features

- **🚀 One-command setup** — Install once, everything is included (LaTeX engine, templates, diagram renderers).
Expand All @@ -42,6 +36,12 @@ Texforge is a unified LaTeX workspace — one tool for writing, rendering diagra

---

### Demo with OpenCode

![Demo OpenCode](demo/dist/demo.gif)

---

## Installation

### Quick install (recommended)
Expand Down Expand Up @@ -113,10 +113,6 @@ If you want Copilot to understand texforge and help with common LaTeX tasks, ins
npx skills add https://github.com/jheisonmb/skills --skill texforge
```

### Demo with OpenCode agents

![Demo OpenCode](assets/opencode.gif)

## Quick Start

```bash
Expand All @@ -128,6 +124,11 @@ texforge new mi-tesis
texforge build
```

## Documentation

Full documentation lives in [`docs/`](docs/): installation, quick start,
building, diagrams, templates, configuration and the complete CLI reference.

## Workflow

```mermaid
Expand All @@ -152,9 +153,9 @@ sequenceDiagram

User->>CLI: texforge build
Note over CLI: render embedded diagrams to PNG
CLI->>Tectonic: compile build/main.tex
CLI->>Tectonic: compile entry .tex
Note over CLI,Tectonic: auto-installs tectonic on first run
Tectonic-->>User: build/main.pdf
Tectonic-->>User: my-doc.pdf
```

## `texforge init`
Expand Down Expand Up @@ -193,8 +194,8 @@ texforge init
| `texforge config list` | Show all configured values |
| `texforge config <key>` | Show value for key (name, email, institution, language) |
| `texforge config <key> <value>` | Set value for key |
| `texforge template list` | List installed templates |
| `texforge template list --all` | List installed + available in registry |
| `texforge template list` | List installed + available in registry |
| `texforge template list --installed` | List only locally installed templates |
| `texforge template add <name>` | Download template from registry |
| `texforge template remove <name>` | Remove installed template |
| `texforge template validate <name>` | Verify template compatibility |
Expand Down Expand Up @@ -243,7 +244,7 @@ Templates are managed through the [texforge-templates](https://github.com/Univer

## Diagrams

`texforge build` intercepts embedded diagram environments before compilation. Originals are never modified — diagrams are rendered in `build/` copies.
`texforge build` intercepts embedded diagram environments before compilation. Originals are never modified — diagrams are rendered in temporary build copies.

### Mermaid

Expand Down Expand Up @@ -385,4 +386,5 @@ MIT

---

Made with ❤️ by [JheisonMB](https://github.com/JheisonMB) and [UniverLab](https://github.com/UniverLab)
An experiment of [UniverLab](https://github.com/UniverLab) — an open computational laboratory.
Made with ❤️ by [JheisonMB](https://github.com/JheisonMB)
Binary file removed assets/opencode.gif
Binary file not shown.
Binary file removed assets/texforge.gif
Binary file not shown.
733 changes: 733 additions & 0 deletions demo/demo.rec

Large diffs are not rendered by default.

135 changes: 135 additions & 0 deletions demo/demo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
[demo]
name = "demo"
output_dir = "./dist"
prompt = '\[\e[1;32m\]texForge@univerlab\[\e[0m\]:\[\e[1;34m\]~\[\e[0m\]$ '

[typing]
base_ms = 80
salt_ms = 15

[[sources]]
id = "main"
type = "terminal"

[[sources]]
id = "pdf"
type = "browser"
url = "file:///home/jheisonmblivecom/Projects/UniverLab/texforge/examples/texforge-capabilites/texforge-capabilites.pdf"

[layout]
width = 1440
height = 1080
fps = 15
line_height = 1.2000000476837158
background = "#0b0f14"
font_family = "IBM Plex Mono"

[[layout.panes]]
id = "main"
type = "terminal"
x = 0
y = 0
width = 1440
height = 1080
font_family = "monospace"
font_size = 16

[[layout.panes]]
id = "pdf-r1"
type = "browser"
x = 0
y = 0
width = 1440
height = 1080
url = "file:///home/jheisonmblivecom/Projects/UniverLab/texforge/examples/texforge-capabilites/texforge-capabilites.pdf"
reveal_at = 262.448

[[timeline]]
action = "focus"
pane = "main"

[[timeline]]
action = "type"
text = "texforge --help"
human_salt = true

[[timeline]]
action = "wait"
duration_ms = 200

[[timeline]]
action = "keypress"
key = "enter"

[[timeline]]
action = "wait"
duration_ms = 2500

[[timeline]]
action = "type"
text = "opencode"
human_salt = true

[[timeline]]
action = "wait"
duration_ms = 200

[[timeline]]
action = "keypress"
key = "enter"

[[timeline]]
action = "wait_for_quiet"
quiet_ms = 1500

[[timeline]]
action = "type"
text = 'Create a texforge project "texforge-capabilites" demonstrating all capabilities: Mermaid sequence diagra, Graphviz architecture digraph, D2 pipeline diagram, math equations with cross-refs, BibTeX citations, tikz diagram, examples of code listings, two booktabs tables, table of contents, and lists. Compile with texforge build.'
human_salt = true

[[timeline]]
action = "wait"
duration_ms = 200

[[timeline]]
action = "keypress"
key = "enter"

[[timeline]]
action = "wait_for_quiet"
quiet_ms = 5000

[[timeline]]
action = "type"
text = "/exit"
human_salt = true

[[timeline]]
action = "wait"
duration_ms = 200

[[timeline]]
action = "keypress"
key = "enter"

[[timeline]]
action = "wait_for_quiet"
quiet_ms = 500

[[timeline]]
action = "focus"
pane = "pdf-r1"

[[timeline]]
action = "scroll"
direction = "down"
velocity = "constant"
duration_ms = 8000
pane = "pdf-r1"

[[timeline]]
action = "wait"
duration_ms = 8000

[[timeline]]
action = "terminate"
Binary file added demo/dist/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions docs/building.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Building
description: Compile to PDF, watch mode, and the texforge runtime directory.
order: 4
---

# Building

## `texforge build`

Compiles the project to `<title>.pdf` in the project root:

1. Copies sources into a temporary build directory (originals are never
modified).
2. Renders embedded [diagram environments](diagrams.md) to PNG.
3. Invokes Tectonic on the entry point declared in `project.toml` and
places the resulting PDF (named after the document title) in the
project root.

On the first run texforge downloads the Tectonic binary into
`~/.texforge/bin/` automatically.

## Watch mode

`texforge build --watch` watches `.tex` files and rebuilds automatically:

```bash
texforge build --watch # rebuild after 2s of inactivity (default)
texforge build --watch --delay 5 # custom debounce delay in seconds
```

The terminal shows a live session timer, build count and the result of the
last build. Press `Ctrl+C` to stop.

## Cleaning

```bash
texforge clean # remove build artifacts
```

## Runtime directory

Texforge keeps its engine and template cache under `~/.texforge/`:

```
~/.texforge/
bin/
tectonic # LaTeX engine (auto-installed on first build)
templates/
general/ # cached templates
apa-general/
...
```

Deleting this directory is safe: everything is re-downloaded on demand.
59 changes: 59 additions & 0 deletions docs/cli-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: CLI Reference
description: Every texforge command and flag.
order: 9
---

# CLI Reference

```
texforge <command> [options]
```

## Project lifecycle

| Command | Description |
|---|---|
| `texforge new <name>` | Create a new project from the default template |
| `texforge new <name> -t <template>` | Create with a specific template |
| `texforge init` | Interactive wizard — new project or migrate an existing one |
| `texforge build` | Compile to PDF |
| `texforge build --watch` | Watch for changes and rebuild automatically |
| `texforge build --watch --delay <s>` | Custom debounce delay (default: 2s) |
| `texforge clean` | Remove build artifacts |

## Quality

| Command | Description |
|---|---|
| `texforge check` | Lint without compiling |
| `texforge fmt` | Format `.tex` files in place |
| `texforge fmt --check` | Check formatting without modifying (CI-friendly) |

## Templates

| Command | Description |
|---|---|
| `texforge template list` | List installed + available in the registry |
| `texforge template list --installed` | List only locally installed templates |
| `texforge template add <name>` | Download a template from the registry |
| `texforge template remove <name>` | Remove an installed template |
| `texforge template validate <name>` | Verify template compatibility |

## Configuration

| Command | Description |
|---|---|
| `texforge config` | Interactive wizard (name, email, institution, language) |
| `texforge config list` | Show all configured values |
| `texforge config <key>` | Show value for a key |
| `texforge config <key> <value>` | Set a value |

Valid keys: `name`, `email`, `institution`, `language`.

## Global flags

| Flag | Description |
|---|---|
| `--help` | Show help for any command |
| `--version` | Show texforge version |
Loading
Loading