Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

My new text markup langage

Name: Anonymous 2009-10-01 12:11

It's better than BBCode:
`b`i`o`u{I AM AN EXPERT PROGRAMMER}
`sup{NO `sup{MORE `sup{NESTING `sub{PROBLEMS`b`i{!!}}}}}


Also, the parser in Haskell is 30 lines.

Name: Anonymous 2009-10-01 12:19

My new text markup language

(with-bbcode bbcode
  (b (i (o (I AM AN EXPERT PROGRAMMER)))) (sup NO (sup MORE (sup NESTING (sub PROBLEMS))))
  bbcode)

The implementation is roughly 5 lines.

Name: Anonymous 2009-10-01 12:22

you forgot the !!.

Name: Anonymous 2009-10-01 12:23

You're language looks like shit.

Name: Anonymous 2009-10-01 12:32

this is not suitably terse for an expert programmer like me. I propose something more like:


hello ^B^bold on^b^off. lol hy 2^^2 = 4
^BIU^LOL HY^biu^

Name: Anonymous 2009-10-01 13:01

Also, the parser in Haskell is 30 lines.
Which means the parser is what, 5 lines in a real language like Perl?

Name: Anonymous 2009-10-01 13:14

>>6
U MENA JAVA? In all seriousness, Perl ∉ Real Languages

Name: Anonymous 2009-10-01 13:20

>>5
Doesn't work with tags with names longer than 1 char.
>>7
Neither does Haskell.

Name: Anonymous 2009-10-01 14:34

>>8
Neither does anything else than Scheme and BBCode.

Name: Anonymous 2009-10-01 14:50

>>1,2,5

Unreadable pieces of shit.

Name: Anonymous 2009-10-01 14:58

>>10
function before form, you shallow hipster fagbox

Name: Anonymous 2009-10-01 16:32

>>8
U MENA HASKAL

Name: Anonymous 2009-10-01 17:00

>>10
Um.... So is regular bbcode.

Name: Anonymous 2009-10-01 17:41

>>8
it would if they were prefix free or whatever the term is

Name: Anonymous 2009-10-01 20:40


b
        SAMPLE TEXT
        i
                SAMPLE TEXT 2
        SAMPLE TEXT 3
SAMPLE TEXT 4
s
        GuidoForceCode

Name: Anonymous 2009-10-01 20:44

i like it

Name: Anonymous 2009-10-02 0:31

Stack based BBCode

push b
push i
push o
push u
push I AM AN EXPERT PROGRAMMER
popopopopop

Name: Anonymous 2009-10-02 2:55

>>1
Only novices have nesting issues.

Name: Anonymous 2009-10-02 6:26

>>1
Add slashes and it'd be fucking TeX

Name: Anonymous 2009-10-02 7:45

>>1
U MENA MARKDOWN

Name: Anonymous 2009-10-02 8:07

>>1
How do I ``Proper Quote''?

Name: Anonymous 2009-10-02 14:13

>>17
Should automagically pop the whole stack at the end of the post to avoid BBCode failures when one writes one pop too few.

Name: Anonymous 2009-10-02 16:01

>>22
well surely the bbcode runtime instance would end after each post and free resources and close tags

Name: Anonymous 2009-10-02 17:53

>>18
I know, and I'm advanced in BBCode enough to avoid them.
Still, the closing tags have a big size overhead (especially with [spoiler] tags), and a mistake I sometimes make is accidentally putting the / before the tag instead of inside it.

Name: Anonymous 2009-10-02 17:56

>>24
Also, the source for my post:
I know, and I'm advanced in `b`i`u`o(BBCode) enough to avoid them.
Still, closing tags have a big `b[size overhead] (especially with `code{[spoiler]} tags), and a mistake I sometimes make is accidentally putting the `m{/} `b<before> the tag instead of `i^inside$ it`m(.)

Name: Anonymous 2009-10-02 17:58

>>25
And now you should opensource your implementation...

Name: Anonymous 2009-10-02 19:19

My new text markup language

