Skip to main content

Include File

pre-commit

  • While using Gitbook, I faced some challenges below
  1. Some information (ex: setting up git command) might come up in multiple documentation
  2. Organize include contents more intuitively
  3. Need table of contents page of entire gitbook

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 in README/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

  • table_of_contents

    • -toc: Create table of contents with URL ([ex] "", "table_of_contents.md")
  • images_overwrite

    • -images: Overwrite default images ([ex] images)
  • include_overwrite

    • -include: Overwrite default include ([ex] include)
  • link_overwrite

    • -link: Overwrite default link ([ex] link)
  • repo_overwrite

    • -repo: Overwrite default repo ([ex] repo)

Release files for include-file 0.0.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for include-file 0.0.20
File Size Uploaded
include-file-0.0.20.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for include-file 0.0.20
File Interpreter ABI Platform
include_file-0.0.20-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / include-file-0.0.20.tar.gz

Download URL include-file-0.0.20.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cce530536b50a1daf96573d375444608d5d0841a2fcbcb4d4bb31ab6e015ef0c
BLAKE2b-256 checksum
How to use checksums
c2e63bef057ce43eb47797982f4054956a1765d2bd2b7bf7e7e773f46282eb0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / include_file-0.0.20-py3-none-any.whl

Download URL include_file-0.0.20-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
058e433e6835a82cda680cb89aa33df11a370668241bf93873644bf176f20b44
BLAKE2b-256 checksum
How to use checksums
95d8b041489c897a8005e73c7a90265f4438aafc9c60bf8fce942ca631b77ffb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.0.20 This release

2 release files

0.0.19

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page