Skip to content

Commit 93ed0a8

Browse files
committed
Add comprehensive documentation for STRUCT
- Introduced GitHub integration documentation for automating project structures across repositories. - Added hooks documentation to define pre and post-generation commands. - Removed outdated index.html and replaced it with a new index.md for better navigation. - Created installation guide for easy setup of STRUCT. - Added known issues documentation to track limitations and workarounds. - Introduced mappings support documentation for injecting key-value pairs into templates. - Added quick start guide for rapid deployment using Docker. - Created YAML schema reference for validation and IDE support. - Added template variables documentation for dynamic content generation. - Documented basic usage of STRUCT commands and options.
1 parent fe908bc commit 93ed0a8

21 files changed

Lines changed: 2786 additions & 1134 deletions

README.es.md

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

README.md

Lines changed: 70 additions & 497 deletions
Large diffs are not rendered by default.

docs/articles.md

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
# Articles and Resources
2+
3+
Collection of articles, tutorials, and external resources about STRUCT.
4+
5+
## Official Articles
6+
7+
### [Defining User Prompts on STRUCT: Harnessing GPT-4.1 for Scalable Project Scaffolding](https://medium.com/@httpdss/defining-user-prompts-on-struct-harnessing-gpt-4-1-for-scalable-project-scaffolding-e6d3b4ec4701)
8+
9+
Learn how to leverage GPT-4.1 to create intelligent project scaffolding with STRUCT. This article covers advanced prompting techniques and AI-driven project generation.
10+
11+
**Topics covered:**
12+
13+
- AI-powered template generation
14+
- Dynamic project structures
15+
- GPT-4.1 integration patterns
16+
- Scalable scaffolding strategies
17+
18+
### [Unlocking Developer Productivity with STRUCT: The Ultimate Open-Source Tool for Automated Project Structures](https://blog.devops.dev/unlocking-developer-productivity-with-struct-the-ultimate-open-source-tool-for-automated-project-8bca9b5f40f9)
19+
20+
A comprehensive overview of STRUCT's capabilities and how it can boost developer productivity through automation.
21+
22+
**Topics covered:**
23+
24+
- Project structure automation
25+
- Developer workflow optimization
26+
- Open-source benefits
27+
- Real-world use cases
28+
29+
### [Automating Project Structures with STRUCT and GitHub Actions](https://medium.com/@httpdss/automating-project-structures-with-struct-and-github-actions-64e09c40c11e)
30+
31+
Discover how to integrate STRUCT with GitHub Actions for automated project setup and maintenance across repositories.
32+
33+
**Topics covered:**
34+
35+
- GitHub Actions integration
36+
- CI/CD automation
37+
- Repository management
38+
- Workflow triggers
39+
40+
### [Advanced STRUCT Tips: Working with Template Variables and Jinja2 Filters](https://medium.com/@httpdss/advanced-struct-tips-working-with-template-variables-and-jinja2-filters-b239bf3145e4)
41+
42+
Deep dive into STRUCT's templating system, covering advanced variable usage and custom Jinja2 filters.
43+
44+
**Topics covered:**
45+
46+
- Template variable patterns
47+
- Custom Jinja2 filters
48+
- Dynamic content generation
49+
- Advanced templating techniques
50+
51+
## Community Articles
52+
53+
*Community contributions welcome! Submit a PR to add your STRUCT-related articles here.*
54+
55+
## Tutorials
56+
57+
### Video Tutorials
58+
59+
*Coming soon - video tutorials will be added as they become available.*
60+
61+
### Interactive Tutorials
62+
63+
- **Getting Started Guide**: Follow along with practical examples in the [Quick Start](quickstart.md) documentation
64+
- **Template Variables**: Learn by example in the [Template Variables](template-variables.md) guide
65+
- **Advanced Configuration**: Explore complex scenarios in [YAML Configuration](configuration.md)
66+
67+
## Use Cases
68+
69+
### DevOps and Infrastructure
70+
71+
- **Terraform Module Generation**: Standardize infrastructure code
72+
- **Kubernetes Manifests**: Generate consistent deployment configurations
73+
- **CI/CD Pipeline Templates**: Automate pipeline creation
74+
- **Configuration Management**: Maintain consistent environments
75+
76+
### Application Development
77+
78+
- **Microservice Scaffolding**: Generate service boilerplate
79+
- **API Project Templates**: Standardize REST API structures
80+
- **Frontend Framework Setup**: Bootstrap React, Vue, or Angular projects
81+
- **Database Schema Generation**: Create consistent database structures
82+
83+
### Documentation and Compliance
84+
85+
- **Project Documentation**: Generate README templates and docs
86+
- **Compliance Templates**: Ensure regulatory requirements
87+
- **Security Configurations**: Apply security best practices
88+
- **Audit Trail Generation**: Create trackable project structures
89+
90+
## Presentations and Talks
91+
92+
*Conference presentations and community talks about STRUCT will be listed here.*
93+
94+
## Research and Academic Papers
95+
96+
*Academic research involving STRUCT or related concepts will be referenced here.*
97+
98+
## External Tools and Integrations
99+
100+
### IDE Extensions
101+
102+
- **VS Code YAML Extension**: Enhanced editing with schema validation
103+
- **IntelliJ YAML Support**: Schema-aware editing and completion
104+
105+
### CI/CD Integrations
106+
107+
- **GitHub Actions**: Pre-built actions for STRUCT workflows
108+
- **GitLab CI**: Integration examples and templates
109+
- **Jenkins**: Pipeline integration patterns
110+
111+
### Complementary Tools
112+
113+
- **Cookiecutter**: Alternative project templating tool
114+
- **Yeoman**: JavaScript-focused scaffolding
115+
- **Copilot**: AI-powered code generation
116+
- **Terraform**: Infrastructure as code
117+
118+
## Community Resources
119+
120+
### Forums and Discussion
121+
122+
- **GitHub Discussions**: Official community forum
123+
- **Stack Overflow**: Questions tagged with `struct-tool`
124+
- **Reddit**: `/r/devops` and `/r/python` communities
125+
126+
### Code Examples
127+
128+
- **GitHub Examples Repository**: Community-contributed examples
129+
- **Gist Collections**: Snippets and configurations
130+
- **Docker Hub**: Pre-built images and examples
131+
132+
## Learning Paths
133+
134+
### Beginner Path
135+
136+
1. Start with [Installation](installation.md)
137+
2. Follow the [Quick Start](quickstart.md) guide
138+
3. Explore [Basic Usage](usage.md)
139+
4. Learn [YAML Configuration](configuration.md) basics
140+
141+
### Intermediate Path
142+
143+
1. Master [Template Variables](template-variables.md)
144+
2. Understand [File Handling](file-handling.md) strategies
145+
3. Explore [Custom Structures](custom-structures.md)
146+
4. Learn [Mappings](mappings.md) for data separation
147+
148+
### Advanced Path
149+
150+
1. Implement [Hooks](hooks.md) for automation
151+
2. Set up [GitHub Integration](github-integration.md)
152+
3. Contribute to [Development](development.md)
153+
4. Create complex multi-environment setups
154+
155+
## Contributing Content
156+
157+
We welcome contributions to this resource collection! Here's how you can help:
158+
159+
### Adding Articles
160+
161+
1. Fork the repository
162+
2. Add your article to the appropriate section
163+
3. Include a brief description and key topics
164+
4. Submit a pull request
165+
166+
### Suggesting Resources
167+
168+
- Open an issue with the "resource suggestion" label
169+
- Include the resource link and description
170+
- Explain why it would be valuable to the community
171+
172+
### Writing Tutorials
173+
174+
- Create step-by-step guides with practical examples
175+
- Include code snippets and expected outputs
176+
- Test instructions thoroughly before submitting
177+
178+
## Newsletter and Updates
179+
180+
Stay updated with the latest STRUCT developments:
181+
182+
- **GitHub Releases**: Watch the repository for release notifications
183+
- **Community Updates**: Follow project maintainers on social media
184+
- **Blog Subscriptions**: Subscribe to the official blog for updates
185+
186+
*This page is regularly updated with new content. Bookmark it for future reference!*

