Skip to content

Commit 1dc6121

Browse files
[Docs] Add dstack skill (#3525)
1 parent dbdbf4d commit 1dc6121

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1330
-81
lines changed

.github/workflows/build-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ jobs:
2323
name: site
2424
path: site
2525
retention-days: 1
26+
include-hidden-files: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ uv.lock
2626
/src/dstack/_internal/server/statics
2727

2828
profiling_results.html
29+
docs/docs/reference/api/rest/openapi.json

contributing/DOCS.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,106 @@ If you want to build static files, you can use the following command:
4747
```shell
4848
uv run mkdocs build -s
4949
```
50+
51+
## Documentation build system
52+
53+
The documentation uses a custom build system with MkDocs hooks to generate various files dynamically.
54+
55+
### Build hooks
56+
57+
The build process is customized via hooks in `scripts/docs/hooks.py`:
58+
59+
#### 1. Example materialization
60+
61+
Example pages like `examples/single-node-training/trl/index.md` are stubs that reference `README.md` files in the repository root:
62+
- **Stub location**: `docs/examples/single-node-training/trl/index.md`
63+
- **Content source**: `examples/single-node-training/trl/README.md`
64+
65+
During the build, the hook reads the README content and uses it for rendering the HTML page.
66+
67+
#### 2. Schema reference expansion
68+
69+
Files in `docs/reference/**/*.md` can use `#SCHEMA#` placeholders that are expanded with generated schema documentation during the build.
70+
71+
#### 3. llms.txt generation
72+
73+
Two files are generated for LLM consumption:
74+
75+
- **llms.txt**: Structured overview of documentation with titles and descriptions
76+
- Generated from mkdocs nav structure
77+
- Includes sections: Getting started, Concepts, Guides, Examples
78+
- Excludes: Reference section
79+
- Configuration: `scripts/docs/gen_llms_files.py` (INCLUDE_SECTIONS, EXCLUDE_SECTIONS)
80+
81+
- **llms-full.txt**: Full concatenation of all pages from llms.txt
82+
- Contains complete markdown content of all included pages
83+
84+
The generation logic is in `scripts/docs/gen_llms_files.py` and uses:
85+
- `site_name`, `site_description`, `site_url` from `mkdocs.yml`
86+
- Page titles from mkdocs nav structure
87+
- Page descriptions from markdown frontmatter
88+
89+
**Adding descriptions**: To add descriptions to pages, add YAML frontmatter:
90+
91+
```yaml
92+
---
93+
title: Page Title
94+
description: Short description of what this page covers
95+
---
96+
```
97+
98+
For examples, add frontmatter to the `README.md` files in the repository root (e.g., `examples/single-node-training/trl/README.md`).
99+
100+
#### 4. Skills discovery
101+
102+
The build creates `.well-known/skills/` directory structure for skills discovery:
103+
- Reads `skills/dstack/SKILL.md`
104+
- Parses name and description from frontmatter
105+
- Generates `.well-known/skills/index.json`
106+
- Copies SKILL.md to both `.well-known/skills/dstack/` and site root
107+
108+
### File structure
109+
110+
```
111+
docs/
112+
├── docs/ # Main documentation content
113+
│ ├── index.md # Getting started
114+
│ ├── installation.md
115+
│ ├── quickstart.md
116+
│ ├── concepts/ # Concept pages
117+
│ ├── guides/ # How-to guides
118+
│ └── reference/ # API reference (schema expansion)
119+
├── examples/ # Example stub files (index.md)
120+
│ └── single-node-training/
121+
│ └── trl/
122+
│ └── index.md # Stub referencing root README
123+
└── overrides/ # Theme customization
124+
125+
examples/ # Example content (repository root)
126+
└── single-node-training/
127+
└── trl/
128+
├── README.md # Actual content with frontmatter
129+
└── train.dstack.yml
130+
131+
scripts/docs/
132+
├── hooks.py # MkDocs build hooks
133+
├── gen_llms_files.py # llms.txt generation
134+
├── gen_schema_reference.py # Schema expansion
135+
└── gen_cli_reference.py # CLI reference generation
136+
137+
skills/
138+
└── dstack/
139+
└── SKILL.md # Skills discovery content
140+
```
141+
142+
### Testing changes
143+
144+
When modifying the build system:
145+
146+
1. Test local build: `uv run mkdocs build -s`
147+
2. Check generated files in `site/`:
148+
- `site/llms.txt`
149+
- `site/llms-full.txt`
150+
- `site/.well-known/skills/index.json`
151+
3. Verify example pages render correctly
152+
4. Check that descriptions appear in llms.txt

docs/.nojekyll

Whitespace-only changes.

docs/blog/posts/0_20.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ While the update introduces breaking changes, 0.19.* CLIs remain compatible with
121121
122122
## What's next
123123
124-
1. Follow the [Installation](../../docs/installation/index.md) guide
124+
1. Follow the [Installation](../../docs/installation.md) guide
125125
2. Try the [Quickstart](../../docs/quickstart.md)
126126
3. Report issues on [GitHub](https://github.com/dstackai/dstack/issues)
127127
4. Ask questions on [Discord](https://discord.gg/u8SmfwPpMd)

docs/blog/posts/digitalocean-and-amd-dev-cloud.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $ dstack server
7171

7272
</div>
7373

74-
For more details, see [Installation](../../docs/installation/index.md).
74+
For more details, see [Installation](../../docs/installation.md).
7575

7676
Use the `dstack` CLI to
7777
manage [dev environments](../../docs/concepts/dev-environments.md), [tasks](../../docs/concepts/tasks.md),

docs/blog/posts/dstack-sky.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Continue? [y/n]:
6969
</div>
7070

7171
!!! info "Backends"
72-
`dstack Sky` supports the same [backends](../../docs/installation/index.md) as the open-source version, except that you
72+
`dstack Sky` supports the same [backends](../../docs/installation.md) as the open-source version, except that you
7373
don't need to set them up. By default, it uses all supported backends.
7474

7575
You can use both on-demand and spot instances without needing to manage quotas, as they are automatically handled

docs/blog/posts/hotaisle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ $ dstack server
8080

8181
</div>
8282

83-
For more details, see [Installation](../../docs/installation/index.md).
83+
For more details, see [Installation](../../docs/installation.md).
8484

8585
Use the `dstack` CLI to
8686
manage [dev environments](../../docs/concepts/dev-environments.md), [tasks](../../docs/concepts/tasks.md),

docs/blog/posts/nebius.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ $ dstack server
7777

7878
</div>
7979

80-
For more details, refer to [Installation](../../docs/installation/index.md).
80+
For more details, refer to [Installation](../../docs/installation.md).
8181

8282
Use the `dstack` CLI to
8383
manage [dev environments](../../docs/concepts/dev-environments.md), [tasks](../../docs/concepts/tasks.md),

docs/blog/posts/nvidia-and-amd-on-vultr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ projects:
6565
6666
</div>
6767
68-
For more details, refer to [Installation](../../docs/installation/index.md).
68+
For more details, refer to [Installation](../../docs/installation.md).
6969
7070
> Interested in fine-tuning or deploying DeepSeek on Vultr? Check out the corresponding [example](../../examples/llms/deepseek/index.md).
7171

0 commit comments

Comments
 (0)