Skip to content

Commit ba8c29d

Browse files
committed
Convert docs to mkdocs from mintlify, set up GHA publish
1 parent acf67b4 commit ba8c29d

27 files changed

+2493
-417
lines changed

.github/workflows/docs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
permissions:
8+
contents: write
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Configure Git Credentials
15+
run: |
16+
git config user.name github-actions[bot]
17+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.x
21+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22+
- uses: actions/cache@v4
23+
with:
24+
key: mkdocs-material-${{ env.cache_id }}
25+
path: .cache
26+
restore-keys: |
27+
mkdocs-material-
28+
- run: pip install -r docs/requirements.txt
29+
- run: mkdocs gh-deploy --force

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,16 @@ type-check: ## Run type checking
7979
$(VENV_BIN)/pyright
8080

8181

82-
.PHONY: docs
83-
docs: ## Develop on docs locally
84-
cd docs && npx mintlify dev
82+
.PHONY: docs docs-serve docs-build
83+
docs: docs-serve ## Alias for docs-serve
84+
85+
docs-serve: ## Serve documentation locally with live reloading
86+
pip install -r docs/requirements.txt
87+
mkdocs serve
88+
89+
docs-build: ## Build the documentation site
90+
pip install -r docs/requirements.txt
91+
mkdocs build
8592

8693

8794
.PHONY: help

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs.gauge.sh

docs/README.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/contributing/setting-up-project.mdx renamed to docs/contributing/setting-up-project.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
---
2-
title: Setup Guide
3-
---
1+
# Setup Guide
42

53
## 1. Automated dependency installation
64
Installing all the dependencies
@@ -50,9 +48,8 @@ make deps
5048

5149
To build and rebuild after changes to Rust files.
5250

53-
<Note>
54-
Make sure you have the Rust compiler installed. This package requires Rust and Cargo to compile extensions.
55-
</Note>
51+
!!! note
52+
Make sure you have the Rust compiler installed. This package requires Rust and Cargo to compile extensions.
5653

5754
### Install the crate as module in the current virtualenv
5855

@@ -68,13 +65,22 @@ make test
6865
```
6966

7067
## 4. Setting up the docs
71-
Tach internally uses `mintlify` platform to create and maintain public facing documentation
68+
Tach uses MkDocs with the Material theme for documentation. To work with the documentation:
7269

73-
Note: contributors would need to install [Node](https://nodejs.org/en/download/prebuilt-installer) and [npm](https://www.npmjs.com/)
74-
```bash
75-
make docs
70+
1. Install the documentation dependencies:
71+
```bash
72+
pip install -r docs/requirements.txt
73+
```
74+
75+
2. Start the local development server:
76+
```bash
77+
mkdocs serve
7678
```
7779