docs/completion.md

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# Command-Line Auto-Completion
2+
3+
This project uses [argcomplete](https://kislyuk.github.io/argcomplete/) to provide command-line auto-completion for the `struct` script. Follow these steps to enable auto-completion:
4+
5+
## Installation
6+
7+
### 1. Install argcomplete
8+
9+
```sh
10+
pip install argcomplete
11+
```
12+
13+
### 2. Enable Global Completion
14+
15+
This step is usually done once per system:
16+
17+
```sh
18+
activate-global-python-argcomplete
19+
```
20+
21+
This command sets up global completion for all Python scripts that use argcomplete.
22+
23+
### 3. Register the Script
24+
25+
Add the following line to your shell's configuration file:
26+
27+
**For Bash** (`.bashrc` or `.bash_profile`):
28+
29+
```sh
30+
eval "$(register-python-argcomplete struct)"
31+
```
32+
33+
**For Zsh** (`.zshrc`):
34+
35+
```sh
36+
eval "$(register-python-argcomplete struct)"
37+
```
38+
39+
**For Fish** (`.config/fish/config.fish`):
40+
41+
```fish
42+
register-python-argcomplete --shell fish struct | source
43+
```
44+
45+
### 4. Reload Your Shell
46+
47+
```sh
48+
# For Bash
49+
source ~/.bashrc
50+
51+
# For Zsh
52+
source ~/.zshrc
53+
54+
# For Fish
55+
source ~/.config/fish/config.fish
56+
```
57+
58+
## Usage
59+
60+
After completing the setup, you can use auto-completion by typing part of a command and pressing `Tab`:
61+
62+
```sh
63+
struct <Tab>
64+
# Shows: generate, generate-schema, validate, info, list
65+
66+
struct generate <Tab>
67+
# Shows available structure names and options
68+
69+
struct generate --<Tab>
70+
# Shows: --log, --dry-run, --backup, --file-strategy, etc.
71+
```
72+
73+
## Advanced Configuration
74+
75+
### Per-Project Completion
76+
77+
If you only want completion for specific projects, you can add completion to your project's virtual environment activation script:
78+
79+
```sh
80+
# In your .venv/bin/activate file, add:
81+
eval "$(register-python-argcomplete struct)"
82+
```
83+
84+
### Custom Completion
85+
86+
You can create custom completion functions for specific use cases:
87+
88+
```sh
89+
# Custom completion for structure names
90+
_struct_structures() {
91+
local structures=$(struct list --names-only 2>/dev/null)
92+
COMPREPLY=($(compgen -W "$structures" -- "${COMP_WORDS[COMP_CWORD]}"))
93+
}
94+
95+
# Register custom completion
96+
complete -F _struct_structures struct-generate
97+
```
98+
99+
## Troubleshooting
100+
101+
### Completion Not Working
102+
103+
1. **Check argcomplete installation**:
104+
105+
```sh
106+
python -c "import argcomplete; print('OK')"
107+
```
108+
109+
2. **Verify global activation**:
110+
111+
```sh
112+
activate-global-python-argcomplete --user
113+
```
114+
115+
3. **Check shell configuration**:
116+
Make sure the eval statement is in the correct shell configuration file.
117+
118+
4. **Restart your shell**:
119+
Sometimes you need to completely restart your terminal.
120+
121+
### Slow Completion
122+
123+
If completion is slow, you can enable caching:
124+
125+
```sh
126+
export ARGCOMPLETE_USE_TEMPFILES=1
127+
```
128+
129+
Add this to your shell configuration file for persistent caching.
130+
131+
### Debug Completion
132+
133+
Enable debug mode to troubleshoot completion issues:
134+
135+
```sh
136+
export _ARGCOMPLETE_DEBUG=1
137+
struct <Tab>
138+
```
139+
140+
## Platform-Specific Notes
141+
142+
### macOS
143+
144+
On macOS, you might need to install bash-completion first:
145+
146+
```sh
147+
# Using Homebrew
148+
brew install bash-completion
149+
150+
# Then add to ~/.bash_profile:
151+
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
152+
```
153+
154+
### Windows
155+
156+
For Windows users using Git Bash or WSL, follow the same steps as Linux. For PowerShell, argcomplete support is limited.
157+
158+
### Docker
159+
160+
When running STRUCT in Docker, completion won't work directly. However, you can create a wrapper script:
161+
162+
```sh
163+
#!/bin/bash
164+
# struct-wrapper.sh
165+
docker run --rm -v $(pwd):/workdir ghcr.io/httpdss/struct:main "$@"
166+
```
167+
168+
Then set up completion for the wrapper:
169+
170+
```sh
171+
eval "$(register-python-argcomplete struct-wrapper.sh)"
172+
```
173+
174+
## Benefits of Auto-Completion
175+
176+
- **Faster typing**: Quickly complete command names and options
177+
- **Discoverability**: See available commands and options
178+
- **Accuracy**: Reduce typos and errors
179+
- **Productivity**: Spend less time looking up command syntax
180+
181+
## Supported Completions
182+
183+
STRUCT provides completion for:
184+
185+
- **Commands**: `generate`, `validate`, `list`, etc.
186+
- **Options**: `--log`, `--dry-run`, `--backup`, etc.
187+
- **Structure names**: All available built-in and custom structures
188+
- **File paths**: Local files and directories
189+
- **Enum values**: Log levels, file strategies, etc.
190+
191+
## Example Session
192+
193+
```sh
194+
$ struct <Tab>
195+
generate generate-schema info list validate
196+
197+
$ struct generate <Tab>
198+
configs/ docker-files project/ terraform/
199+
200+
$ struct generate terraform/<Tab>
201+
terraform/app terraform/module
202+
203+
$ struct generate --<Tab>
204+
--backup --dry-run --file-strategy --log
205+
--log-file --mappings-file --structures-path
206+
207+
$ struct generate --log <Tab>
208+
DEBUG ERROR INFO WARNING
209+
```
210+
211+
This makes working with STRUCT much more efficient and user-friendly!

0 commit comments

Comments
 (0)