Skip to main content

A MkDocs plugin to run a Python script before build

Project description

mkdocs-pre-build-script

安装

pip intall mkdocs-pre-build-script

使用

mkdoc.yal 配置

site_name: 我的文档

plugins:
- pre_build_script:
    script:
      - print1.py #可以替换为其他python文件
      - ./src/print2.py

[!tip]

python文件的位置时相对于项目根目录的。

示例

示例项目地址:StudyPavilion/mkdocs_pre_build_script_example: mkdocs_pre_build_script 示例项目

项目结构:

mkdocs_pre_build_script_example
├── docs
│   └── index.md
├── src
│   └── print2.py
├── README.md
├── mkdocs.yml
└── print1.py

编译项目

windows

安装依赖

pip install -r requirements.txt

打包项目

python setup.py sdist bdist_wheel

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_pre_build_script-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_pre_build_script-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_pre_build_script-0.1.0.tar.gz.

File metadata

  • Download URL: mkdocs_pre_build_script-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mkdocs_pre_build_script-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6c96ee7102f69d5d8435a7d98a5ea23990c28e4c32d0e345eb25ad188d0b36cc
MD5 e70ee3e7d472a7b71734f80fe0b93d62
BLAKE2b-256 54964159e95a030a6588994241c012f482075c15c4551dac6efb264215a2a000

See more details on using hashes here.

File details

Details for the file mkdocs_pre_build_script-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_pre_build_script-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 092d9439751d273d629af71152778e2a234ebda974067e5d366f8cde1ae6f3a9
MD5 b885b6610e6e3a7fcfd3f4fe73d25cdb
BLAKE2b-256 bec2d6d8d8d618094637780873f07d4a7d5dc8b73cc517c2a583c1c8697c74ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page