feat: Add `mdbook` action

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
github-actions, rust, shell

Research direction

Review the existing sparse-checkout-aggregate and symlink-map actions, then inspect the docs aggregation workflow and its book.toml usage. Define the action entry point around the listed command and input behavior, including plugin installation and caching. Done means build, test, and serve work with the documented inputs and mdbook remains pre-installed.

Written by the indexing model from the issue text.

Description

enhancement new-action

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
- 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
# 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
Dominant language
Shell
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aRustyDev/gh

All issues in aRustyDev/gh

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.