You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,15 @@
1
1
[](https://github.com/RedGuides/md2bbcode/actions/workflows/publish.yml)

4
4
5
5
# md2bbcode
6
-
**A wrapper and plugin for [Mistune](https://github.com/lepture/mistune).** It converts GitHub-flavored Markdown to Xenforo-flavored BBCode. Custom BBCodes made for RedGuides are included in `bb_codes.xml`.
6
+
**A wrapper and plugin for [Mistune](https://github.com/lepture/mistune).** It converts most GitHub-flavored Markdown to Xenforo-flavored BBCode.
7
7
8
-
## Installation
8
+
> [!TIP]
9
+
> Custom BBCodes made for RedGuides are included in `bb_codes.xml`, import the ones you want in your Xenforo installation at `admin.php?bb-codes`. Some custom BBCodes include css, which you can split off to your extra.css template for more efficiency.
9
10
10
-
You can install md2bbcode using pip:
11
-
12
-
```bash
13
-
pip install md2bbcode
14
-
```
11
+
> [!NOTE]
12
+
> This project is made with LLM assistance.
15
13
16
14
## Usage
17
15
@@ -62,17 +60,12 @@ If you want to contribute to md2bbcode or set up a development environment, foll
62
60
cd md2bbcode
63
61
```
64
62
65
-
2. Install Hatch, which is used for building and managing the project:
66
-
```bash
67
-
pip install hatch
68
-
```
69
-
70
-
3. Create a development environment and install dependencies:
63
+
2. Create a development environment and install dependencies:
71
64
```bash
72
65
hatch env create
73
66
```
74
67
75
-
4. Activate the development environment:
68
+
3. Activate the development environment:
76
69
```bash
77
70
hatch shell
78
71
```
@@ -87,9 +80,9 @@ The custom plugin for Mistune, which converts AST to bbcode.[^1]
87
80
88
81
### html2bbcode
89
82
90
-
Converts several HTML tags typically allowed in Markdown to BBCode.[^2]
83
+
Converts most HTML tags typically allowed in Github Flavored Markdown to BBCode.[^2]
91
84
92
-
[^2]: Currently used for post-processing mistune output, but there's a better way. See inside the file for a suggestion.
85
+
[^2]: Currently used for post-processing mistune output. Reference: https://github.github.com/gfm/#raw-html
93
86
94
87
```bash
95
88
html2bbcode input_file.html
@@ -105,18 +98,25 @@ md2ast input.md output.json
105
98
106
99
## Features Test
107
100
108
-
Here are a few GitHub-flavored Markdown features so you can use this README.md for testing:
101
+
Here are a few GitHub-flavored Markdown features so you can use this README.md for testing, including the table:
| Link |`[text](url)`|[example](https://example.com)|
110
+
| Superscript |`<sup>2</sup>`| E=mc<sup>2</sup> |
111
+
| Subscript |`<sub>2</sub>`| H<sub>2</sub>O |
109
112
110
-
-**Strikethrough:**~~This text is struck through.~~
111
-
-**Superscript:** This text is normal and this is <sup>superscript</sup>.
112
-
-**Table:**
113
+
<details>
114
+
<summary>HTML spoiler (details/summary)</summary>
113
115
114
-
| Syntax | Description |
115
-
| ----------- | ----------- |
116
-
| Header | Title |
117
-
| Paragraph | Text |
116
+
<b>html2bbcode</b> test. This is hidden content. Water is H<sub>2</sub>O.
118
117
119
-
## Todo
118
+
<fontcolor="red"size="3"face="Arial">Font tag inside details size 3 Arial red</font>
120
119
121
-
- refactor html2bbcode
122
-
- update for new Xenforo 2.3 and 2.4 BBCode
120
+
<spanstyle="color: #27F573; font-size: 12px; font-family: Times New Roman; font-weight: bold; font-style: italic; text-decoration: underlineline-through;">Inline style inside details green times new roman strikethrough italic bold underline</span>
121
+
<blockquotedata-author="John Doe">This is a quote by John Doe</blockquote>
0 commit comments