Skip to main content

MkDocs plugin to decorate git diff lines

Project description

mkdocs-decodiff-plugin

Overview

This is an MkDocs plugin for decorating Git diff lines.

This program inserts HTML tags into Markdown files to decorate diff lines using git diff output.

decoration-image

How to Use

Install

pip install mkdocs-decodiff-plugin

mkdocs.yml

plugins:
 - decodiff:
      base: main
      dir: docs
      change_list_file: docs/changes.md
  • base:

    Reference for git diff. You can specify a hash, tag name, or branch name.

    git diff {base}
    
  • dir:

    Target directory.

    git diff -- {dir}
    
  • change_list_file:

    Changes list file

change_list_file

Collect change links in this file as a list.

# Changes

<!-- decodiff: Written by decodiff from here -->
## [index.md](index.md)

* [new section](index.md#decodiff-anchor-1)

<!-- decodiff: end -->

The part between the <!-- decodiff: --> tags is generated by decodiff, but the rest can be modified.

# You can change

You can change

<!-- decodiff: Written by decodiff from here -->

This section is overwritten by decodiff

<!-- decodiff: end -->

You can change

NOT supported

  • Changes in a code block
  • Changes in a table
  • Changes in HTML blocks
  • Character unit changes

Behavior

  • Retrieve diff data using git diff
  • Add an HTML tag to each diff line. For example:
    • <span id="decodiff-hunk-1" class="decodiff">text</span>
    • Preserve leading markup, such as headings (#) and bullet points (*)
  • Create a diff list file containing a list of links

LICENSE

MIT License

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_decodiff_plugin-0.0.7.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

mkdocs_decodiff_plugin-0.0.7-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_decodiff_plugin-0.0.7.tar.gz.

File metadata

  • Download URL: mkdocs_decodiff_plugin-0.0.7.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for mkdocs_decodiff_plugin-0.0.7.tar.gz
Algorithm Hash digest
SHA256 5beb4a8ca54cd7ad756364a9e2d1b19065b13da0d0b0abb93fa17bb0b2e8b0a5
MD5 e2de0f9d93b38afb04161f95bdaf6c7e
BLAKE2b-256 6c6e6a8cc4a5b648404a9180bab12dfe983f8046b699f852b1fad3f809f4e41a

See more details on using hashes here.

File details

Details for the file mkdocs_decodiff_plugin-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_decodiff_plugin-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5f2be69efa8be2de7bf7f787c28368a1129bf411c387275ca4c23d6f106070be
MD5 4e2180df362e8777d6430bf94d74f7c4
BLAKE2b-256 7752212d6afb84e9646d469b7d8b46810ec5f8d2c99026573602c138c7e11484

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