Skip to content

Commit 35a2285

Browse files
authored
πŸ“š Fix MkDocs build warnings by addressing missing files and links (#81)
## πŸ”§ Fixes Issue #79 This PR addresses the MkDocs build warnings related to missing files and broken links identified in issue #79. ## πŸ“‹ Changes Made ### βœ… Files Added: - **`docs/custom-structures.md`** - Comprehensive guide on creating and using custom structures - **`docs/cli-reference.md`** - Complete CLI reference with all commands, options, and practical examples ### βœ… Files Updated: - **`docs/examples/index.md`** - Replaced all broken file references with inline YAML examples - **Fixed Jinja2 template syntax** to match struct's custom configuration (`{{@ variable @}}`) ## πŸ› οΈ Key Improvements ### Documentation Completeness - βœ… Eliminated all MkDocs warnings for missing documentation files - βœ… Added missing `custom-structures.md` (referenced in `index.md` and `articles.md`) - βœ… Added missing `cli-reference.md` (referenced in `index.md`) - βœ… Fixed broken links in `docs/examples/index.md` ### Example Quality - βœ… Added practical, copy-paste ready examples with proper Jinja2 syntax - βœ… Included comprehensive examples for: - Simple Project Structure - Template Variables - Remote Files - Python Project - Node.js API - βœ… All examples use correct template syntax as defined in `struct_module/template_renderer.py` ### CLI Documentation - βœ… Complete reference for all 5 CLI commands (`info`, `validate`, `generate`, `list`, `generate-schema`) - βœ… Detailed argument descriptions and usage examples - βœ… Practical examples section with real-world use cases ## πŸ§ͺ Testing - All examples use the correct Jinja2 syntax (`{{@ variable @}}`) as configured in the template renderer - Documentation links are now valid and point to existing content - MkDocs build should complete without warnings ## πŸ“… Expected Outcome - βœ… No warnings during the MkDocs build process - βœ… All links in the documentation resolve to valid content - βœ… Improved overall documentation integrity and accessibility - βœ… Better user experience with immediately usable examples --- **Ready for review!** This should resolve all the missing file warnings mentioned in the build logs from `2025-08-02T12:19:00Z`.
1 parent ef12e07 commit 35a2285

10 files changed

Lines changed: 823 additions & 56 deletions

File tree

β€Ždocs/cli-reference.mdβ€Ž

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
# CLI Reference
2+
3+
This document provides a reference for the `struct` command-line interface (CLI).
4+
5+
## Overview
6+
7+
The `struct` CLI allows you to generate project structures from YAML configuration files. It supports both built-in structure definitions and custom structures.
8+
9+
**Basic Usage:**
10+
11+
```sh
12+
struct {info,validate,generate,list,generate-schema} ...
13+
```
14+
15+
## Global Options
16+
17+
These options are available for all commands:
18+
19+
- `-h, --help`: Show the help message and exit.
20+
- `-l LOG, --log LOG`: Set the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL).
21+
- `-c CONFIG_FILE, --config-file CONFIG_FILE`: Path to a configuration file.
22+
- `-i LOG_FILE, --log-file LOG_FILE`: Path to a log file.
23+
24+
## Commands
25+
26+
### `info`
27+
28+
Show information about a structure definition.
29+
30+
**Usage:**
31+
32+
```sh
33+
struct info [-h] [-l LOG] [-c CONFIG_FILE] [-i LOG_FILE] [-s STRUCTURES_PATH] structure_definition
34+
```
35+
36+
**Arguments:**
37+
38+
- `structure_definition`: Name of the structure definition.
39+
- `-s STRUCTURES_PATH, --structures-path STRUCTURES_PATH`: Path to structure definitions.
40+
41+
### `validate`
42+
43+
Validate the YAML configuration file.
44+
45+
**Usage:**
46+
47+
```sh
48+
struct validate [-h] [-l LOG] [-c CONFIG_FILE] [-i LOG_FILE] yaml_file
49+
```
50+
51+
**Arguments:**
52+
53+
- `yaml_file`: Path to the YAML configuration file.
54+
55+
### `generate`
56+
57+
Generate the project structure.
58+
59+
**Usage:**
60+
61+
```sh
62+
struct generate [-h] [-l LOG] [-c CONFIG_FILE] [-i LOG_FILE] [-s STRUCTURES_PATH] [-n INPUT_STORE] [-d] [-v VARS] [-b BACKUP] [-f {overwrite,skip,append,rename,backup}] [-p GLOBAL_SYSTEM_PROMPT] [--non-interactive] [--mappings-file MAPPINGS_FILE] [-o {console,file}] structure_definition base_path
63+
```
64+
65+
**Arguments:**
66+
67+
- `structure_definition`: Path to the YAML configuration file.
68+
- `base_path`: Base path where the structure will be created.
69+
- `-s STRUCTURES_PATH, --structures-path STRUCTURES_PATH`: Path to structure definitions.
70+
- `-n INPUT_STORE, --input-store INPUT_STORE`: Path to the input store.
71+
- `-d, --dry-run`: Perform a dry run without creating any files or directories.
72+
- `-v VARS, --vars VARS`: Template variables in the format KEY1=value1,KEY2=value2.
73+
- `-b BACKUP, --backup BACKUP`: Path to the backup folder.
74+
- `-f {overwrite,skip,append,rename,backup}, --file-strategy {overwrite,skip,append,rename,backup}`: Strategy for handling existing files.
75+
- `-p GLOBAL_SYSTEM_PROMPT, --global-system-prompt GLOBAL_SYSTEM_PROMPT`: Global system prompt for OpenAI.
76+
- `--non-interactive`: Run the command in non-interactive mode.
77+
- `--mappings-file MAPPINGS_FILE`: Path to a YAML file containing mappings to be used in templates (can be specified multiple times).
78+
- `-o {console,file}, --output {console,file}`: Output mode.
79+
80+
### `list`
81+
82+
List available structures.
83+
84+
**Usage:**
85+
86+
```sh
87+
struct list [-h] [-l LOG] [-c CONFIG_FILE] [-i LOG_FILE] [-s STRUCTURES_PATH]
88+
```
89+
90+
**Arguments:**
91+
92+
- `-s STRUCTURES_PATH, --structures-path STRUCTURES_PATH`: Path to structure definitions.
93+
94+
### `generate-schema`
95+
96+
Generate JSON schema for available structures.
97+
98+
**Usage:**
99+
100+
```sh
101+
struct generate-schema [-h] [-l LOG] [-c CONFIG_FILE] [-i LOG_FILE] [-s STRUCTURES_PATH] [-o OUTPUT]
102+
```
103+
104+
**Arguments:**
105+
106+
- `-s STRUCTURES_PATH, --structures-path STRUCTURES_PATH`: Path to structure definitions.
107+
- `-o OUTPUT, --output OUTPUT`: Output file path for the schema (default: stdout).
108+
109+
## Examples
110+
111+
### Basic Structure Generation
112+
113+
Generate a structure using a built-in definition:
114+
115+
```sh
116+
struct generate python-basic ./my-project
117+
```
118+
119+
Generate from a custom YAML file:
120+
121+
```sh
122+
struct generate file://my-structure.yaml ./output-dir
123+
```
124+
125+
### Using Custom Structures
126+
127+
Generate with custom structure path:
128+
129+
```sh
130+
struct generate -s ~/custom-structures python-api ./my-api
131+
```
132+
133+
### Template Variables
134+
135+
Pass template variables to the structure:
136+
137+
```sh
138+
struct generate -v "project_name=MyApp,author=John Doe" file://structure.yaml ./output
139+
```
140+
141+
### Dry Run
142+
143+
Test structure generation without creating files:
144+
145+
```sh
146+
struct generate -d file://structure.yaml ./output
147+
```
148+
149+
### File Strategies
150+
151+
Handle existing files with different strategies:
152+
153+
```sh
154+
# Skip existing files
155+
struct generate -f skip file://structure.yaml ./output
156+
157+
# Backup existing files
158+
struct generate -f backup -b ./backup file://structure.yaml ./output
159+
```
160+
161+
### Console Output
162+
163+
Output to console instead of creating files:
164+
165+
```sh
166+
struct generate -o console file://structure.yaml ./output
167+
```
168+
169+
### Validation
170+
171+
Validate a YAML configuration before generation:
172+
173+
```sh
174+
struct validate my-structure.yaml
175+
```
176+
177+
### List Available Structures
178+
179+
List all built-in structures:
180+
181+
```sh
182+
struct list
183+
```
184+
185+
List structures from custom path:
186+
187+
```sh
188+
struct list -s ~/custom-structures
189+
```
190+
191+
### Get Structure Information
192+
193+
Get detailed information about a structure:
194+
195+
```sh
196+
struct info python-basic
197+
```
198+
199+
### Generate Schema
200+
201+
Generate JSON schema and save to file:
202+
203+
```sh
204+
struct generate-schema -o schema.json
205+
```

