getmusicbee.com

Support => Tips and Tricks => Topic started by: hiccup on February 19, 2023, 07:33:01 AM

Title: BBCeditor (forum post edit tool)
Post by: hiccup on February 19, 2023, 07:33:01 AM
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 (https://getmusicbee.com/forum/index.php?topic=38817.msg209676#msg209676)

MusicBee functions for virtual tags cheatsheet (https://getmusicbee.com/forum/index.php?topic=35868.msg196257#msg196257)

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:

(https://i.imgur.com/2Z4SJTe.png)

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 (https://rebrand.ly/BBCe_MB_forum_patch)
- 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:

(https://i.imgur.com/azKeyho.gif)

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)

(https://i.imgur.com/SQrISHw.png)
Title: Re: BBCeditor (forum post edit tool)
Post by: hiccup on February 19, 2023, 07:35:31 AM
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:


(https://i.imgur.com/G64pg0Q.png)


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:

(https://i.imgur.com/AGQQ1CN.png)

______________________________________________________________________________________________



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.


(https://i.imgur.com/6NJcIoA.png)


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:


(https://i.imgur.com/FY11NWJ.png)


______________________________________________________________________________________________



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
Title: Re: BBCeditor (forum post edit tool)
Post by: hiccup on February 19, 2023, 08:49:02 AM
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
Title: Re: BBCeditor (forum post edit tool)
Post by: karbock on February 19, 2023, 05:38:34 PM
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:
A full list of the 141 predefined colours + transparent is available here (https://wiki.chickensmoothie.com/BBCode_Color_and_Theory_(Advanced))  (with explanations).
Title: Re: BBCeditor (forum post edit tool)
Post by: hiccup on February 19, 2023, 06:59:34 PM
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.

(https://i.imgur.com/sdMvzgG.png)
 
Title: Re: BBCeditor (forum post edit tool)
Post by: karbock on February 25, 2023, 10:58:34 AM
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:
Internet links

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

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

NOTES:
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:
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:
Lists

TIPS:

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:

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:
BBcode markers not supported by the forum editor

Non-exhaustive list. Only the most frequent ones in other BBcode variants:
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 (https://getmusicbee.com/forum/index.php?topic=38856.msg210307#msg210307).
Title: Re: BBCeditor (forum post edit tool)
Post by: hiccup on February 26, 2023, 04:22:52 PM
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
Title: Re: BBCeditor (forum post edit tool)
Post by: karbock on February 26, 2023, 05:10:25 PM
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!
Title: Re: BBCeditor (forum post edit tool)
Post by: hiccup on February 26, 2023, 05:44:40 PM
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?...
Title: Re: BBCeditor (forum post edit tool)
Post by: hiccup on February 27, 2023, 08:02:39 PM
updated
Title: Re: BBCeditor (forum post edit tool)
Post by: karbock on March 02, 2023, 11:41:13 AM
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:
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>
Title: Re: BBCeditor (forum post edit tool)
Post by: hiccup on March 05, 2023, 10:29:30 PM
updated

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

See the start post for all information.
Title: Re: BBCeditor (forum post edit tool)
Post by: hiccup on April 27, 2023, 03:09:48 PM
updated
An improvement on the functioning of the 'Abbreviation' button.

How to use: