feat: Add `mdbook` action
- Lingua principale
- Shell
- Stelle
- 0
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
## Summary
Create a reusable GitHub Action to run mdbook commands with plugin support.
## Use Case
Build and test mdbook documentation projects. Expects mdbook to be pre-installed but handles plugin installation.
## Specification
### Inputs
| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `command` | Yes | — | `build`, `test`, or `serve` |
| `book_dir` | No | `.` | Directory containing book.toml |
| `plugins` | No | — | Comma-separated list of plugins to install |
| `dest_dir` | No | — | Override output directory |
### Example Usage
```yaml
- uses: arustydev/gha/mdbook@v1
with:
command: build
plugins: mermaid, toc, admonish
- uses: arustydev/gha/mdbook@v1
with:
command: test
```
## Implementation Notes
### Plugin Handling
- Plugins installed via `cargo install mdbook-{plugin}`
- Common plugins: `mermaid`, `toc`, `admonish`, `linkcheck`, `katex`
- Cache plugin binaries for faster subsequent runs
### Pre-requisites
- Expects `mdbook` binary to be available in PATH
- Expects `cargo` to be available for plugin installation
- Workflow should install mdbook before this action runs
### Commands
```bash
# Build
mdbook build "$book_dir" --dest-dir "$dest_dir"
# Test
mdbook test "$book_dir"
# Serve (primarily for local dev, less useful in CI)
mdbook serve "$book_dir"
```
## Related
- Part of docs aggregation workflow extraction
- Used after `sparse-checkout-aggregate` and `symlink-map` actions
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Esamina le azioni esistenti sparse-checkout-aggregate e symlink-map, quindi analizza il workflow di aggregazione della documentazione e il suo utilizzo di book.toml. Definisci il punto di ingresso dell’azione in base al comando elencato e al comportamento degli input, inclusi l’installazione e il caching dei plugin. Il lavoro è completato quando build, test e serve funzionano con gli input documentati e mdbook rimane preinstallato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- github-actions, rust, shell
- Ambito
- ci-cd, documentation, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100