#convert-markdown #bb-code #command-line #parser #magic #document #fim-fiction

bin+lib fimdoc

Firendship is Magic Document, converts Markdown into FIMFiction BBCode

21 releases (5 breaking)

0.6.0 Apr 15, 2024
0.5.0 Apr 5, 2024
0.4.0 Apr 4, 2024
0.3.4 Apr 4, 2024
0.1.9 Dec 9, 2023

#8 in #convert-markdown

Download history 1/week @ 2024-02-19 9/week @ 2024-02-26 20/week @ 2024-03-11 288/week @ 2024-04-01 22/week @ 2024-04-08 148/week @ 2024-04-15

458 downloads per month

MIT license

16KB
326 lines

Friendship is Magic Document

Converts Markdown into FIMFiction BBCode.

Examples:

Here are examples for how to use the FimDoc executable, and the FimDoc parser library.

Command line use:

Run with an input and an output file:

fimdoc input.md output.txt

Run with stdin and an output file:

md | fimdoc output.txt

Run with an input file and stdout:

fimdoc input.md | bbcode

Run with stdin and stdout:

md | fimdoc | bbcode

Command line options:

FimDoc has the following command line options, only one of which can be provided at a time.

-w | --warn  (default) >> Warns the user in yellow on unsupported markdown syntax.
-f | --fail >> Errors in red before terminating on unsupported markdown syntax.
-q | --quiet >> Ignores and skips over unsupported markdown syntax.

Here are some examples of their use:

fimdoc -q input.md output.txt
md | fimdoc --fail output.txt

Library use:

Run the parse function with the markdown string and WarningType enum.

let md = "# Hello World!".to_string();
let warn = WarningType::Quiet;
let bbcode = parse(md, &warn);
println!("{bbcode}");

Would produce:

[h1]
Hello World!
[/h1]

Dependencies

~1.5MB
~32K SLoC