Skip to content

Conversation

@dpshade
Copy link

@dpshade dpshade commented Sep 18, 2025

Summary

Creates a dedicated GitHub Actions workflow to automatically build and deploy the mdBook literate documentation to ArNS when changes are pushed to the edge branch.

Features

  • Automated Documentation Generation: Runs build-literate-erlang.sh to generate fresh .erl.md files from source
  • mdBook Build & Deploy: Builds and deploys to Arweave (book_hyperbeam.arweave.net via ArNS)
  • Lightweight Workflow: Minimal dependencies (only mdBook, no Erlang/Python stack)
  • Source-Driven: Triggers on Erlang source code changes, not pre-written docs

Workflow Details

  • Triggers: edge branch pushes affecting src/**, mdBook config, or build scripts
  • Build Process:
    1. Install mdBook
    2. Generate literate Erlang documentation from src/ files
    3. Build mdBook from generated source
  • Deployment: Uses permaweb-deploy to deploy to ArNS with hyperbeam name and book undername
  • PR Validation: Includes check job to validate builds work correctly

Updated Workflows

  1. New: build-deploy-mdbook.yml - Dedicated mdBook workflow triggered by source changes
  2. Updated: build-deploy-docs.yml - Now mkdocs-only, excludes docs/book/**, uses docs/deploy branches with conditional ArNS deployment

Benefits

  • Always Current: Documentation automatically updates when Erlang code changes
  • True Literate Programming: Docs generated from source comments and structure
  • Fast Deployments: Lightweight workflow for quick documentation updates
  • Developer Friendly: No manual documentation maintenance required

This ensures book_hyperbeam.arweave.net reflects the latest codebase state whenever developers push changes to edge.

- Add mdbook-based documentation framework with 158+ Erlang module docs
- Configure mdbook with custom port 3471 and disabled chapter numbering
- Set build directory to 'dist' to avoid confusion with source structure
- Add gitignore entry to exclude generated documentation files
- Include custom CSS and JavaScript for enhanced documentation experience
- Organize modules by functional categories: Arweave Foundation, Device Framework, Codec Modules, Core Services, and HyperBEAM Core
These are generated artifacts that duplicate source code and should not be committed.
The build process now generates them on-demand.
- Add entries to .gitignore for generated literate Erlang documentation files
- Adjust custom CSS to fix excessive heading margins in generated documentation
- Remove outdated copy functionality section from introduction.md
… layout

- Set margin-top for h2 and h3 elements to 0 to reduce excessive spacing in generated documentation.
- Change title from "HyperBEAM Literate Documentation" to "HyperBEAM Book" in book.toml and README.md.
- Adjust heading margins for h2 and h3 elements in custom.css for improved layout.
- Add styling for search input and results in custom.css to enhance user experience.
- Change workflow name to "Build & Deploy mkdocs Documentation".
- Update trigger branches for pull requests and pushes to include `docs/deploy` and `docs/deploy-test`.
- Exclude `docs/book/**` from triggering the workflow.
- Modify deployment conditions to handle production and preview deployments based on the branch.
- Rename build step to "Build mkdocs Documentation" for clarity.
- Modify workflow triggers to include changes in source code and mdBook configuration files.
- Remove outdated references to `docs/book/**` and streamline the deployment process.
- Ensure the workflow is set to trigger on relevant changes for improved documentation management.
@dpshade dpshade marked this pull request as ready for review September 18, 2025 18:42
- Add new CSS file `theme/highlight.css` for improved syntax highlighting styles.
- Update `book.toml` to include the new CSS file alongside the existing custom styles.
- Introduce `highlight.js` for enhanced code highlighting functionality in documentation.
- Introduce `erlang.min.js` for Erlang grammar in Highlight.js to enhance code highlighting in documentation.
- Update `highlight.js` to include the new Erlang language support, improving the overall syntax highlighting capabilities.
- Update `build-literate-erlang.sh` to improve the extraction of module and function documentation by preserving paragraph breaks.
- Introduce a new function `write_code_with_inline_comments` to handle inline comments in Erlang code, ensuring proper formatting and structure in the output.
- Refactor existing code to enhance readability and maintainability while processing Erlang documentation.
- Change authors in `book.toml` to "HyperBEAM Core Team".
- Set default theme to "rust" in `custom.js` if no theme is stored, improving user experience with theme management.
- Introduce `setDefaultTheme` function to manage theme preferences effectively.
- Introduce `build-and-serve.sh` to automate the generation and local serving of literate documentation.
- Add `build-literate-erlang-js.sh` for a comprehensive Erlang documentation generation using JavaScript.
- Update `build-literate-erlang.sh` to improve documentation extraction and formatting.
- Create `erlang-literate-parser.js` for enhanced parsing of Erlang files, supporting various comment types and annotations.
- Add `README.md` in the book source directory to provide an overview of the generated documentation.
- Remove outdated `erlang.min.js` and `highlight.js` files to streamline the documentation theme.
- Introduce `collectParamTagsBeforeSpec` method to gather parameter and return tags before specifications, improving documentation accuracy.
- Modify `processFunctionBody` to handle inline documentation tags more effectively, ensuring proper formatting in generated output.
- Update `cleanDocumentation` and `formatPreContent` methods for better handling of structured content and documentation formatting.
- Revise `introduction.md` and `SUMMARY.md` to reflect updated terminology and improve organization of documentation sections.
…and documentation handling

- Update return processing to utilize `splitReturnsIntoOutcomes` and `formatReturnsText` for better output formatting.
- Enhance handling of continuation lines in return and parameter sections to maintain clarity in documentation.
- Introduce `reflowNumberedLists` method to ensure proper formatting of numbered lists in generated documentation.
…cumentation handling

- Introduce character codes and string constants for faster comparisons and reduced memory allocations.
- Optimize regex patterns for performance and clarity in parsing Erlang files.
- Enhance the reset method to initialize module information with default values.
- Update function processing to utilize constants for improved readability and maintainability.
- Revise documentation generation methods to ensure consistent formatting and structure in output.
- Update outdated scripts: `build-all.sh`, `build-and-serve.sh`, `build-literate-erlang.sh`, and `build-literate-erlang-js.sh`.
- These scripts have been superseded by more efficient implementations, streamlining the documentation generation process.
- Ensure the codebase is cleaner and more maintainable by removing legacy files.
- Replace deprecated `build-literate-erlang.sh` with `generate-literate-docs.sh` in the GitHub Actions workflow.
- Ensure the workflow reflects the latest script for generating literate documentation, maintaining consistency in the build process.
@dpshade dpshade closed this Oct 25, 2025
@dpshade dpshade deleted the dpshade/docs-literate-erl branch October 25, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants