You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

BBCode to Wiki Markup - Name [Ruby]

b/PC, Mac & Vintage Computers Started by Unicorn, July 19, 2016, 05:38:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

u/Unicorn July 26, 2016, 06:57:34 AM
I could to that, maybe read info from a text file in the main directory that is easy for the user to changed.
u/Dream of Omnimaga July 26, 2016, 03:21:05 PM
Ideally I don't think options should have to be changed via a text file like in some games, though. That's not that user-friendly, unless you thoroughly explain step by step what are each option.
u/garvalf July 28, 2016, 09:41:55 AM
That's interesting, both the Shoes app and this script.

For all my documents, I'm using the txt2tags wiki markup langage. It's has a cool syntax (much better and logical than mediawiki).

http://txt2tags.org/

For example **bold** is for bold, //italic// for italic, __underline__ for underline, --strikeout-- for strikeout etc.
The advantage is you don't use extra letters (such as b for bold like in bbcode), and it's super fast to type (no need to use those [ ])

It can also export to several markup: markdown, mediawiki, bbcode, rtf (useful for making documents), laTeX, html etc

Some wiki such as dokuwiki, pmwiki and a few others can be adapted to use the txt2tags syntax.

u/Dream of Omnimaga July 28, 2016, 12:14:36 PM
I kinda wish that forums went that route long ago. IIRC there are forum softwares that support wiki markup, but it would suck having to convert posts to support it.

