https://github.com/afnanenayet/mdfmt-deprecated
The original rust prototype
https://github.com/afnanenayet/mdfmt-deprecated
formatter markdown parser rust
Last synced: 5 months ago
JSON representation
The original rust prototype
- Host: GitHub
- URL: https://github.com/afnanenayet/mdfmt-deprecated
- Owner: afnanenayet
- Created: 2019-07-21T23:53:19.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-28T14:42:32.000Z (over 3 years ago)
- Last Synced: 2026-01-20T18:53:23.862Z (5 months ago)
- Topics: formatter, markdown, parser, rust
- Language: Rust
- Homepage:
- Size: 112 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: docs/README.md
Awesome Lists containing this project
README
# mdfmt
[](https://dev.azure.com/afnanenayet/mdformat/_build/latest?definitionId=5&branchName=master)
## Synopsis
This is a Markdown formatting tool that takes valid markdown files and outputs
well formatted Markdown files. It uses the
[comrak](https://github.com/kivikakk/comrak) parsing library to create an AST
from your markdown file, then formats as necessary.
Example input:
```
# test
And on the first day, God created Markdown files and let us run wild. People wrote markdown files with no regard for line widths and whatnot.
* Even with lists, people write toooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo much
* Let's add some depth to this list
And why not a page break?
---
* second list
[link](example.com)
I hate indented code blocks by the way, or really anything that depends on whitespace.
#include "stdio.h"
int main(void) {
return 0;
}
```
Output:
# test
And on the first day, God created Markdown files and let us run wild. People
wrote markdown files with no regard for line widths and whatnot.
* Even with lists, people write
toooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
much
* Let’s add some depth to this list
And why not a page break?
---
* second list [link](example.com)
I hate indented code blocks by the way, or really anything that depends on
whitespace.
```
#include "stdio.h"
int main(void) {
return 0;
}
```
_NOTE: This formatter is alpha stage software and not all markdown elements properly
work with the formatter._
## Configuration
There are several options you can configure when using this tool.
Options:
* Max line width (`line-width`): The maximum allowed line width for the output
file. Defaults to 80.
* List delimiter (`list-delim`): The symbol used to denote a list (either `-`
or `*`). Defaults to `*`.
* Indent width (`indent-width`): How many spaces to use for indentation.
Defaults to 4.
## Development
This app is tested against Rust stable. You can build it using Cargo.