Skip to content

A Python script to convert MS Docs callout syntax to MkDocs Material style callouts.

License

Notifications You must be signed in to change notification settings

chanware/markdown-callout-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Markdown Callout Converter

A Python script to convert Obsidian / MSDocs call-out (aka admonitions or asides) syntax to MkDocs Material style callouts.

Purpose

I write my notes natively in Obsidian but I wanted an effortless way to host some of my markdown notes in a wiki format, which led me to use MkDocs with the Material theme. However, MkDocs uses a different syntax for admonitions:

MkDocs syntax:

!!! note
    This is a note.

Obsidian/MS Docs syntax:

> [!NOTE]
> This is a note.

To maintain the visual aesthetic of callouts in Obsidian, I created a Python script to parse and convert all instances of callouts to the MkDocs format within the MkDocs project folder.

I keep my "live" Obsidian notebook in one location and copy/paste all the contents to the folder where my MkDocs wiki lives, and then I run the script.

Features

  • Converts Obsidian/MS Docs callout syntax (e.g., [!NOTE]) to MkDocs Material style (!!! note)
  • Supports various callout types such as note, warning, info, and more

Usage

  1. Clone the repository:

    git clone https://github.com/YOUR_USERNAME/markdown-callout-converter.git
    cd markdown-callout-converter
  2. Place your Markdown files: Ensure your Markdown files are located in the docs directory.

  3. Run the script:

    python md-preprocessor.py
  4. Build your MkDocs site:

    mkdocs build

Installation

  • Python 3.x
  • MkDocs
  • MkDocs Material

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.

About

A Python script to convert MS Docs callout syntax to MkDocs Material style callouts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages