Skip to content

Commit

Permalink
Adding live example for github actions (#9)
Browse files Browse the repository at this point in the history
* Automated markdown-index Documentation

Co-authored-by: mmiranda <[email protected]>
  • Loading branch information
mmiranda and mmiranda committed Oct 28, 2021
1 parent 1eb560c commit 02b624f
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This is a live example of using the markdown-index in your Github Actions.
# Simply copy it to your own repo and make sure you change the working-directory
name: live-example
on:
pull_request:
push:
branches:
- main
jobs:
markdown-index:
runs-on: ubuntu-latest
defaults:
run:
working-directory: test
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: satackey/[email protected]
continue-on-error: true

- name: Generate Markdown Index
id: markdown-index
run: docker run --rm --volume "$(pwd):/data" ghcr.io/mmiranda/markdown-index:latest --output live-example.md

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated markdown-index Documentation
file_pattern: "**/*.md"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ docker run --rm -it -v /path/to/root/md/files:/data ghcr.io/mmiranda/markdown-in

After running the command, a new markdown file will be created containing a summary of every other file found.

## Github Actions
Yes, you can integrate this tool into your pipeline.

Check the [live-example](.github/workflows/example.yml) for GH Actions and copy it to your own repo!

## Contributing
Contributions, issues, and feature requests are welcome!

Expand Down
44 changes: 44 additions & 0 deletions test/live-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
generated-by: markdown-index
---
# Table of Contents
* [Root Level Markdown](#root-level-markdown)
* [Level 1 Markdown](#level-1-markdown)
* [Level 1.1 Markdown](#level-11-markdown)
* [Level 2 Markdown](#level-2-markdown)
* [this file has a single line](#this-file-has-a-single-line)
* [Level 2 Markdown](#level-2-markdown-1)

# Root Level Markdown {#root-level-markdown}

This is a sample paragraph text for test purpose only. This paragraph will be used as an abstract on the global TOC.

[Read more on the original file...](./README.md)

# Level 1 Markdown {#level-1-markdown}

This is a sample paragraph text for test purpose only. This paragraph will be used as an abstract on the global TOC.

[Read more on the original file...](./folder1/README.md)

## Level 1.1 Markdown {#level-11-markdown}

This is a sample paragraph text for test purpose only. This paragraph will be used as an abstract on the global TOC.

[Read more on the original file...](./folder1/folder11/README.md)

# Level 2 Markdown {#level-2-markdown}

This is a sample paragraph text for test purpose only. This paragraph will be used as an abstract on the global TOC.

[Read more on the original file...](./folder2/README.md)

# this file has a single line {#this-file-has-a-single-line}

[Read more on the original file...](./single-line.md)

# Level 2 Markdown {#level-2-markdown-1}

This is a sample paragraph text for test purpose only. This paragraph will be ignored because we have an ABSTRACT section in the file

[Read more on the original file...](./with-abstract/README.md)

0 comments on commit 02b624f

Please sign in to comment.