一个 wiki for asp.net mvc wiki-engine

发布于 2024-07-26 12:12:38 字数 116 浏览 6 评论 0原文

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

或者,是否有用于 wiki 标记的格式化程序,它可能实现最常​​见的 wiki 标记格式等。

Is there any wiki module for asp.net mvc or soemthign that can be adapted with relative ease :)

alternatively, are there any formatters for the wiki markup which perhaps implment the most common wiki markup formatting etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

青芜 2024-08-02 12:12:38

尝试

MiniWiki

它非常容易定制。

try

MiniWiki

It's pretty easy to customise.

似梦非梦 2024-08-02 12:12:38

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

这是一个功能齐全的 wiki,具有 MediaWiki 的许多功能,此外它还能够通过使用嵌入式 IronPython 脚本来处理动态内容

A new mvc4-based wiki engine has been released at http://lynxwiki.codeplex.com with a running version of the engine at http://www.sapientier.com:88/LynxWiki/WikiTopic/Page/WikiRoot/WikiDir/HomePage

This is a full-featured wiki with many of the features of MediaWiki plus it has the capability for dynamic content by using embedded IronPython scripting

猫腻 2024-08-02 12:12:38
    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;
        }

    }
    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;
        }

    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文