80+
3. Open your browser to http://127.0.0.1:8000/ to see the documentation.
81+
82+
For more details, see [Working with Docs](working-with-docs.md).
83+
7884
## 5. Things to check before committing
7985
Check and sync your dependencies in the root folder
8086
```bash
@@ -101,5 +107,3 @@ Find Beginner Friendly issues here:
101107
- [Documentation Issues](https://github.com/gauge-sh/tach/issues?q=is%3Aopen+is%3Aissue+label%3Adocumentation)
102108
- [Issues](https://github.com/gauge-sh/tach/issues)
103109
- [Documentation](https://github.com/gauge-sh/tach/tree/main/docs)
104-
105-
For any questions, just drop a message in [Discord](https://discord.com/invite/a58vW8dnmw)
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Working with Documentation
2+
3+
This guide explains how to work with Tach's documentation system, which uses MkDocs with the Material theme.
4+
5+
## Prerequisites
6+
7+
You need Python installed on your system and the documentation dependencies:
8+
9+
```bash
10+
pip install -r docs/requirements.txt
11+
```
12+
13+
## Local Development
14+
15+
To work on the documentation locally, run:
16+
17+
```bash
18+
mkdocs serve
19+
```
20+
21+
This will start a local server at http://127.0.0.1:8000/ with live reloading.
22+
23+
## Documentation Structure
24+
25+
The documentation is organized as follows:
26+
27+
- `docs/index.md` - Home page
28+
- `docs/getting-started/` - Getting started guides
29+
- `docs/usage/` - Usage documentation
30+
- `docs/contributing/` - Contributing guides
31+
- `docs/assets/` - Images and other assets
32+
33+
## Adding New Pages
34+
35+
To add a new page:
36+
37+
1. Create a new Markdown file (`.md`) in the appropriate directory
38+
2. Add an entry to the `nav` section in `mkdocs.yml`
39+
40+
Example:
41+
42+
```yaml
43+
nav:
44+
- Home: index.md
45+
- Getting Started:
46+
- Overview: getting-started/introduction.md
47+
- # Add your new page here
48+
- My New Page: getting-started/my-new-page.md
49+
```
50+
51+
## Formatting
52+
53+
MkDocs uses Markdown for formatting. Some useful features with Material for MkDocs include:
54+
55+
### Code Blocks
56+
57+
```python
58+
def example_function():
59+
return "Hello, World!"
60+
```
61+
62+
### Admonitions
63+
64+
!!! note
65+
This is a note admonition.
66+
67+
!!! warning
68+
This is a warning admonition.
69+
70+
!!! tip
71+
This is a tip admonition.
72+
73+
### Tabs
74+
75+
=== "Tab 1"
76+
Content for tab 1
77+
78+
=== "Tab 2"
79+
Content for tab 2
80+
81+
## Images
82+
83+
Place images in the `docs/assets/` directory and reference them like this:
84+
85+
```markdown
86+
![Alt text](../assets/image-name.png)
87+
```
88+
89+
## Deployment
90+
91+
The documentation is automatically deployed to GitHub Pages when changes are pushed to the main branch. The deployment is handled by the GitHub Actions workflow in `.github/workflows/docs.yml`.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Getting Started
2+
3+
## Installation
4+
5+
Tach can be installed via pip:
6+
7+
```bash
8+
pip install tach
9+
```
10+
11+
## Quick Start
12+
13+
### 1. Initialize Your Project
14+
15+
```bash
16+
tach init
17+
```
18+
19+
This will guide you through setting up your module boundaries and will create a `tach.toml` file in your project root.
20+
21+
### 2. Define Module Boundaries
22+
23+
Use the interactive module editor to define your module boundaries:
24+
25+
```bash
26+
tach mod
27+
```
28+
29+
This opens an interactive terminal UI where you can navigate and mark your module boundaries:
30+
31+
- Use arrow keys to navigate the file tree
32+
- Press `Enter` to mark/unmark a module
33+
- Press `s` to mark a directory as a source root
34+
- Press `u` to mark a module as a utility module (can be used anywhere)
35+
- Press `Ctrl+a` to mark all siblings as modules
36+
- Press `Ctrl+s` to save
37+
- Press `Ctrl+c` to exit without saving
38+
39+
### 3. Sync Dependencies
40+
41+
Once your module boundaries are defined, sync your dependency rules with your actual code:
42+
43+
```bash
44+
tach sync
45+
```
46+
47+
This will analyze your codebase and automatically add dependency rules to your `tach.toml` file based on your actual imports.
48+
49+
### 4. Check Boundaries
50+
51+
Now you can check if your module boundaries are respected:
52+
53+
```bash
54+
tach check
55+
```
56+
57+
This command will report any violations of your module boundaries or interfaces.
58+
59+
### 5. Visualize Dependencies
60+
61+
To see a visualization of your module dependencies:
62+
63+
```bash
64+
tach show
65+
```
66+
67+
This will generate a graphical representation of your module dependencies.
68+
69+
## Integrating with Your Development Workflow
70+
71+
### Pre-commit Hook
72+
73+
You can add Tach to your pre-commit hooks to automatically check your module boundaries on each commit:
74+
75+
```bash
76+
tach install --pre-commit
77+
```
78+
79+
Or manually add it to your `.pre-commit-config.yaml`:
80+
81+
```yaml
82+
- repo: local
83+
hooks:
84+
- id: tach
85+
name: tach
86+
entry: tach check
87+
language: system
88+
pass_filenames: false
89+
```
90+
91+
### CI Pipeline
92+
93+
Add Tach to your CI pipeline to ensure your module boundaries are respected:
94+
95+
```yaml
96+
- name: Check module boundaries
97+
run: tach check
98+
```
99+
100+
## Next Steps
101+
102+
- Learn more about [Configuration](../usage/configuration.md)
103+
- Explore the [Commands](../usage/commands.md) in detail
104+
- Define [Public Interfaces](../usage/interfaces.md) for your modules
105+
- Set up [Layers](../usage/layers.md) to enforce architectural patterns

0 commit comments

Comments
 (0)