一个wiki for asp.net mvc wiki-engine

时间:2009-07-15 00:08:32

标签: asp.net-mvc wiki-engine

是否有适用于asp.net mvc或soemthign的wiki模块,可以相对轻松地进行调整:)

或者,是否有任何格式化的wiki标记可能会影响最常见的wiki标记格式化等。

3 个答案:

答案 0 :(得分:1)

MiniWiki

这很容易定制。

答案 1 :(得分:1)

http://lynxwiki.codeplex.com发布了一个新的基于mvc4的wiki引擎http://www.sapientier.com:88/LynxWiki/WikiTopic/Page/WikiRoot/WikiDir/HomePage,其引擎的运行版本为{{3}}

这是一个功能齐全的维基,具有MediaWiki的许多功能,并且通过使用嵌入式IronPython脚本具有动态内容的功能

答案 2 :(得分:0)

    private void ProcessLine(string line, TextWriter writer)
    {
        int state = 0;
        int i = 0;
        int wordStart = 0;
        Action encode = () => HttpUtility.HtmlEncode(line[i].ToString(), writer);
        Func<bool> isws = () => Char.IsWhiteSpace(line[i]);

        for (i = 0; i < line.Length; ++i)
        {
            switch (state)
            {
                case 0:
                    if (line[i] == '*')
                    {
                        state = 1;
                    }
                    else if (line[i] == '/')
                    {
                        state = 4;
                    }
                    else if (line[i] == '[')
                    {
                        wordStart = i + 1;
                        state = 7;
                    }
                    else
                    {
                        encode();
                    }
                    break;

                case 1: //Start bold
                    if (isws())
                    {
                        encode();
                        state = 0;
                    }
                    else
                    {
                        writer.Write("<b>");
                        encode();
                        state = 2;
                    }
                    break;

                case 2: //End bold
                    if (isws())
                    {
                        encode();
                        state = 3;
                    }
                    else if (line[i] == '*')
                    {
                        writer.Write("</b>");
                        state = 0;
                    }
                    else
                    {
                        encode();
                    }
                    break;

                case 3:
                    if (isws())
                    {
                        encode();
                    }
                    else
                    {
                        encode();
                        state = 2;
                    }
                    break;

                case 4: //Start italics
                    if (isws())
                    {
                        HttpUtility.HtmlEncode("/ ", writer);
                        state = 0;
                    }
                    else
                    {
                        writer.Write("<i>");
                        encode();
                        state = 5;
                    }
                    break;

                case 5: //End italics
                    if (isws())
                    {
                        encode();
                        state = 6;
                    }
                    else if (line[i] == '/')
                    {
                        writer.Write("</i>");
                        state = 0;
                    }
                    else
                    {
                        encode();
                    }
                    break;

                case 6:
                    if (isws())
                    {
                        encode();
                    }
                    else
                    {
                        encode();
                        state = 5;
                    }
                    break;

                case 7: //Start link
                    state = 8;
                    break;
                case 8: //End link
                    if (line[i] == ']')
                    {
                        WriteLink(line.Substring(wordStart, i - wordStart), writer);
                        state = 0;
                    }
                    break;
            }
        }

        // Clean up italics, bold etc. based on the state we were in at the end of the line.
        switch (state)
        {
            case 0:
                break;
            case 1:
                HttpUtility.HtmlEncode("*", writer);
                break;
            case 2:
            case 3:
                writer.Write("</b>");
                break;
            case 4:
                HttpUtility.HtmlEncode("/", writer);
                break;
            case 5:
            case 6:
                writer.Write("</i>");
                break;
            case 7:
                HttpUtility.HtmlEncode(line.Substring(wordStart), writer);
                break;
            case 8:
                WriteLink(line.Substring(wordStart), writer);
                break;
        }

    }