Pages: 1
  Print  
Author Topic: Markdown  (Read 14701 times)
Offline (Male) notachair
Posted on: July 11, 2010, 03:21:33 am

Definitely not a chair
Contributor
Joined: Feb 2008
Posts: 299

View Profile
Ever since coming across Markdown, thanks to its usage on Stack Overflow, I'm liking it quite a bit.

I'm thinking about getting the issue tracker to use Markdown instead of BBcode.

In case you don't know what Markdown is, you can check out its syntax here, or have a look at the below example. It's a bit like Wikipedia's markup, actually.

Code: [Select]
> No I'm not insane

**READ THIS!**

You're all *\*insane\** people, proof:

   function are_insane(what)
   {
      are_insane('[b]yes[/b]');
   }

**You guys are therefore all insane.**

Here's some more reasons:

1. You're all stupid
2. Stop huffing kittens
3. Unicorns don't exist, really

/faints

Which in BBcode (NOT SMF FLAVOURED, THIS IS GENERAL) would be:

Code: [Select]
[quote]No I'm not insane[/quote]

[b]READ THIS![/b]

You're all [i]*insane*[/i] people, proof:

[code]function are_insane(what)
{
   are_insane('[noparse][b]yes[/b][/noparse]')
}[/code ]

[b]You guys are therefore all insane.[/b]

Here's some more reasons:

[ol]
[list][li]You're all stupid
[/li][li]Stop huffing kittens
[list][li]Unicorns don't exist, really
[/ol]

/faints[/list][/list]

And what it looks like:

Quote
Quote
No I'm not insane

READ THIS!

You're all *insane* people, proof:

Code: [Select]
function are_insane(what)
{
   are_insane('[b]yes[/b]')
}

You guys are therefore all insane.

Here's some more reasons:

  • You're all stupid
  • Stop huffing kittens
  • Unicorns don't exist, really

/faints

That's somewhat inconvenient though for things like code blocks, so I'm looking at PHP Markdown Extra.

Quote
Fenced Code Blocks

Version 1.2 of PHP Markdown Extra introduced a syntax code block without indentation. Fenced code blocks are like Markdown’s regular code blocks, except that they’re not indented and instead rely on a start and end fence lines to delimit the code block. The code block start with a line containing three or more tilde ~ characters, and ends with the first line with the same number of tilde ~. For instance:

Code: [Select]
This is a paragraph introducing:

~~~~~~~~~~~~~~~~~~~~~
a one-line code block
~~~~~~~~~~~~~~~~~~~~~

Contrary to their indented counterparts, fenced code blocks can begin and end with blank lines:

Code: [Select]
~~~

blank line before
blank line after

~~~

Indented code blocks cannot be used immediately following a list because the list indent takes precedence; fenced code block have no such limitation:

Code: [Select]
1.  List item

    Not an indented code block, but a second paragraph
    in the list item

~~~~
This is a code block, fenced-style
~~~~
« Last Edit: July 11, 2010, 03:56:35 am by a2h » Logged
Offline (Male) MahFreenAmeh
Reply #1 Posted on: July 11, 2010, 02:54:06 pm

sysadmin
"Web Team"
Location: Austin, TX
Joined: Apr 2008
Posts: 13
AOL Instant Messenger - sirmxe
View Profile WWW Email
Well, you could always just grab the markdown formatter and hack it out to give it the features you need, as well... heh.

In any case, it seems like a solid choice to me.
Logged
sys(tem)admin(istrator)
[java,c++,c,javascript,html,css,php,perl,ruby,python,sql]
if you've got ideas, let me hear them.
Offline (Male) Josh @ Dreamland
Reply #2 Posted on: July 11, 2010, 05:00:32 pm

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2950

View Profile Email
You've my support on the idea. It's about time people started merging the two anyway; markdown is a beautiful format.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) RetroX
Reply #3 Posted on: July 15, 2010, 07:47:49 pm

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Forum wikitext, basically?
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Female) IsmAvatar
Reply #4 Posted on: July 18, 2010, 02:10:00 pm

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 877

View Profile Email
I have yet to find a lightweight markup language that I like, but BBCode has come pretty close, sadly.

Markdown is horrible for trying to put HTML in a codebox.

Code: [Select]
<div>
 <span>
  <a href="http://www.google.com">Link 1</a>

   |
  <a href="http://www.google.com">Link 2</a>
 </span>
</div>

Use your fancy ~~~ trick, and the above code will become actual html, so you will actually see 2 links, rather than the raw html code like you should.
Adding 4 spaces before each line seems to solve it, but it's annoying as hell, especially when you start pasting in long segments of html code.

Not to mention if a user decides to use html and forgets to end one of the tags... the rest of the page is screwed up.
http://daringfireball.net/projects/markdown/dingus
That's a Markdown testing page. Simply type in <del>, click "Convert", and scroll down to observe the mayhem.
« Last Edit: July 18, 2010, 02:25:06 pm by IsmAvatar » Logged
Offline (Male) notachair
Reply #5 Posted on: July 18, 2010, 09:27:30 pm

Definitely not a chair
Contributor
Joined: Feb 2008
Posts: 299

View Profile
I have yet to find a lightweight markup language that I like, but BBCode has come pretty close, sadly.

Markdown is horrible for trying to put HTML in a codebox.

Code: [Select]
<div>
 <span>
  <a href="http://www.google.com">Link 1</a>

   |
  <a href="http://www.google.com">Link 2</a>
 </span>
</div>

Use your fancy ~~~ trick, and the above code will become actual html, so you will actually see 2 links, rather than the raw html code like you should.
Adding 4 spaces before each line seems to solve it, but it's annoying as hell, especially when you start pasting in long segments of html code.

Not to mention if a user decides to use html and forgets to end one of the tags... the rest of the page is screwed up.
http://daringfireball.net/projects/markdown/dingus
That's a Markdown testing page. Simply type in <del>, click "Convert", and scroll down to observe the mayhem.

That's because ~~~ isn't part of the original Markdown specification and instead part of "PHP Markdown Extra", and I mentioned that in the OP quite clearly.
Logged
Offline (Unknown gender) luiscubal
Reply #6 Posted on: July 19, 2010, 09:05:06 am
Member
Joined: Jun 2009
Posts: 452

View Profile Email
I would like line breaks to be automatically break the text line. If that was not desired, then a "\" character at the end of the line would prevent that from happening.

In the end, my favorite markup language is HTML. It's unsafe for many purposes, but that's what whitelists are for.
Logged
Offline (Male) MahFreenAmeh
Reply #7 Posted on: July 19, 2010, 10:40:24 am

sysadmin
"Web Team"
Location: Austin, TX
Joined: Apr 2008
Posts: 13
AOL Instant Messenger - sirmxe
View Profile WWW Email
DOOOOONGS
Logged
sys(tem)admin(istrator)
[java,c++,c,javascript,html,css,php,perl,ruby,python,sql]
if you've got ideas, let me hear them.
Pages: 1
  Print