THIS IS MOTHERFUCKING BOLD MOTHERFUCKER AND THIS MOTHER FUCKER HERE IS ITALIC THIS OH HEY HERE'S AN OVERLINE WAIT THE UNDERLINE COMES NOW I AM AN EXPERT PROGRAMMER THIS IS MOTHERFUCKING BOLD MOTHERFUCKER AND THIS MOTHER FUCKER HERE IS ITALIC !! CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG
DID YOU SAY ``SUP'', BITCH?? NO DID YOU SAY ``SUP'', BITCH?? MORE DID YOU SAY ``SUP'', BITCH?? NESTING DID YOU SAY ``SUP'', BITCH?? PROBLEMS DID YOU SAY ``SUP'', BITCH?? ALRIGHT CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG

Name: Anonymous 2009-10-02 21:15

I think a markup language that uses different brackets for different tags would work well.

So there are 4 kinds of matching brackets
[]
{}
<>
()

So it would look like this
[Bold{and italic}text]

Of course the only down side is the number of tags you can use.  A possible workaround could be doubling the tags like so.

[[Bold[{and italic}]text]]

That will give us 16 tags to use, 20 if we keep single tags.


[ bold
{ italic
< underline
( overline

{{ spoiler
[[ code
{[ subscript
{{ super script

Name: Anonymous 2009-10-02 21:31

[{<(EXPERT PROGRAMMER)>}]

Name: Anonymous 2009-10-03 3:58

>>27
I lold. MFINBBCODE

Name: Anonymous 2009-10-03 10:39

>>26

module Parser where

import Text.ParserCombinators.Parsec
import Data.Maybe (fromJust)

delimiters = [('{','}'), ('(',')'), ('<','>'), ('[',']'), ('^','$')]

data Entity = Text String
            | Tag String Entity
            | Collection [Entity]
             deriving (Show, Eq)

Collection xs `addChild` e = Collection $ xs ++ [e]

character resvd = ((char '\\' >> anyChar) <?> "escaped char") <|> noneOf ('`' : resvd)
tagChar = ((char '\\' >> anyChar) <?> "escaped char") <|> noneOf ('`' : map fst delimiters)

nested = do char '`'
            tag <- many1 tagChar
            value <- nested <|> block
            return $ Tag tag value
block = do opening <- oneOf $ map fst delimiters
           let closing = fromJust $ lookup opening delimiters
           source (Collection []) (char closing) [closing]
text resvd = return . Text =<< many1 (character resvd)

source :: Entity -> Parser a -> [Char] -> Parser Entity
source coll fin resvd = (<|>)
    (fin >> return coll)
    (do e <- (nested <?> "nested tag") <|> (text resvd <?> "text")
        source (coll `addChild` e) fin resvd)

full = source (Collection []) eof []

toBBCode (Collection xs) = concatMap toBBCode xs
toBBCode (Tag t v) = "[" ++ t ++ "]" ++ toBBCode v ++ "[/" ++ t ++ "]"
toBBCode (Text t) = t

Name: Anonymous 2009-10-03 10:42

>>31
Also s/(Show), Eq/\1/

Name: Anonymous 2009-10-03 12:30

>>31
Nice toy language you have there, suited well for tasks such as parsing toy grammar.

Name: Anonymous 2009-10-03 13:46

>>33
I forgive your monad envy.

Name: Anonymous 2009-10-04 8:35

>>34
I don't want to hear that from someone who's never even slept in a yurt.

Name: 35 2009-10-05 13:28

Isn't someone going to ask me how it was? :(

Name: Anonymous 2009-10-05 14:07

>>36
You mean you really slept in a yurt? That's cool! How was it?

Name: Anonymous 2009-10-05 14:27

>>37
Simple, but functional.

Name: Anonymous 2009-10-05 14:50

>>38
Unlike Haskal!

Name: Anonymous 2009-10-05 15:14

>>39
I beg to differ, sir. HASKAL is a *functional* programming language.

While functional, yes, it has no practical value; were we define: functional != (useful or practical)

Name: Anonymous 2009-10-05 15:18

>>40
I believe you missed either an h or to, sir.

Name: Anonymous 2009-10-05 15:24

HASCAL

Name: Anonymous 2009-10-05 15:59

>>41
s/were/where/

Name: Anonymous 2009-10-05 16:45

>>40
Nah, probably you just suck at it.

Name: Anonymous 2009-10-06 1:43

>>1
You're implementation sucks.

sup("NO" + sup("MORE") + sup("NESTING") + sub("PROBLEMS" + b(i(!!))))

Name: Anonymous 2009-10-06 1:47

>>45
A little too LISPY.  Take your TOY MARKUP LANGUAGE elsewhere!

Name: Anonymous 2009-10-06 1:50

>>46
I peed into my trash bin a little.

Name: Anonymous 2009-10-06 2:15

for the aspiring php developer:

function f($i="", $str="") {
    switch($i) {
        case "sup":
            echo "<sup>".$str."</sup>";
            break;
        case "sub":
            echo "<sub>".$str."</sub>";
            break;
        case "b":
            echo "<b>".$str."</b>";
            break;
        case "i":
            echo "<i>".$str."</i>";
            break;
        case "o":
            echo "<o>".$str."</o>";
            break;
        case "u":
            echo "<u>".$str."</u>";
            break;
        }
    }
   
    f("sup", "NO" . f("sup", "MORE") . f("sup", "NESTING") . f("sup", "PROBLEMS") . f("b" f("i", "!!")));

Name: Anonymous 2009-10-06 2:22

>>48
fag

function sub($str="") { echo "<sup>".$str."</sup>"; }
function sup($str="") { echo "<sub>".$str."</sub>"; }
function b($str="") { echo "<b>".$str."</b>"; }
function i($str="") { echo "<i>".$str."</i>"; }
function o($str="") { echo "<o>".$str."</o>"; }
function u($str="") { echo "<u>".$str."</u>"; }

Name: Anonymous 2009-10-06 2:30

>>49

IMPROVED PHPEPPLES EDITION:

class bbcode {
    public static function sub($str="") { echo "<sup>".$str."</sup>"; }
    public static function sup($str="") { echo "<sub>".$str."</sub>"; }
    public static function b($str="") { echo "<b>".$str."</b>"; }
    public static function i($str="") { echo "<i>".$str."</i>"; }
    public static function o($str="") { echo "<o>".$str."</o>"; }
    public static function u($str="") { echo "<u>".$str."</u>"; }
}

bbcode :: sup("NO" . sup("MORE") . sup("NESTING") . sub("PROBLEMS" . b(i("!!"))));

Name: Anonymous 2009-10-06 2:32

>>50
doesn't work

Name: Anonymous 2009-10-06 10:26

>>50

ROCKSTAR PHUBY EDITION!

class BbCode
{
    private function tag($name, $contents)
    {
        return sprintf('<%s>%s</%s>', $name, $contents, $name);
    }   

    public function __call($method, $args)
    {
          $content = isset($args[0]) ? $args[0] : '';
          return $this->tag($method, $contents);
    }
}

$b = new BbCode();
echo $b->b($b->u($b->o($b->sup('D').'S'.$b->sub('L'))));

Name: Anonymous 2009-10-06 10:48

this reminds me of buttsortz

Name: Anonymous 2009-10-06 11:42

>>45
Have fun evaling things

Name: Anonymous 2009-10-06 13:52

>>6
i didnt know you need lines in perl ?
why has no one told me ?

Name: Anonymous 2009-10-06 14:19

>>52
so how is rubby formed?

Name: Anonymous 2009-10-06 15:03

>>56
how rubby get classes?

Name: Anonymous 2010-05-25 14:02

class BBCode
    def method_missing(name, content="")
        tag(name.to_s, content)
    end

    def tag(name, content)
        "[" + name + "]" + content + "[/" + name + "]"
    end
end


irb(main):001:0> load "bbcode.rb"
=> true
irb(main):002:0> b = BBCode.new
=> #<BBCode:0x7fcb9c9a6c70>
irb(main):003:0> b.i(b.o(b.u(b.b("BAMPU " + b.sup(b.sup(b.sup(b.sup("PANTSU"))))))))
=> "
BAMPU PANTSU"

Name: Anonymous 2010-05-25 14:27

You guys, Xarn has blown the field wide open. All of your dabblings can't hold a candle to his revolutionary SexpCode!

Name: Anonymous 2010-05-25 14:46

>>59
Big deal, I've been using an sexpression based BBCode language for months, hell I even posted chunks of it.

Name: Anonymous 2010-05-25 15:01

I'm pretty sure that all posts mentioning Xarn are made by Xarn himself. Including this one.

Name: Anonymous 2010-05-25 15:16

>>61
Since half of them seem to be making fun of him (including >>59), I don't think that's true.

Name: Anonymous 2010-05-25 20:47

>>62
Is it so unlikely that someone can be so self-deprecating?

I am a massive homosexual, and a failure of a human being

Don't change these.
Name: Email:
Entire Thread Thread List