LoginLogin

More/Better Options in Code Tags

Root / Site Discussion / [.]

RouseauCreated:
I think it would be really nice to have simple bbcodes set to the default text colors in SmileBASIC. I say "in Code Tags" in the title but I suppose it wouldn't matter if they worked outside of them or not. I don't actually know if there are working color tags yet (we're about to find out), but this is what I use to represent the eight default colors on my PC: [color=#FFFFFF]TEXT[/color] We wouldn't need a code for this. [color=#DC9696]NUMERIC[/color] [color=#7F7F7F]STRING[/color] [color=#6469B9]STATEMENT[/color] [color=#96B4DC]KEYWORD[/color] [color=#05AF4B]COMMENT[/color] [color=#E66423]LABEL[/color] [color=#000000]BACK[/color] We also wouldn't need a code for this. Remembering all of that and typing them out every time would be a pain... but I think it would be nice to do it since I think it would make the code easier to read. We would have to come up with something that wouldn't interfere with the existing SmileBASIC code, though. I have an idea on that front. Here's that again, also nested in a code tag just to see what happens:
[color=#FFFFFF]TEXT[/color] [no code]
[color=#DC9696]NUMERIC[/color] [1c]1c[/1c]
[color=#7F7F7F]STRING[/color] [2c]2c[/2c]
[color=#6469B9]STATEMENT[/color] [3c]3c[/3c]
[color=#96B4DC]KEYWORD[/color]  [4c]4c[/4c]
[color=#05AF4B]COMMENT[/color]  [5c]5c[/5c]
[color=#E66423]LABEL[/color]  [6c]6c[/6c]
[color=#000000]BACK[/color][no code]
Also, do special characters from SmileBASIC show up in the code tags? Can I type in Japanese in there? All of that would be pretty useful. Here's another test:
KY$[1]="๎‰ฅ":KY$[2]="๎‰ค":KY$[3]="๎‰ฌ":KY$[4]="๎‰ฆ"
 KY$[5]="๎‰ซ":KY$[6]="๎‰ญ":KY$[8]="๎‰จ":KY$[10]="๎‰ฎ"
TALK "ใƒ‘ใƒผใƒ•ใ‚งใƒƒ"
For that (on PC, at least) I go UTF-8 with the SMILEBASIC font that SmileBoom supplies. It works pretty well there. Time to see how much of this works, though... Which reminds me: A post preview feature would be amazing. EDIT: Hey! Two out of three ain't half bad... It's one third bad. So... color tags. I'm beggin' ya.

Automatic syntax highlighting is a thing we want to do, just under the "after more important features" category like all the others~ Preview might happen eventually too, you'll have to live without it for now though >~<

Disappointing as that may be, I'm sure I will find a way to persevere. Regardless, I left off the topic's question mark just in case. For now, It looks like we do still have some additional options. I'm going to paste all of the "special characters" in these code tags. I'll come back and edit this when I know which ones work. There are a quite a few characters here so this is going to be messy for a while. Sorry about that. Until it's fixed, everyone should still be able to copy and paste from here if they want to use these symbols in their code. Here goes:
๎„€๎„๎„‚๎„ƒ๎„„๎„…๎„†๎„‡๎„ˆ๎„‰๎„Š๎„‹๎„Œ๎„๎„Ž๎„๎„๎„‘๎„’๎„“๎„”๎„•๎„–๎„—๎„˜๎„™๎„š๎„›๎„œ๎„๎„ž๎„Ÿ๎„ ๎„ก๎„ข๎„ฃ๎„ค๎„ฅ๎„ฆ
๎„ง๎„จ๎„ฉ๎„ช๎„ซ๎„ฌ๎„ญ๎„ฎ๎„ฏ๎„ฐ๎„ฑ๎„ฒ๎„ณ๎„ด๎„ต๎„ถ๎„ท๎„ธ๎„น๎„บ๎„ป๎„ผ๎„ฝ๎„พ๎„ฟ๎…€๎…๎…‚๎…ƒ๎…„๎……๎…†๎…‡๎…ˆ๎…‰๎…Š๎…‹๎…Œ๎…
๎…Ž๎…๎…๎…‘๎…’๎…“๎…”๎…•๎…–๎…—๎…˜๎…™๎…š๎…›๎…œ๎…๎…ž๎…Ÿ๎… ๎…ก๎…ข๎…ฃ๎…ค๎…ฅ๎…ฆ๎…ง๎…จ๎…ฉ๎…ช๎…ซ๎…ฌ๎…ญ๎…ฎ๎…ฏ๎…ฐ๎…ฑ๎…ฒ๎…ณ๎…ด
๎…ต๎…ถ๎…ท๎…ธ๎…น๎…บ๎…ป๎…ผ๎…ฝ๎…พ๎ˆ๎ˆ‚๎ˆƒ๎ˆ„๎ˆ…๎ˆ†๎ˆ‡๎ˆˆ๎ˆ‰๎ˆŠ๎ˆ‹๎ˆŒ๎ˆ๎ˆŽ๎ˆ๎ˆ๎ˆ‘๎ˆ’๎ˆ“๎ˆ”๎ˆ•๎ˆ–๎ˆ—๎ˆ˜๎ˆ™๎ˆš๎ˆ›๎ˆœ๎ˆ
๎ˆž๎ˆŸ๎ˆ ๎ˆก๎ˆข๎ˆฃ๎ˆค๎ˆฅ๎ˆฆ๎ˆง๎ˆจ๎ˆฉ๎ˆช๎ˆซ๎ˆฌ๎ˆญ๎ˆฎ๎ˆฏ๎ˆฐ๎ˆฑ๎ˆฒ๎ˆณ๎ˆด๎ˆต๎ˆถ๎ˆท๎ˆธ๎ˆน๎ˆบ๎ˆป๎ˆผ๎ˆฝ๎ˆพ๎ˆฟ๎‰€๎‰๎‰‚๎‰ƒ๎‰„
๎‰…๎‰†๎‰‡๎‰ˆ๎‰‰๎‰Š๎‰‹๎‰Œ๎‰๎‰Ž๎‰๎‰๎‰‘๎‰’๎‰“๎‰”๎‰•๎‰–๎‰—๎‰˜๎‰™๎‰š๎‰›๎‰œ๎‰๎‰ž๎‰Ÿ๎‰ ๎‰ก๎‰ข๎‰ฃ๎‰ค๎‰ฅ๎‰ฆ๎‰ง๎‰จ๎‰ฉ๎‰ช๎‰ซ
๎‰ฌ๎‰ญ๎‰ฎ๎‰ฏ๎‰ฐ๎‰ฑ๎‰ฒ๎‰ณ๎‰ด๎‰ต๎‰ถ๎‰ท๎‰ธ๎‰น๎‰บ๎‰ป๎‰ผ๎‰ฝ๎‰พ๎‰ฟ๎Š€๎Š๎Š‚๎Šƒ๎Š„๎Š…๎Š†๎Š‡๎Šˆ๎Š‰๎ŠŠ๎Š‹๎ŠŒ๎Š๎ŠŽ๎Š๎Š๎Š‘๎Š’
๎Š“๎Š”๎Š•๎Š–๎Š—๎Š˜๎Š™๎Šš๎Š›๎Šœ๎Š๎Šž๎ŠŸ๎Š ๎Šก๎Šข๎Šฃ๎Šค๎Šฅ๎Šฆ๎Šง๎Šจ๎Šฉ๎Šช๎Šซ๎Šฌ๎Šญ๎Šฎ๎Šฏ๎Šฐ๎Šฑ๎Šฒ๎Šณ๎Šด๎Šต๎Šถ๎Šท๎Šธ๎Šน
๎Šบ๎Šป๎Šผ๎Šฝ๎Šพ๎Šฟ๎‹€๎‹๎‹‚๎‹ƒ๎‹„๎‹…๎‹†๎‹‡๎‹ˆ๎‹‰๎‹ ๎‹ก๎‹ข๎‹ฃ๎‹ค๎‹ฅ๎‹ฆ๎‹ง๎‹จ๎‹ฉ๎‹ช๎‹ซ๎‹ฌ๎‹ญ๎‹ฎ๎‹ฏ๎‹ฐ๎‹ฑ๎‹ฒ๎‹ณ๎‹ด๎‹ต๎‹ถ
๎‹ท๎‹ธ๎‹น๎‹บ๎‹ป๎‹ผ๎‹ฝ๎‹พ๎‹ฟ
Perfect. Copy and paste as you please. They'll show up as boxes with a little x in the middle until they're posted but... you know. There's a way around that but I won't go into it yet.

If you're looking for a starting point for syntax highlighting, I'm pretty sure Facepunch has it done clientside via JavaScript, so you can poke into that code (IIRC it's not minified, or at least you might find its source somewhere). It has highlighting for Lua, C and some other language I don't remember, and it picks between them by giving each language a 'score' based on how many times certain keywords appear that are specific to that language... Here we only need SmileBASIC though so you can forget that part :P