β€Ždocs/custom-structures.mdβ€Ž

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Creating Custom Structures
2+
3+
Let's say you are happy with the default structures that STRUCT provides, but you want to customize them for your specific needs. This is totally possible!
4+
5+
The best way to approach this is to have a repository where you can store your custom structures. You can then reference these structures in your `.struct.yaml` files.
6+
7+
## Suggested Repository Structure
8+
9+
Here is a suggested structure for your custom structures repository:
10+
11+
```sh
12+
structures/
13+
β”œβ”€β”€ category1/
14+
β”‚ β”œβ”€β”€ structure1.yaml
15+
β”‚ └── structure2.yaml
16+
β”œβ”€β”€ category2/
17+
β”‚ β”œβ”€β”€ structure1.yaml
18+
β”‚ └── structure2.yaml
19+
```
20+
21+
This way you could reference your custom structures in your `.struct.yaml` files like this:
22+
23+
```yaml
24+
folders:
25+
- ./:
26+
struct:
27+
- category1/structure1
28+
- category2/structure2
29+
with:
30+
var_in_structure1: 'value'
31+
```
32+
33+
For this to work, you will need to set the path to the custom structures repository using the `-s` option when running STRUCT:
34+
35+
```sh
36+
struct generate -s ~/path/to/custom-structures/structures file://.struct.yaml ./output
37+
```

0 commit comments

Comments
Β (0)