Wiki style text formatting
Asked Answered
Z

4

6

I'm looking for some kind of text-parser for ASP.NET that can make HTML from some style of text that uses a special format. Like in Wiki's there is some special syntax for headings and such. I have tried to look on google, but I did not found anything for .NET.

Do someone know about a library for .NET that can parse the text to HTML wiki-style? I't don't have to be the same syntax as a Wiki? If no, how whould be the best way to design such a system your self?

Thanks in advance

Zobkiw answered 2/10, 2008 at 17:29 Comment(0)
C
8

how about the Markdown that StackOverflow uses?

http://daringfireball.net/projects/markdown/

from their home page:

Thus, “Markdown” is two things: (1) a plain text formatting syntax; and (2) a software tool, written in Perl, that converts the plain text formatting to HTML.

Clank answered 2/10, 2008 at 17:37 Comment(1)
Thanks. Found that when i searched for a solution, but did not know there was a .NET Version of it. +1 :)Zobkiw
D
3

For the server side, you can use the Markdown.Net library from Milan Negovan : http://www.aspnetresources.com/blog/markdown_announced.aspx

Dubois answered 2/10, 2008 at 18:17 Comment(0)
J
2

Markdown is great - very intuitive syntax, and you have WMD - this terrific editing tool that I'm typing into now.

Jegar answered 2/10, 2008 at 18:11 Comment(0)
E
2

I would like to strongly recommend Textile over Markdown. Textile.NET should do what you want.

Why? I like Textile's syntax better, and I think it's easier for users to learn and use. There's no single large reason - just a lot of small things.

In Markdown you can do *italics* and **bold** easily, but the syntax seems arbitrary. Compare to the equivalent syntax in Textile for _italics_ and *bold*, which mirrors the conventional way to indicate those modifiers in plain text formats.

Or for another example, in Textile you make an ordered list by prefixing each item with an '#'. In Markdown, you prefix it with "n.", where n is any integer. Markdown is trying to imitate the syntax people use in flat text files when writing lists (which is nice), but it means that this Markdown code:

3.  Test1
2.  Test2
1.  Test3 

Is rendered as this:

  1. Test1
  2. Test2
  3. Test3

Basically, Markdown asks you for a number, which it then ignores. That seems inelegant to me, although I couldn't explain why precisely.

Textile also does tables (and wish a nicely compact syntax). Markdown doesn't. There's a few other minor points, but I think that covers most of it. :)

Employer answered 13/10, 2008 at 11:19 Comment(2)
it'd be more convincing with some actual reasons other than "I like it better". Just sayin'!Translatable
Sadly, those really are the only reasons. I learned Textile faster than Markdown, and I think the syntax is prettier. shrugEmployer

© 2022 - 2024 — McMap. All rights reserved.