MarkdownToBBCode

What other productivity software are you working with...
Post Reply
Raf
Posts: 139
Joined: 31 Jul 2024 15:34

MarkdownToBBCode

Post by Raf »

When I was writing changelogs for my QuickSwitch project, I needed to convert them from Markdown markup language to BBcode markup language for posting on forums.

That is how this converter was developed: https://github.com/JoyHak/MarkdownToBBCode#markdown

It was successfully tested on the latest complex changelog.
Here's the list of key features:
  • Full support for GitHub syntax (basic and advanced).
  • Recursive syntax conversion (lists containing lists, basic syntax containing basic syntax, etc.).
  • Support for any type of list (ordered, unordered, with any prefix and nesting level).
  • Attaching/detaching markdown list items from BBcode lists (ability to add or detach quotes and other items from the converted list).
  • Support for multi-level quotes with the ability to include lists, mentions, and other syntax.
  • Support for html tags and spoilers.
  • Delete comments, mark text that does not need to be converted.
  • Select a repository for converting Github issues, links, and commits.
  • Restore text to its pre-conversion state for editing.
  • Convert, copy, and clear with a single click.
  • Convert file and save result to the new / existing file.
  • Command line interface (CLI) for converting different files and combining their contents into a single file.
4.png
4.png (116.22 KiB) Viewed 22534 times
The converter uses the Maple Mono font for GUI elements. If something is not working for you, please let me know. If you think that app can be improved, write to me.
See detailed examples here.
1 (4).png
1 (4).png (164.45 KiB) Viewed 22534 times
2 (3).png
2 (3).png (226.54 KiB) Viewed 22534 times
The command line interface allows you to convert files and any text directly from the terminal. The result can be saved to a file or printed to the terminal and passed to any command using the | pipe operator.

Usage: md2bb (<file_name> | <text> | @listfile) [<parameters> <switches>]


Parameters
-save, -write The name / path of the file where to write the result. The result will be appended at the end of the file if it already exists.
-repo, -repository, -domain Url to the repository for resolving relative links and references.
-sep, -separator, -delimiter Separator for text parameters concatenation.


Switches
-h, -help Displays help message.
-overwrite Overwrite the file where to write the result.


Parameters order doesn't matter:

Code: Select all

    md2bb -save 'forum.md' 'readme.md'
    md2bb 'readme.md' -save 'forum.md'
Parameters prefix can be / - --.
Parameter without prefix will be treated as file name / text / listfile to convert:

Code: Select all

    md2bb 'readme.md' 'add text' '@listfile.md'
    Reads and converts contents of 'readme.md', then converts 'add text', then reads and converts contents of 'listfile.md' line by line.
You can combine converted text or file content into a single file. Also you can convert text and files a single usage. See CLI examples here.

Post Reply