Metadata-Version: 2.4
Name: mksync
Version: 0.1.6
Project-URL: Bug Tracker, https://github.com/NiklasRosenstein/mksync/issues
Project-URL: Repository, https://github.com/NiklasRosenstein/mksync
Author-email: Niklas Rosenstein <rosensteinniklas@gmail.com>
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: python-adjudicator<0.6,>=0.5.1
Description-Content-Type: text/markdown

# 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.

<!-- table of contents -->
  * [Example](#example)
  * [Available Directives](#available-directives)
  * [Synopsis](#synopsis)
* [Changelog](#changelog)
  * [0.1.6 (2025-07-31)](#016-2025-07-31)
  * [0.1.5 (2025-07-31)](#015-2025-07-31)
  * [0.1.4 (2023-06-29)](#014-2023-06-29)
  * [0.1.3 (2023-06-29)](#013-2023-06-29)
<!-- end table of contents -->

## Example

Say this is your `README.md`:

```md
# My Project

<!-- toc -->

## Installation

## Documentation
```

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

```md
# 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

<!-- runcmd code: mksync --help -->
```
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
```
<!-- end runcmd -->

---

# Changelog

<!-- runcmd slap changelog format --all --markdown -->
## 0.1.6 (2025-07-31)

<table><tr><th>Type</th><th>Description</th><th>PR</th><th>Issues</th><th>Author</th></tr>
  <tr><td>Fix</td><td>

Fix using correct filename when `--change-dir,-c` is used</td><td></td><td></td><td>@NiklasRosenstein</td></tr>
</table>

## 0.1.5 (2025-07-31)

<table><tr><th>Type</th><th>Description</th><th>PR</th><th>Issues</th><th>Author</th></tr>
  <tr><td>Hygiene</td><td>

Use Uv and Tire instead of Slap and manual config of Mypy, Black, Flake8, isort, Pycln</td><td><a href="https://github.com/NiklasRosenstein/mksync/pull/2">2</a></td><td></td><td>@NiklasRosenstein</td></tr>
  <tr><td>Fix</td><td>

The `toc` directive no longer considers `#` in the middle of the line</td><td><a href="https://github.com/NiklasRosenstein/mksync/pull/2">2</a></td><td></td><td>@NiklasRosenstein</td></tr>
  <tr><td>Feature</td><td>

add `--change-dir,-c` option</td><td><a href="https://github.com/NiklasRosenstein/mksync/pull/2">2</a></td><td></td><td>@NiklasRosenstein</td></tr>
  <tr><td>Improvement</td><td>

log failing runcmd executions</td><td><a href="https://github.com/NiklasRosenstein/mksync/pull/2">2</a></td><td></td><td>@NiklasRosenstein</td></tr>
  <tr><td>Improvement</td><td>

Upgrade to `python-adjudicator>=0.5.1,<0.6`</td><td><a href="https://github.com/NiklasRosenstein/mksync/pull/2">2</a></td><td></td><td>@NiklasRosenstein</td></tr>
</table>

## 0.1.4 (2023-06-29)

<table><tr><th>Type</th><th>Description</th><th>PR</th><th>Issues</th><th>Author</th></tr>
  <tr><td>Fix</td><td>

Fix placement of code block when rendering `include` directive back into the Markdown file.</td><td></td><td></td><td>@NiklasRosenstein</td></tr>
  <tr><td>Improvement</td><td>

Keep the same keyword that was used for the TOC directive, which can be one of `toc` and `table of contents`</td><td></td><td></td><td>@NiklasRosenstein</td></tr>
</table>

## 0.1.3 (2023-06-29)

<table><tr><th>Type</th><th>Description</th><th>PR</th><th>Issues</th><th>Author</th></tr>
  <tr><td>Fix</td><td>

Fix parsing of `include` directives</td><td></td><td></td><td>@NiklasRosenstein</td></tr>
</table>
<!-- end runcmd -->
