Skip to main content

mksync

MkSync replaces directives in a Markdown file with corresponding content. It's a useful tool to add nice features to your project's README.md file, such as a table of contents, without the manual upkeep.

Example

Say this is your README.md:

# My Project

<!-- toc -->

## Installation

## Documentation

Then running mksync README.md will update the file in-place to:

# My Project

<!-- toc -->
* [Installation](#installation)
* [Documentation](#documentation)
<!-- end toc -->

## Installation

## Documentation

Available Directives

  • toc or table of contents: Produce an unordered list of links to all headers in the document after the directive.
  • include <path>: Include the contents of the file at the given path. You can optionally specify a language name to wrap the content in a code block, e.g. include code:python <path>.
  • runcmd <command>: Run the given command and include the output in the document. You can optionally specify a language name to wrap the output in a code block, e.g. runcmd code:python <command>.

Synopsis

usage: mksync [-h] [--inplace] [--verbose] [--change-dir] file

MkSync is a utility to update Markdown files in-place to automate some common upkeep tasks, such as inling
example code and updating table of contents.

positional arguments:
  file              the file to process

options:
  -h, --help        show this help message and exit
  --inplace, -i     update the file in-place
  --verbose, -v     enable verbose logging
  --change-dir, -c  change into parent directory of the file

Changelog

0.1.6 (2025-07-31)

TypeDescriptionPRIssuesAuthor
Fix

Fix using correct filename when --change-dir,-c is used

@NiklasRosenstein

0.1.5 (2025-07-31)

TypeDescriptionPRIssuesAuthor
Hygiene

Use Uv and Tire instead of Slap and manual config of Mypy, Black, Flake8, isort, Pycln

2@NiklasRosenstein
Fix

The toc directive no longer considers # in the middle of the line

2@NiklasRosenstein
Feature

add --change-dir,-c option

2@NiklasRosenstein
Improvement

log failing runcmd executions

2@NiklasRosenstein
Improvement

Upgrade to python-adjudicator>=0.5.1,<0.6

2@NiklasRosenstein

0.1.4 (2023-06-29)

TypeDescriptionPRIssuesAuthor
Fix

Fix placement of code block when rendering include directive back into the Markdown file.

@NiklasRosenstein
Improvement

Keep the same keyword that was used for the TOC directive, which can be one of toc and table of contents

@NiklasRosenstein

0.1.3 (2023-06-29)

TypeDescriptionPRIssuesAuthor
Fix

Fix parsing of include directives

@NiklasRosenstein

Metadata

Release files for mksync 0.1.6

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

Source distribution (sdist)

Source distribution for mksync 0.1.6
File Size Uploaded
mksync-0.1.6.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mksync 0.1.6
File Interpreter ABI Platform
mksync-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / mksync-0.1.6.tar.gz

Download URL mksync-0.1.6.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
74f9c3f50fbec2966d125010314d9a4a266adcf29c40634a517527006e1a539a
BLAKE2b-256 checksum
How to use checksums
66d3aae722676afb7103b6c627987085741cc85c263e50635f1887c8d552caa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / mksync-0.1.6-py3-none-any.whl

Download URL mksync-0.1.6-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3646be17da6b5290c5f3793a8736754870310bf7f8112fb225acf599a0d8d051
BLAKE2b-256 checksum
How to use checksums
abff0adbcecfc506b74672664c5776f23b927717038daad69fbf60ca30e00f7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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