Replace {% include 'file.txt' %} with actual file contents
Project description
Include File
- Managing documentation is challenging as
- Some information ([ex] setting up git command) might come up in multiple documentation
- Hard to edit
- Some files are too large so it's better to put link ([ex] jupyter, data files)
- Need entire file structure or show different instructions per language ([ex] python, java)
Usage
- See before and after in tests folder
make e2etest
Github CI
- This pipeline will push to deploy branch
# .github/workflows/main.yml
name: Deploy to deploy branch with include_file
on:
push:
branches: ["main"]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install include_file
- name: Include File
run: |
python -m include_file -u $GITHUB_ACTOR -y SUMMARY.md -d deploy -t README.md --stem
# For deployment add following lines
- uses: EndBug/add-and-commit@v7
with:
message: "Committed by seanhwangg/include_file"
pull_strategy: NO-PULL
branch: deploy
push: origin deploy --force -u
Flags
-
user
- -u: github user id used for link ([ex] seanhwangg)
-
glob
- -g: Which glob files to include ([ex] "**/*", **/*.md)
-
path
- -p: Where to look for include file ([ex] ./.include-file/)
-
stem
- -s: Use stem of markdown to overwrite path ([ex] False)
- includes for
REAMD.md
are stored inREADME/include.txt
-
validate
- -v: Whether to fail CI in case of include error ([ex] True)
Gitbook Only Flags
Note: These are completely optional for Gitbook users
-
deploy_branch
- -d: Change deploy_branch of gitbook ([ex] "deploy")
-
url_path
- -url: Change url of includes ([ex] https://seanhwangg.gitbook.io/)
-
table_of_contents
- -toc: Create table of contents with URL ([ex] "", "table_of_contents.md")
-
relocate_include
- -r: Relocate images and include files ([ex] None)
-
images_overwrite
- -images: Overwrite default
images
([ex] images)
- -images: Overwrite default
-
include_overwrite
- -include: Overwrite default
include
([ex] include)
- -include: Overwrite default
-
link_overwrite
- -link: Overwrite default
link
([ex] link)
- -link: Overwrite default
-
repo_overwrite
- -repo: Overwrite default
repo
([ex]: repo)
- -repo: Overwrite default
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.17.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for include_file-0.0.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a571d7808777bafc8ee1fc76a7e387f7b68cddafbabaf6ccf4405e4ac43a712c |
|
MD5 | d84570ec3b839daa7ff931001fb9efac |
|
BLAKE2b-256 | c414484671158a0649bc1e4ae99cba49cc27eacfc4b6ebe9f261ad35f7c9b494 |