Skip to content

NiklasRosenstein/mksync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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] 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

Changelog

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

About

Automate the upkeep of Markdown files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages