Alternatively, join us on Discord.

BBCode to Wiki Markup - Name [Ruby]

Started by Unicorn, July 19, 2016, 05:38:29 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Unicorn

I could to that, maybe read info from a text file in the main directory that is easy for the user to changed.



??? ??? ??? ??? ???

DJ Omnimaga

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.

garvalf

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.


DJ Omnimaga

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.

garvalf

July 28, 2016, 01:12:25 pm #19 Last Edit: July 28, 2016, 01:14:35 pm by garvalf
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.

Unicorn

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.



??? ??? ??? ??? ???

DJ Omnimaga

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.

garvalf

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)

DJ Omnimaga

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?

garvalf

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)

DJ Omnimaga

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

Unicorn

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



??? ??? ??? ??? ???

Juju

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.
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron



if you wanna throw money at me and/or CodeWalrus monthly it's here

Unicorn

August 08, 2017, 05:50:17 am #28 Last Edit: August 08, 2017, 05:59:25 am by Unicorn
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



??? ??? ??? ??? ???

kotu

August 08, 2017, 03:45:09 pm #29 Last Edit: August 08, 2017, 04:02:48 pm by kotu
"BTW"

(bb 2 wiki)

SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

Powered by EzPortal