Converter.MarkdownToBBCodeNM.Tool 1.0.0.17

dotnet tool install --global Converter.MarkdownToBBCodeNM.Tool --version 1.0.0.17
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Converter.MarkdownToBBCodeNM.Tool --version 1.0.0.17
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Converter.MarkdownToBBCodeNM.Tool&version=1.0.0.17
nuke :add-package Converter.MarkdownToBBCodeNM.Tool --version 1.0.0.17

Converter.MarkdownToBBCode

Converts Markdown and HTML (GitHub flavor) into NexusMods and Steam BBCode flavor. Might be opionated with the HTML conversion, since there are a few ways to interpret HTML

Installation

dotnet tool install -g Converter.MarkdownToBBCodeNM.Tool
dotnet tool install -g Converter.MarkdownToBBCodeSteam.Tool

Usage

When installed as a global tool:

# NexusMods
markdown_to_bbcodenm -i "**raw markdown**"
markdown_to_bbcodenm -i "~~raw\r\nmarkdown~~" --disableextended

markdown_to_bbcodenm -i "/markdown.md";
markdown_to_bbcodenm -i "/markdown.md" -o "/bbcode.txt";

# Steam
markdown_to_bbcodesteam -i "**raw markdown**"
markdown_to_bbcodesteam -i "~~raw\r\nmarkdown~~" --disableextended

markdown_to_bbcodesteam -i "/markdown.md";
markdown_to_bbcodesteam -i "/markdown.md" -o "/bbcode.txt";

-i or --input accepts both raw markdown and a file path.
-o or --output accepts a file path. If specified, will write the converted BBCode to the file instead of outputting to the console.
-d or --disableextended will disable newline detection via two spaces and will disable HTML conversion

Example

At the time of writing the tool, it was used to keep in sync the description of the BLSE mod for Bannerlord.
BLSE - GitHubNexusMods

Notes

  • You can ignore an HTML element by adding converter_ignore, converter_nexusmods, converter_steam attribute to the element
    <p converter_ignore>WILL NOT BE CONVERTED TO BBCODE</p>
    <p converter_nexusmods>WILL NOT BE CONVERTED TO BBCODE FOR STEAM</p>
    <p converter_steam>WILL NOT BE CONVERTED TO BBCODE FOR NEXUSMODS</p>
    
  • You can set an alternative href for a link for NexusMods/Steam by adding a nexusmods_href or steam_href attribute to the element
    <a href="MARKDOWN_LINK" nexusmods_href="NEXUSMODS_LINK" /> </a>
    
  • You can set an alternative src for an image for NexusMods/Steam by adding a nexusmods_src or steam_href attribute to the element
    <img src="MARKDOWN_IMAGE" nexusmods_src="NEXUSMODS_IMAGE" />
    

Supporting Codes

GitHub Markdown Supported HTML Codes
Steam Supported BBCode Codes

NexusMods BBCode Steam BBCode Markdown (GitHub) HTML
[b]TEXT[\b] [b]TEXT[\b] **TEXT** <b>TEXT</b>
[i]TEXT[/i] [i]TEXT[/i] *TEXT* <i>TEXT</i>
[u]TEXT[/u] [u]TEXT[/u] <ins>TEXT</ins> OR <u>TEXT</u>
[s]TEXT[/s] [strike]TEXT[/strike] ~~TEXT~~ <s>TEXT</s> OR <strike>TEXT</strike>
[url=URL]TEXT[/url] [url=URL]TEXT[/url] [TEXT](URL) <a href="URL">TEXT</a>
[img]URL[/img] [img]URL[/img] ![Alt text](URL) <img src="URL"></img>
[quote]TEXT[/quote] [quote]TEXT[/quote] > TEXT <blockquote>TEXT</blockquote>
[quote AUTHOR]TEXT[/quote] [quote=AUTHOR]TEXT[/quote] > TEXT
[code]CODE[/code] [code]CODE[/code] ```CODE``` <code>CODE</code>
[list=1][*]ENTRY[/list] [olist][*]ENTRY[/olist] 1. ENTRY <ol><li>ENTRY</li></ol>
[list][*]ENTRY[/list] [list][*]ENTRY[/list] * ENTRY <ul><li>ENTRY</li></ul>
[line] [hr][/hr] <hr/>
[color=COLOR]TEXT[/color]
[font=FONT]TEXT[/font]
[center]TEXT[/center] <p align="center">TEXT</p> OR <div align="center">TEXT</div>
[right]TEXT[/right] <p align="right">TEXT</p> OR <div align="right">TEXT</div>
[left]TEXT[/left] <p align="left">TEXT</p> OR <div align="left">TEXT</div>
[size=1]TEXT[/size] [h6]TEXT[/h6] ###### TEXT <h6>TEXT</h6>
[size=2]TEXT[/size] [h5]TEXT[/h5] ##### TEXT <h5>TEXT</h5>
[size=3]TEXT[/size] [h4]TEXT[/h4] #### TEXT <h4>TEXT</h4>
[size=4]TEXT[/size] [h3]TEXT[/h3] ### TEXT <h3>TEXT</h3>
[size=5]TEXT[/size] [h2]TEXT[/h2] ## TEXT <h2>TEXT</h2>
[size=6]TEXT[/size] [h1]TEXT[/h1] # TEXT <h1>TEXT</h1>
[spoiler]SUMMARY\n\rTEXT[/spoiler] INLINE SPOILERS NOT MAPPED TO HTML <details><summary>SUMMARY</summary>TEXT</details>
[youtube]ID[/youtube] https://www.youtube.com/watch?v=ID [https://www.youtube.com/watch?v=ID](https://www.youtube.com/watch?v=ID)
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.0.17 328 7/30/2023
1.0.0.16 148 7/25/2023
1.0.0.15 189 7/24/2023
1.0.0.14 198 7/24/2023
1.0.0.13 151 7/23/2023
1.0.0.12 153 7/22/2023
1.0.0.11 219 7/22/2023
1.0.0.10 231 7/22/2023
1.0.0.9 200 7/21/2023
1.0.0.8 148 7/21/2023
1.0.0.7 181 7/20/2023
1.0.0.6 132 7/20/2023
1.0.0.5 176 7/20/2023
1.0.0.1 190 7/20/2023