That said, I guess I can understand that some people might have an hard time memorizing the syntax compared to some of the bbcode.
u/garvalf July 28, 2016, 01:12:25 PM
I'm pretty sure it could allow both syntax (wiki and bbcode). Yet, I prefer to use the bbcode than the mediawiki (aka wikipedia) syntax, which is really one of the worst design ever made. For example, with '' for italic, ''' for bold, which mean you have ''''' for bold + italic.

But there is maybe worse, for dokuwiki, the heading is the opposite of the logic, for example heading level 1 is, instead of being one =, 4 or 5 = (or maybe 6?).

For converting between syntaxes, there is pandoc, which can input one markup, and output to an other one.
Last Edit: July 28, 2016, 01:14:35 PM by garvalf
u/Unicorn July 28, 2016, 11:40:12 PM
That is actually quite a nice markup syntax! But anyways, development is kind of halted right now, I'm going to continue work on that train game now.
u/Dream of Omnimaga July 29, 2016, 01:03:48 AM
Quote from: garvalf on July 28, 2016, 01:12:25 PM
I'm pretty sure it could allow both syntax (wiki and bbcode). Yet, I prefer to use the bbcode than the mediawiki (aka wikipedia) syntax, which is really one of the worst design ever made. For example, with '' for italic, ''' for bold, which mean you have ''''' for bold + italic.

But there is maybe worse, for dokuwiki, the heading is the opposite of the logic, for example heading level 1 is, instead of being one =, 4 or 5 = (or maybe 6?).

For converting between syntaxes, there is pandoc, which can input one markup, and output to an other one.
WHat I dislike is when websites use syntaxes with no closing character. Imagine trying to make a post without a [/b] character and being only able to use 1 font weight or style at a time per paragraph.
u/garvalf July 29, 2016, 07:04:41 AM
The good thing with txt2tags (and most other lightweight markup langages) is you don't really need closing characters, for example your can write this kind of thing in txt2tags:

I **enjoy** //Casio// calculators, but I **love even more** the //TI// ones.

and it correctly will convert to:

I enjoy Casio calculators, but I love even more the TI ones.

it will certainly not convert to something like:  I enjoy Casio calculators, but I love even more the TI[/i] ones.  (which the bbcode doesn't even handle well)

The only thing you can't do is using such marks accross several paragraphs. If you really need to do this you can just mark the beginning and the end of every single paragraph. But marking in bold several paragraphs is not very meaningful, in this case if you need such a thing it's better to create a new "class" ("code", "remark", "important", whatever) and use this new class across the paragraphs. Because the other good thing with txt2tags is you can redefine your own marks, and you can decide to use closing characters if you feel so. It's what I did for some documents, for example you define them this way:


%!preproc: '\{\+\+\}'     'CONVERTsizeincBEGIN'
%!preproc: '\{/\+\+\}'    'CONVERTsizeincEND'


%!postproc(xhtml): 'CONVERTsizeincBEGIN' '<span class="big">'
%!postproc(xhtml): 'CONVERTsizeincEND' '</span>'


So I can use the {++}bigger font{/++} marks to make a part with this new style (I can do the same for bold or italic, for marking a whole area).

You can make whole books with that, for example:
https://mega.nz/#F!00Ix1TZA!Yj-GM6alhJplzLgS5K8_fw

(it's a choose your own adventure, in French, which I converted to epub, pdf and html using this syntax. If you can read French you can play it, it's a very good story, with a lovecraftian background)
u/Dream of Omnimaga July 29, 2016, 07:13:50 AM
Hm I see. That might take me a while to get used to if I use this syntax actually, though, since I am not used to inserting custom styles in each of my text files. :P

Thanks for the thorough explanation, though @garvalf . :)


Also regarding Choose Your Own Adventure books, I used to read Un Livre Dont Vous Êtes le HĂ©ros way back in the 90's and it was very fun, like an ancestor of video game-based RPGs. The only thing I hated is that most battles were luck-based and your attacks missed a lot, not to mention having to restart from scratch all the time (not that we followed the rules to the letter, but if they ever made those books into visual novels or actual text-based games then it would be like playing Final Fantasy with no save feature. O.O I also made two comic books in 2000-01 that were actual choose your own adventure books, but they worked closer to actual JRPGs with experience, leveling up and all, so you needed a calculator all the time. There were even board game style maps in some comic strips where you moved around and the dice roll told how many steps you could take before the next random enemy encounter. Maybe I should start a CYOA topic at some point?
u/garvalf August 01, 2016, 10:28:59 PM
QuoteMaybe I should start a CYOA topic at some point?

yes, good idea!

I played/read many "livres dont vous ĂȘtes le hĂ©ros" in my youth. I like that, but it's true the battles are not very interesting (I cheated every time I guess)
u/Dream of Omnimaga August 01, 2016, 10:40:09 PM
Near the end I just played for the story lol. I still enjoyed reading the books. Also I hated writing stuff in my books so I just used a separate sheet of paper. I should scan my CYOA comics, but again I said that for 15 years already :P
u/Unicorn August 08, 2017, 05:26:31 AM
So uh, I discovered Electron and decided to move this app over to it to kinda learn how electron goes. Anyways, I moved everything to Javascript and learned a little regex, as well as implemented html support. Check it out!

BBCode to Wiki Markup Converter

Now I just need to figure out how to package it so I can make a release :P Or maybe put it in a github website or something :P
u/Yuki August 08, 2017, 05:32:55 AM
Ah yeah, Electron is pretty neat. Personally I just installed electron-builder (npm install electron-builder --dev --save), your package.json file should look like this, you type npm dist and there you go you have some apps packaged, ready for release.
u/Unicorn August 08, 2017, 05:50:17 AM
Quote from: Juju on August 08, 2017, 05:32:55 AM
Ah yeah, Electron is pretty neat. Personally I just installed electron-builder (npm install electron-builder --dev --save), your package.json file should look like this, you type npm dist and there you go you have some apps packaged, ready for release.
Huh. And all the docs and tutorials didn't make it that easy :P

Well, npm dist is not recognized as a command, apparently. Is there some other dependency i need? oops npm run dist :P
Last Edit: August 08, 2017, 05:59:25 AM by Unicorn
u/kotu August 08, 2017, 03:45:09 PM
"BTW"

(bb 2 wiki)

Last Edit: August 08, 2017, 04:02:48 PM by kotu
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal