开源软件名称(OpenSource Name):dineshsonachalam/markdown-autodocs开源软件地址(OpenSource Url):https://github.com/dineshsonachalam/markdown-autodocs开源编程语言(OpenSource Language):JavaScript 74.8%开源软件介绍(OpenSource Introduction):A GitHub Action that automatically generates & updates markdown content (like your README.md) from external or remote files. Ask questions in the GitHub issues Table of contents
Why markdown-autodocsTo make your repo more appealing and useful you need to provide example code snippets in your README.md. Manually copy and pasting each code snippet in their respective places in your README would be inefficient and time-consuming. This problem can be solved using markdown-autodocs a GitHub Action that automatically generates & updates markdown content (like your README.md) from external or remote files. You need to add markers in your README.md that will tell markdown-autodocs where to insert the code snippet. Features
ExamplesCODE BlockGet code from an external file or URL and insert it in your markdown. Options:
Options are concatenated via the JSON to HTML tableGet JSON contents from an external file and convert it into an HTML table and insert's it in your markdown. Options:
Github Workflow Artifacts tableGet the list of the latest artifacts generated from a workflow run. Generates a workflow artifacts table consists of artifacts download and workflow URL in an HTML table and inserts it in your markdown file. Example Repo which uses all the markdown-autodocs featureLocal usage without Github actionInstall markdown-autodocs CLI: npm i -g markdown-autodocs markdown-autodocs CLI usage: dineshsonachalam@macbook ~ % markdown-autodocs --help
Usage: markdown-autodocs [options]
Options:
-o, --outputFilePath <outputFilePaths...> Output file paths
-c, --category <categories...> code-block, json-to-html-table, workflow-artifact-table
-r, --repo <type> Repo name
-b, --branch <type> Branch name
-a, --accessToken <type> Github Access token
-h, --help display help for command
markdown-autodocs -c code-block -o ./README.md
markdown-autodocs -c json-to-html-table -o ./README.md
markdown-autodocs -c workflow-artifact-table -o ./README.md -r $REPO -b $BRANCH -a $ACCESSTOKEN UsageAdding markdown-autodocs in your workflowAdd the following step at the end of your job, after other steps that might add or change files. uses: dineshsonachalam/markdown-autodocs@v1.0.5 Extended example with all possible options available for this Action- name: Markdown autodocs
- uses: dineshsonachalam/markdown-autodocs@v1.0.5
with:
# Optional, defaults to author of the commit that triggered the run
commit_author: Author <actions@github.com>
# Optional, defaults to "actions@github.com"
commit_user_email: actions@github.com
# Optional, but recommended
# Defaults to "Apply automatic changes"
commit_message: Apply automatic changes
# Optional branch name where commit should be pushed to.
# Defaults to the current branch.
branch: feature-123
# Optional output file paths, defaults to '[./README.md]'.
output_file_paths: '[./README.md]'
# Categories to automatically sync or transform its contents in the markdown files.
# Defaults to '[code-block,json-to-html-table,workflow-artifact-table]'
categories: '[code-block,json-to-html-table,workflow-artifact-table]' Github Workflow Artifacts
ContributingUsed By |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论