Author Topic: BBCeditor (forum post edit tool)  (Read 3119 times)

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
This one is for forum members that create more lengthy and/or complicated formatted posts.

Everything in this thread has been a result of the joint effort between fellow forum member karbock and me.


______________________________________________________________________________________________



Constructing a formatted post that includes tables, lists, colouring, etc. is usually a lot of work.
Posts like these:

Regular Expressions: coding, examples, testing resources

MusicBee functions for virtual tags cheatsheet

take a lot of time to construct and maintain.

The necessity to go and be online on the forum to check the result of each and every edit is not ideal.
Using this tool takes away the need to go online. You can create, edit and check your post locally, offline before you publish anything.

The tool is called BBCeditor, and I wish I had discovered it some ten years ago.
Ah well, thanks to fellow forum member karbock at least now I have.

The tool hasn't had active maintenance for a couple of years now, and there doesn't seem to be a dedicated website for it, but it shouldn't be hard to find a download for it. The latest version seems to be 1.1.35. (or 1.1.35b, but those seem to be same)

In the left panel you can write and design the post making use of all the usual BBcodes, and in the right panel you can get a preview of how it will look like on the forum.

like this:



Another benefit of this tool is that it makes it easy to store any work-in-progress postings.
Just save them within the tool (they are saved as .bcc files), and open, edit and then post them at any later time.

Note that out-of-the-box, the preview pane on the right does not resemble the MusicBee forum very much.
See below for more information on that.



______________________________________________________________________________________________


Update


As karbock and I found out, out-of-the-box BBCeditor is not completely compatible with the way how the MusicBee forum handles BBcode
It can be made so that it does, but that takes a lot of tweaking.
(as the following posts describe)

So we looked for a way to make this all a lot simpler for other forum members.
And we came up with a simple solution that seems to work very well:
We created some files and folders that contain all that is necessary to update BBCe so that its buttons and functions are fully compatible with our forum.
 
All that is needed is:

- download BBCeditor v1.1.35
- install it wherever you want (it's a portable application)
- download the BBCeditor MusicBee patch here
- extract the rar file
- copy all its files and folders to where you installed BBCeditor (overwriting the existing ones)

that's all

Here's an impression of some things that can be done:



The download also contains  a template forum post (a .bbc file) that has examples of some BBcode markup options such as tables, font colouring, lists with bullet points, etc.  (use 'File > Open' to open it)

Last Edit: March 21, 2023, 04:58:13 PM by hiccup

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
Edit/Update:

Pretty much everything this post contains doesn't have to be performed manually anymore, since the downloadable patch version that karbock and I have constructed and made available for download (see post #1) now contains pretty much all these features by default.

I'll leave it here anyway, since it's probably informative to those who want to extend this button functionality themselves.




______________________________________________________________________________________________



How to create buttons for forum-safe font colours and useful font sizes.


BBCe has dropdown buttons for both font colours and font sizes.
Do not use them:
- The font size presets create code that will not work on the forum.
- The font colour presets contain colours that will be practically unreadable, depending on if a user uses the light or the dark forum theme.

Luckily BBCe has the option to create custom buttons for specific tasks.

Here are the steps to create buttons for forum-safe colours, and for useful font sizes.


______________________________________________________________________________________________



Buttons to set forum-safe font colours

1.
create 16x16px. icons for these buttons.
(or use the ones that are included in the download link that's in the startpost)

2.
place them in the folder: custom_icons

3.
Navigate to: Tools > Settings > Custom buttons

4.
Create a new button using these settings:





Expression:
Code
\[color=#fc0003](.*?)\[/color]
and link the appropriate icon for it using 'Path:'


5.
Create buttons for the other eight colours using:


Code
\[color=#ee8200](.*?)\[/color]
\[color=#bfad00](.*?)\[/color]
\[color=#0093f8](.*?)\[/color]
\[color=#00a300](.*?)\[/color]
\[color=#40c2b9](.*?)\[/color]
\[color=#cd78d6](.*?)\[/color]
\[color=#9e6f00](.*?)\[/color]
\[color=#8f8f8f](.*?)\[/color]

You then should have something like this:



______________________________________________________________________________________________



Buttons to set useful font sizes

As said before, the font sizes that BBCe's default presets button sets are useless for our forum.

This is how to create 4 useful font size buttons that will work nicely on our forum: small, medium, large and extra-large.
(the default font size will sit between small and medium)

The steps to perform are identical to the ones used for the font colours.
Only now the 'Expression' pane needs to be populated with these four expressions:


Code
\[size=1](.*?)\[/size]
\[size=medium](.*?)\[/size]
\[size=x-large](.*?)\[/size]
\[size=6](.*?)\[/size]

This is a selection of font sizes I think are useful for our forum.

But... due to discrepencies between BBcode engines, they will not look correct in BBCe's preview panel.
E.g. when using the forum's "size=1", it will display in a 1px size in the preview pane, making it unreadable.

Therefor an additional 4 buttons need to be created that will adjust the sizes for the preview panel so that they will display there in the same size as they will show up on the forum.
These buttons do not need to be pressed, and will work automatically in the background at every screen refresh (F5).
So there is also no need to create icons for them.

This time also the 'Replacement' pane needs to be populated.





These are the codes:

Code
1.
Expression:     font-size:1px
Replacement:   font-size:9px

2.
Expression:     font-size:medium
Replacement:   font-size:16px

3.
Expression:     font-size:x-large
Replacement:   font-size:24px

4.
Expression:     font-size:6px
Replacement:   font-size:34px


That's it.

You should now have these buttons, and these font sizes available:





______________________________________________________________________________________________



addendum

For those who want to experiment or make tweaks, these are the values I found when testing things, and what I used for the above instructions:


  single digit code  
   use replacement:    
font-size 1font-size:9px
font-size 2useless: identical to default size        
font-size 3font-size:19px
font-size 4font-size:20px
font-size 5font-size:26px
font-size 6font-size:34px
font-size 7font-size:51px

      named code      
pixel size on forum
size=xx-small9
size=x-small10
size=small13  (useless, identical to default size)
size=medium17
size=large18
size=x-large24
size=xx-large33
Last Edit: April 23, 2023, 07:48:11 AM by hiccup

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
I have a question myself about a feature of BBCeditor:
It is possible to create 'buttons' that can modify content in the left panel...
But there is one thing I don't understand and can't get to work...


never mind, pretty much solved
Last Edit: March 01, 2023, 06:08:39 PM by hiccup

karbock

  • Sr. Member
  • ****
  • Posts: 320
Forum-friendly colour sets

As mentioned above by hiccup, the forum post editor features a preselection of 9 colours. Two alternative sets are also shown here. The first one features colours having predefined names in BBcode. All the sets are suitable with both the light and the dark theme.

Forum's setAlternative set 1Alternative set 2
Colour typeHex. codeN/AColour typeHex. codeBBcode colour nameColour typeHex. codeN/A
██ bluecolor=#0093F8██ bluecolor=#6495EDcolor=CornFlowerBlue██ bluecolor=#208CF3
██ browncolor=#9E6F00██ browncolor=#D2691Ecolor=Chocolate██ browncolor=#8F7200
██ cyancolor=#40C2B9██ cyancolor=#20B2AAcolor=LightSeaGreen██ cyancolor=#40C2B9
██ graycolor=#8F8F8F██ graycolor=#778899color=LightSlateGray██ graycolor=#8A8A8A
██ greencolor=#00A300██ greencolor=#32CD32color=LimeGreen██ greencolor=#14A31B
██ khakicolor=#BFAD00██ khakicolor=#DAA520color=GoldenRod██ khakicolor=#BFAD00
██ orangecolor=#EE8200██ orangecolor=#FF8C00color=DarkOrange██ orangecolor=#DB720F
██ redcolor=#FC0003██ redcolor=#FF6347color=Tomato██ redcolor=#DE201D
██ violetcolor=#CD78D6██ violetcolor=#DA70D6color=Orchid██ violetcolor=#A852F2

Usage:
  • Alternative colour set 1:
    Colourise your text by specifying either the matching hexadecimal code or the BBcode colour name.
  • Forum's colour set and Alternative set 2:
    Colourise your text by specifying the hexadecimal code only.
A full list of the 141 predefined colours + transparent is available here  (with explanations).
Last Edit: July 24, 2023, 06:10:50 PM by karbock

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
Below, a selection of named colours suitable for both forum themes (dark and light).
Nice selection.
I have added a 'forum-safe colours.bbc' template to the download.
It will make it easy to preview the colours and copy/paste the hex codes.


 
Last Edit: February 20, 2023, 06:36:22 PM by hiccup

karbock

  • Sr. Member
  • ****
  • Posts: 320
BBcode for the Forum Post Editor

BBcode is the formatting language used by many forums on the internet, but it is not completely standardised.
This post presents the subset used by the MusicBee forum editor.

Table of contents
  • Character styles
  • Internet links
  • Paragraphs
  • Code
  • Quote
  • Tables
  • Lists
  • BBcode markers not supported by the forum editor
  • BBCeditor markers not supported by the forum editor

Character styles

FunctionMarkerExampleResult
Bold[b]...[/b]Regular / [b]Bold[/b]Regular / Bold
Italic[i]...[/i]Regular / [i]Italic[/i]Regular / Italic
Underline[u]...[/u]Regular / [u]Underline[/u]Regular / Underline
Monospace[tt]...[/tt]Regular / [tt]Monospace[/tt] Regular / Monospace
Strikethrough[s]...[/s]Regular / [s]Strikethrough[/s]Regular / Strikethrough
Superscript[sup]...[/sup]Regular / [sup]Superscript[/sup]Regular / Superscript
Subscript[sub]...[/sub]Regular / [sub]Subscript[/sub]Regular / Subscript
Size (with name)[size=...]...[/size]Regular / [size=xx-small]xx-small[/size]
Regular / [size=x-small]x-small[/size]
Regular / [size=small]small[/size]
Regular / [size=medium]medium[/size]
Regular / [size=large]large[/size]
Regular / [size=x-large]x-large[/size]
Regular / [size=xx-large]xx-large[/size]
Regular / xx-small
Regular / x-small
Regular / small
Regular / medium
Regular / large
Regular / x-large
Regular / xx-large
Size (with number)*[size=...]...[/size]Regular / [size=1]size=1[/size]
Regular / [size=2]size=2[/size]
Regular / [size=3]size=3[/size]
Regular / [size=4]size=4[/size]
Regular / [size=5]size=5[/size]
Regular / [size=6]size=6[/size]
Regular / [size=7]size=7[/size]
Regular / size=1
Regular / size=2
Regular / size=3
Regular / size=4
Regular / size=5
Regular / size=6
Regular / size=7
Colour (with hexa code)*[color=#hexa6]...[/color]Regular / [color=#FF8C00]Text in DarkOrange[/color]Regular / Text in DarkOrange
Colour (with name)*[color=ColourName]...[/color]Regular / [color=DarkOrange]Text in DarkOrange[/color]Regular / Text in DarkOrange

NOTES:
  • Sizes with numbers (1..7) are possible in BBCeditor with the patch (see 1st post of the thread).
  • Forum-friendly colour sets are proposed here.

Internet links

FunctionMarkerExampleResult
Weblink[url]...[/url][url]https://getmusicbee.com/forum/[/url]
https://getmusicbee.com/forum/
Weblink (named)[url=...]...[/url][url=https://getmusicbee.com/forum/]
MusicBee Forum
[/url]

MusicBee Forum

Image[img]...[/img][img]https://getmusicbee.com/img/musicbee.png[/img]
Image (clickable)[url=...]
[img]...[/img]
[/url]
[url=https://getmusicbee.com/img/musicbee.png]
[img]https://getmusicbee.com/img/musicbee.png[/img]
[/url]
Image (resized)*[img width=...]
...
[/img]
[img width=30]https://getmusicbee.com/img/musicbee.png[/img]
[img height=...]
...
[/img]
[img height=50]https://getmusicbee.com/img/musicbee.png[/img]
[img width=... height=...]
...
[/img]
[img width=30 height=50]https://getmusicbee.com/img/musicbee.png[/img]

NOTES:
  • The syntax for image resizing on the forum is not natively supported by BBCeditor, but you can encode it. See this post.

Paragraphs

FunctionMarkerExampleResult
Alignment[left]...[/left]
[center]...[/center]
[right]...[/right]
[left]Text[/left]
[center]Text[/center]
[right]Text[/right]
Text
Text
Text
Line break*[br]Line 1[br]Line 2Line 1
Line 2
Scrolling text[move]...[/move][move]Don't forget![/move]Don't forget!
Unparsed BBcode[nobbc]...[/nobbc]This post uses [nobbc]...[/nobbc] for each example.
Preformatted text*[pre]...[/pre][pre][color=DarkBlue]What's up, [b]Doc[/b]?[/color][/pre]
What's up, Doc?
Info bubbles*[abbr="..."]...[/abbr]file extension: [abbr="Free Lossless Audio Codec"].flac[/abbr]file extension: .flac
[acronym="..."]...[/acronym]file extension: [acronym="MPEG-4 audio file"].m4a[/acronym]file extension: .m4a

NOTES:
  • Marker nobbc is ignored by BBCeditor, thus simply displayed as it is. No solution found yet.
  • Markers br, pre, abbr and acronym are not natively supported by BBCeditor. abbr is available in the patch (see 1st post of the thread).
    To encode the others, see this post.
  • Preformatted text = monospace + stand-out background. When using it within a table, set a text colour such as DarkBlue, otherwise the text will be almost unreadable in the dark forum theme. That is not necessary outside a table: there, the display comes in two flavours according to the forum theme, both being easily readable.

Code

[code]
$title = "${movement_no}. ${movement_name}";
[/code]

will produce:

Code
$title = "${movement_no}. ${movement_name}";

Quote

Without custom title

[quote]
Inspiration does exist, but it must find you working. (Pablo Picasso)
[/quote]


will produce:
Quote
Inspiration does exist, but it must find you working. (Pablo Picasso)

With author's name

[quote=Eleanor Roosevelt]
When you give joy to other people, you get more joy in return. You should give a good thought to happiness that you can give out.
[/quote]


will produce:
Quote from: Eleanor Roosevelt
When you give joy to other people, you get more joy in return. You should give a good thought to happiness that you can give out.

With author's name, link and timestamp

[quote author=hiccup link=topic=38856.0 date=1676791981]
Another benefit of this tool is that it makes it easy to store any work-in-progress postings.
[/quote]


will produce:
Another benefit of this tool is that it makes it easy to store any work-in-progress postings.

Tables

Table, row and cell markers

Code
[table]...[/table] encloses the table definition
[tr]...[/tr]       encloses each table row
[td]...[/td]       encloses each cell of a table row

Example

Code
[table]
[tr]
[td][color=LightSeaGreen][b]H1[/b][/color][/td]
[td][color=LightSeaGreen][b]H2[/b][/color][/td]
[td][color=LightSeaGreen][b]H3[/b][/color][/td]
[td][color=LightSeaGreen][b]H4[/b][/color][/td]
[/tr]
[tr]
[td][color=CornFlowerBlue]A1[/color][/td]
[td]A2[/td]
[td]A3[/td]
[td]A4[/td]
[/tr]
[tr]
[td][color=CornFlowerBlue]B1[/color][/td][td]B2[/td][td]B3[/td][td]B4[/td]
[/tr]
[/table]
will produce:

H1H2H3H4
A1A2A3A4
B1B2B3B4

NOTES:
  • th (table header) is not supported by the forum editor.
  • code and quote inserts in table cells are not supported by the forum editor.
  • Nested tables (a table within a table cell) are parsed correctly by the forum editor, but misinterpreted by BBCeditor.

Lists

TIPS:
  • Markers *, o and x are easier to use.
    They do not require a closing marker, but they must start a line.
  • Use item markers li and /li if you want to include line breaks into your list items.
  • Except for a Default list, do not use the list button of BBCeditor, since the special list markers of that application are not recognised by the forum editor. Instead, create in BBCeditor your own snippets (or custom buttons) using the markers described below.

Lists with single item markers (* o x)

FunctionMarkerExampleResult
Bulleted list: disc*[list]
[*]
[/list]
List 1:[list]
[*] first item
[*] second item
[/list]
List 1:
  • first item
  • second item
Bulleted list: circle*[list]
[o] or [O]
[/list]
List 1:[list]
[o] first item
[o] second item
[/list]
List 1:
  • first item
  • second item
Bulleted list: square*[list]
[x] or [+] or [#]
[/list]
List 1:[list]
[x] first item
[x] second item
[/list]
List 1:
  • first item
  • second item
Nested lists*[list]
[*]
[list]
[o]
[list]
[x]
[/list]
[/list]
[/list]
Nested lists:
[list]
[*] 1
[*] 2
[*] 3
[list]
[o] 3.1
[o] 3.2
[/list]
[*] 4
[list]
[o] 4.1
[list]
[x] 4.1.1
[/list]
[/list]
[*] 5
[/list]
Nested lists:
  • 1
  • 2
  • 3
    • 3.1
    • 3.2
  • 4
    • 4.1
      • 4.1.1
  • 5

Lists with double item markers (li ... /li)

NOTE:
  • Each list definition specifying the type (list type=...) requires double item markers: li and /li. See the first table row for a model.

FunctionMarker
Bulleted list[list]
[li]item 1[/li]
[li]item 2[/li]
[/list]
Bulleted list: disc*[list type=disc]
Bulleted list: circle*[list type=circle]
Bulleted list: square*[list type=square]
Alphabetic list*[list type=lower-alpha]
[list type=upper-alpha]
Numbered list*[list type=decimal]
Roman numerals*[list type=lower-roman]
[list type=upper-roman]
Non-bulleted list*[list type=none]

NOTES:
  • Special bullet types (circle, square) and special list types (alphabetic, decimal, roman) are not natively supported BBCeditor, but are available with the patch (see 1st post of this thread).
  • Do not mix codes * and li.../li in the same list: they are treated as items of the same level by BBCeditor, whereas they will show as nested lists on the forum.
  • A list definition enclosed in color.../color markers is misinterpreted by the forum editor.
  • When defining nested lists, it is best to use different bullet markers (*, o, +) to differentiate them in your BBcode script.
  • The forum editor does not recognise nested lists using li.../li.

BBcode markers not supported by the forum editor

Non-exhaustive list. Only the most frequent ones in other BBcode variants:
  • th: table header
  • h1, h2, h3, ...: text header levels
  • hr: horizontal line
  • spoiler: button to reveal hidden text
  • shadow: character style
  • glow: character style
BBCeditor markers not supported by the forum editor

The following list features are defined by other markers in the forum editor. See also this post.
  • list=1: list, numbered
  • list=a: list, alphabetic, lowercase
  • list type=z: list, alphabetic, lowercase
  • list type=A: list, alphabetic, uppercase
  • list type=I: list, roman numbers, uppercase
  • list type=i: list, roman numbers, lowercase
Last Edit: May 21, 2023, 04:37:39 PM by karbock

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
The .css styles were updated.
Also I have found a solution for the discrepancy between BBCeditor's and the forum's font size handling.
See post #2

karbock

  • Sr. Member
  • ****
  • Posts: 320
The .css styles were updated.
Also I have found a solution for the discrepancy between BBCeditor's and the forum's font size handling.
See post #2
Hat tip!

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
Hat tip!
Thanks!
The solution now looks rather simple, but I had headaches first trying out all sorts of BBCode > HTML, and regex stuff that sometimes completely failed, sometimes seemed to work, but only under some circumstances, or even fatally crashed BBCe.

It's really a pity there is no help file, nor a tutorial on how this expression/replacement button stuff is supposed to work exactly.
I couldn't even figure out the purpose, workings and differences between Command > Single tag (i.e. hr) and Double tag (i.e. code).
These smart coders should really make an effort sometimes to place themselves in the minds of mortal end-users...

edit:
In case other users dare to explore this expression/replacement functionality, perhaps it is of some use for me to share why (I think)  many of my earlier attempts failed.
I started with entering complete HTML replacement strings into the replacement panel.
Such as e.g.: <span style="font-size:4px;"> </span><span style="font-size:20px;">$1</span>
(and dozens of variations on that :-(
But for the purpose of these particular buttons, no HTML code seems to be needed at all.
It seems to only replace parts within the HTML code that the preview panel is already using.
I'm quite a bit out of my depth here, but maybe this provides some insight to others attempting to use this functionality.
And then come up with some other useful button ideas?...
Last Edit: February 26, 2023, 06:48:08 PM by hiccup

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
updated
  • post #2 was changed into a comprehensive 'HowTo' create custom buttons to set font colours and font sizes
  • icons that can be used for custom buttons for font sizes and colours were added to the download
  • both the light and dark MusicBee forum styles were updated (thanks karbock)

karbock

  • Sr. Member
  • ****
  • Posts: 320
Implementing forum-specific markers in BBCeditor

Some forum markers are not natively supported by BBCeditor (or their syntax differs),
but you can 'teach' BBCeditor to recognise them.

Steps:
  • Start BBCeditor
  • Menu Tools /Settings, tab Custom buttons
  • For each row of the table below that you wish to incorporate into BBCeditor:
    • Click on button +
    • Select Regular expression
    • For Expression and Replacement, copy/paste the matching cell contents
  • Validate with OK.
This was made possible thanks to hiccup's insight into the (undocumented) replacement feature of BBCeditor.

Forum_editor_marker_(NOT_in_BBCeditor)BBCeditor's_native_equivalentExpression:Replacement:
[br]N/A\[br]<br>
[pre]...[/pre]N/A\[pre](.*?)\[/pre]<pre>$1</pre>
[abbr="..."]...[/abbr]
[acronym="..."]...[/acronym]
N/A
N/A
\[(abbr|acronym)="(.*?)"](.*?)\[/\1]<$1 title="$2">$3</$1>
[o] or [O]N/A\[[oO]](.*?)<li type="circle">$1</li>
[x] or [+] or [#]N/A\[[x+#]](.*?)<li type="square">$1</li>
[list type=disc]
[list type=circle]
[list type=square]
[list type=decimal]
[list type=lower-alpha]
[list type=upper-alpha]
[list type=lower-roman]
[list type=upper-roman]
[list type=none]
N/A
N/A
N/A
[list type=1] or [list=1]
[list type=z] or [list=a]
[list type=A]
[list type=i]
[list type=I]
N/A
\[list type=(disc|circle|square|none|decimal|lower-alpha|upper-alpha|lower-roman|upper-roman)\]<ul style="list-style-type:$1;">
[img width=...] or
[img height=...]
[img=...x]
[img=x...]
\[img (width|height)=([0-9]*)](.*?)\[/img]<img class="image" src="$3" $1="$2">
[img width=... height=...][img=...x...]\[img (width|height)=([0-9]*) (width|height)=([0-9]*)](.*?)\[/img]<img class="image" src="$5" $1="$2" $3="$4">
[font=...][/font]N/A\[font=(.*?)](.*?)\[/font]<font face="$1">$2</font>
Last Edit: May 17, 2023, 10:32:07 AM by karbock

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
updated

The download now contains a complete 'make BBCe MusicBee forum compatible' patch.

See the start post for all information.

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
updated
An improvement on the functioning of the 'Abbreviation' button.

How to use:
  • type the full word that you want to use an abbreviation for
  • select that word
  • press the ABR button
  • replace XXX with the letters of the desired abbreviation