Autogenerated Table of Contents for Github Markdown or Bear Notes
Project description
Include File
Managing documentation is always challenging.
- Some information ([ex] setting up git command) might comes up in multiple documentation
- Directly link to github url because contents are huge ([ex] jupyter, data files)
- see Link
- Need entire file structure or support multi-language ([ex] python, java)
Usage
- pip install include_file
# .github/workflows/deploy.yml
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: seanhwangg/include-file
with:
globs: ["**/*.md", "**/*.st", "**/*.html"]
path: "./.included-file"
stem: False
validate: True
include: include
link: link
repo: repo
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: deploy
force: true
Flags
glob
Which glob files to embed Default: ["**/*.md", "**/*.st", "**/*.html"]
path
Where to look for embed file Default: ./.include-file/
stem
Use stem of markdown to overwrite path Default: False
- Example: embeds for
REAMD.md
are stored inREADME/embed.txt
validate
Whether to fail CI in case of embed error Default: True
include
Overwrite default include
Default: include
Input
<!-- README.md -->
* List before embed
{% include 'embed.txt' %}
* List after embed
<!-- embed.txt -->
* I am in embed
Result
<!-- README.md -->
* List before embed
* I am in embed
* List after embed
link
Overwrite default link
Default: link
Input
<!-- README.md -->
* List before embed
{% link 'embed.txt' %}
* List after embed
<!-- embed.txt -->
* I am in embed
Result
<!-- REAMD.md -->
* List before embed
\[embed.txt](https://github.com/[user]/[repository]/blob/[]/local.yml)
* List after embed
Gitbook Flags
Note: These are completely optional for Gitbook users
repo
Overwrite default repo
Default: repo
Input
<!-- README.md -->
* List before embed
{% repo 'embed' %}
* List after embed
<!-- embed/embed1.md -->
* I am in embed1
<!-- embed/nested/embed2.md -->
* I am in embed2
Result
<!-- README.md -->
* List before embed
{% tabs %}
{% tab title='embed1.md' %}
* I am in embed1
{% endtab %}
{% tab title='nested/embed2.md' %}
* I am in embed2
{% endtab %}
{% endtabs %}
* List after embed
TOC
Create table of contents Default: None
Input
<!-- SUMMARY.md -->
* [Cloud](cloud/cloud.md)
* [AWS](cloud/aws.md)
* [GCP](cloud/gcp.md)
* [Database](database/database.md)
* [SQL](database/sql.md)
* [SQL Tool](database/sql-tool.md)
* [No SQL](database/nosql.md)
* [Devops](devops/devops.md)
* [CI](devops/ci.md)
* [Docker](devops/docker.md)
* [Git](devops/git.md)
* [Test](devops/test.md)
* [Documentation](devops/documentation.md)
* [Editor](editor/others.md)
* [Vim](editor/vim.md)
* [VScode](editor/vscode.md)
Output
# Table of Contents
## A
### B.md
* [cloud](https://seanhwangg.gitbook.io/tool/cloud/cloud#cloud)
* [service](https://seanhwangg.gitbook.io/tool/cloud/cloud#service)
### aws.md
* [aws](https://seanhwangg.gitbook.io/tool/cloud/aws#aws)
* [ami](https://seanhwangg.gitbook.io/tool/cloud/aws#ami)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
include-file-0.0.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for include_file-0.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d19379c66b00ca07e2ef69ec9316082cd76e92ef434a66dccd4719a32a051deb |
|
MD5 | 84e5488c5a4c2b87b64ba85f9e0799a9 |
|
BLAKE2b-256 | c4d64781bfb0ca93c59cf51d220c8438b6dcf8f054995a2b832d2ab69234c6f7 |