|
| 1 | +# AI Assistant Guide for docs-builder |
| 2 | + |
| 3 | +This file contains instructions and guidance for AIs when working with the docs-builder repository. |
| 4 | + |
| 5 | +## Repository overview |
| 6 | + |
| 7 | +This is Elastic's distributed documentation tooling system built on .NET 9, consisting of: |
| 8 | + |
| 9 | +- **docs-builder**: CLI tool for building single documentation sets |
| 10 | +- **docs-assembler**: CLI tool for assembling multiple doc sets |
| 11 | +- Written in C# and F# with extensive Markdown processing capabilities |
| 12 | + |
| 13 | +## Essential commands |
| 14 | + |
| 15 | +### Development |
| 16 | +```bash |
| 17 | +# Ensure no compilation failures -- run this to confirm the absence of build errors. |
| 18 | +dotnet build |
| 19 | + |
| 20 | +# Run docs-builder locally |
| 21 | +dotnet run --project src/tooling/docs-builder |
| 22 | + |
| 23 | +# Run all the unit tests which complete fast. |
| 24 | +./build.sh unit-test |
| 25 | + |
| 26 | +# Clean all the build artifacts located in .artifacts folder |
| 27 | +./build.sh clean |
| 28 | + |
| 29 | +# Produce native binaries -- only call this if a change touches serialization and you are committing on behalf of the developer. |
| 30 | + ./build.sh publishbinaries |
| 31 | + |
| 32 | +``` |
| 33 | + |
| 34 | +### Linting and Code Quality |
| 35 | + |
| 36 | +```bash |
| 37 | +# Format code. Always run this when output contains formatting errors. |
| 38 | +dotnet format |
| 39 | + |
| 40 | +# Run specific test project |
| 41 | +dotnet test tests/Elastic.Markdown.Tests/ |
| 42 | + |
| 43 | +# Run tests with verbose output |
| 44 | +dotnet test --logger "console;verbosity=detailed" |
| 45 | +``` |
| 46 | + |
| 47 | +## Key architecture Points |
| 48 | + |
| 49 | +### Main Projects |
| 50 | + |
| 51 | +- `src/Elastic.Markdown/` - Core Markdown processing engine |
| 52 | +- `src/tooling/docs-builder/` - Main CLI application |
| 53 | +- `src/tooling/docs-assembler/` - Assembly tool |
| 54 | +- `src/Elastic.Documentation.Site/` - Web rendering components |
| 55 | + |
| 56 | +### Testing Structure |
| 57 | + |
| 58 | +- `tests/` - C# unit tests |
| 59 | +- `tests/authoring/` - F# authoring tests |
| 60 | +- `tests-integration/` - Integration tests |
| 61 | + |
| 62 | +### Configuration |
| 63 | + |
| 64 | +- `config/` - YAML configuration files |
| 65 | +- `Directory.Build.props` - MSBuild properties |
| 66 | +- `Directory.Packages.props` - Centralized package management |
| 67 | + |
| 68 | +## Development guidelines |
| 69 | + |
| 70 | +### Adding New Features |
| 71 | + |
| 72 | +1. **Markdown Extensions**: Add to `src/Elastic.Markdown/Myst/` |
| 73 | +2. **CLI Commands**: Extend `src/tooling/docs-builder/Cli/` or `docs-assembler/Cli/` |
| 74 | +3. **Web Components**: Add to `src/Elastic.Documentation.Site/` |
| 75 | +4. **Configuration**: Modify `src/Elastic.Documentation.Configuration/` |
| 76 | + |
| 77 | +### Code style |
| 78 | + |
| 79 | +- Follow existing C# and F# conventions in the codebase |
| 80 | +- ... |
| 81 | + |
| 82 | +### Testing requirements |
| 83 | + |
| 84 | +- Add unit tests for new functionality |
| 85 | +- Use F# for authoring/documentation-specific tests |
| 86 | +- ... |
| 87 | + |
| 88 | +### Common patterns |
| 89 | + |
| 90 | +- ... |
| 91 | + |
| 92 | +## Documentation |
| 93 | + |
| 94 | +The repository is self-documenting: |
| 95 | + |
| 96 | +- `/docs/` contains comprehensive documentation |
| 97 | + |
| 98 | +You MUST update the documentation when there are changes in the markdown syntax or rendering behaviour. |
| 99 | + |
| 100 | +## Useful file locations |
| 101 | + |
| 102 | +- Entry points: `src/tooling/docs-builder/Program.cs`, `src/tooling/docs-assembler/Program.cs` |
| 103 | +- Markdown processing: `src/Elastic.Markdown/Myst/` |
| 104 | +- Web assets: `src/Elastic.Documentation.Site/Assets/` |
| 105 | +- Configuration schemas: `src/Elastic.Documentation.Configuration/` |
| 106 | +- Test helpers: `tests/Elastic.Markdown.Tests/TestHelpers.cs` |
0 commit comments