### Install via AUR helper Source: https://github.com/abhinav/stitchmd/blob/main/README.md Command to install using an AUR helper like yay. ```go yay -S stitchmd-bin ``` -------------------------------- ### Install binary with GitHub Action Source: https://github.com/abhinav/stitchmd/blob/main/README.md Use the install mode to set up the stitchmd binary in the environment. ```yaml uses: abhinav/stitchmd-action@v1 with: mode: install ``` -------------------------------- ### File Structure Example Source: https://github.com/abhinav/stitchmd/blob/main/README.md Visual representation of a project directory using nested summary files. ```text . |- summary.md |- use | |- summary.md | |- install.md | '- config.md '- maintain |- summary.md |- dashboard.md '- troubleshooting.md ``` -------------------------------- ### Section rendering transformation Source: https://github.com/abhinav/stitchmd/blob/main/README.md Example showing how input sections are transformed into output content. ```markdown **Input** ```markdown # Section 1 - [Item 1](item-1.md) - [Item 2](item-2.md) # Section 2 - [Item 3](item-3.md) - [Item 4](item-4.md) ``` **Output** ```markdown # Section 1 - [Item 1](#item-1) - [Item 2](#item-2) ## Item 1 ## Item 2 # Section 2 - [Item 3](#item-3) - [Item 4](#item-4) ## Item 3 ## Item 4 ``` ``` -------------------------------- ### Add a Preface Source: https://github.com/abhinav/stitchmd/blob/main/README.md Include a file at the top of the output using the -preface flag. ```bash -preface FILE ``` ```bash cat > generated.txt < EOF stitchmd -preface generated.txt summary.md ``` -------------------------------- ### Include other summary files Source: https://github.com/abhinav/stitchmd/blob/main/README.md Use the image-link syntax to nest sections from another summary file. ```markdown - ![FAQ](faq.md) ``` -------------------------------- ### Create standalone headers Source: https://github.com/abhinav/stitchmd/blob/main/README.md Plain text items act as headers and require a nested list. ```markdown - Introduction - [Overview](overview.md) - [Getting Started](start/install.md) ``` -------------------------------- ### Link local Markdown files Source: https://github.com/abhinav/stitchmd/blob/main/README.md Use standard Markdown links to include local files. ```markdown - [Overview](overview.md) - [Getting Started](start/install.md) ``` -------------------------------- ### Change Directory Source: https://github.com/abhinav/stitchmd/blob/main/README.md Set the base directory for relative paths using -C. ```bash -C DIR ``` ```bash stitchmd -C docs summary.md ``` ```bash ... | stitchmd -C docs - ``` -------------------------------- ### Define section structure Source: https://github.com/abhinav/stitchmd/blob/main/README.md The formal grammar for the summary file structure. ```text File = Section | (SectionTitle Section)+ ``` -------------------------------- ### Read from Stdin Source: https://github.com/abhinav/stitchmd/blob/main/README.md Pipe a summary file directly into stitchmd. ```bash cat summary.md | stitchmd - ``` -------------------------------- ### Validate output with GitHub Action Source: https://github.com/abhinav/stitchmd/blob/main/README.md Use the check mode to ensure the output file is up-to-date. ```yaml uses: abhinav/stitchmd-action@v1 with: mode: check summary: doc/SUMMARY.md output: README.md ``` -------------------------------- ### Update output with GitHub Action Source: https://github.com/abhinav/stitchmd/blob/main/README.md Use the write mode to automatically update the output file. ```yaml uses: abhinav/stitchmd-action@v1 with: mode: write summary: doc/SUMMARY.md output: README.md # Optionally, use https://github.com/stefanzweifel/git-auto-commit-action # to automatically push these changes. ``` -------------------------------- ### Write to File Source: https://github.com/abhinav/stitchmd/blob/main/README.md Redirect output to a specific file. ```bash -o FILE ``` ```bash stitchmd -o README.md summary.md ``` -------------------------------- ### Define sections in a summary file Source: https://github.com/abhinav/stitchmd/blob/main/README.md Sections are defined using Markdown headings to organize content. ```markdown # Section 1 # Section 2 ``` -------------------------------- ### Explicit Page Title via Heading Source: https://github.com/abhinav/stitchmd/blob/main/README.md Shows how to override the default title by placing a level 1 heading at the very top of the file. ```markdown - [Introduction](intro.md) # Introduction to Foo Welcome to Foo. ``` ```markdown - [Introduction](#introduction-to-foo) # Introduction to Foo Welcome to Foo. ``` -------------------------------- ### Add external links Source: https://github.com/abhinav/stitchmd/blob/main/README.md External links are rendered verbatim and cannot contain nested items. ```markdown - [Overview](overview.md) - [Community](https://example.com) ``` -------------------------------- ### Report a Diff Source: https://github.com/abhinav/stitchmd/blob/main/README.md Perform a dry run to see changes without writing to the file. ```bash -d ``` ```bash stitchmd -d -o README.md # ... ``` -------------------------------- ### Offset Heading Levels Source: https://github.com/abhinav/stitchmd/blob/main/README.md Adjust heading levels using the -offset flag. ```bash -offset N ``` ```markdown # User Guide - [Introduction](intro.md) - [Installation](install.md) ``` ```bash stitchmd -offset 1 summary.md ``` ```markdown ## User Guide - [Introduction](#introduction) - [Installation](#installation) ### Introduction ### Installation ``` ```bash stitchmd -offset -1 summary.md ``` ```markdown # User Guide - [Introduction](#introduction) - [Installation](#installation) # Introduction ## Installation ``` -------------------------------- ### Absorbing Headings with Front Matter Source: https://github.com/abhinav/stitchmd/blob/main/README.md Enables pulling headings from an included file into the main summary by setting absorb to true in YAML front matter. ```yaml --- absorb: true --- ``` ```markdown - [Installation](install.md) - [Configuration](config.md) --- absorb: true --- # Configuration ## Adding a new user To add a new user, ... ## Removing a user To remove a user, ... ``` ```markdown - [Installation](#install) - [Configuration](#configuration) - [Adding a new user](#adding-a-new-user) - [Removing a user](#removing-a-user) # Installation # Configuration ## Adding a new user To add a new user, ... ## Removing a user To remove a user, ... ``` -------------------------------- ### Default Page Title Configuration Source: https://github.com/abhinav/stitchmd/blob/main/README.md Demonstrates how stitchmd derives a page title from the summary link text when no explicit heading is provided. ```markdown - [Introduction](intro.md) Welcome to Foo. ``` ```markdown - [Introduction](#introduction) # Introduction Welcome to Foo. ``` -------------------------------- ### Disable Table of Contents Source: https://github.com/abhinav/stitchmd/blob/main/README.md Omit the TOC using the -no-toc flag. ```bash -no-toc ``` ```bash stitchmd -no-toc summary.md ``` ```markdown - [Introduction](intro.md) - [Installation](install.md) ``` ```bash stitchmd -no-toc summary.md ``` ```markdown # Introduction # Installation ``` -------------------------------- ### Heading level adjustment Source: https://github.com/abhinav/stitchmd/blob/main/README.md The section heading level determines the minimum heading level for included documents. ```markdown **Input** ```markdown ## User Guide - [Introduction](intro.md) ``` **Output** ```markdown ## User Guide - [Introduction](#introduction) ### Introduction ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.