예제 #1
0
        public void ExportPage(NoteBookPage page)
        {
            NPath file;

            if (mPath.FileExists(page.Name + ".html"))
            {
                file = new NPath(mStringPath + "/" + page.Name + ".html");
            }
            else
            {
                file = mPath.CreateFile(page.Name + ".html");
            }
            string output = "<html>\n";

            switch (page.MarkupType)
            {
            case NoteBookPageMarkupType.Markdown:
                var result = Markdown.ToHtml(page.Text);
                output += result;
                break;

            case NoteBookPageMarkupType.PlainText:
                output += page.Text;
                break;
            }
            output += "\n</html>";
            file.WriteAllText(output);
        }
예제 #2
0
        public void ExportPage(NoteBookPage page)
        {
            NPath file;

            if (mPath.FileExists(page.Name + ".html"))
            {
                file = new NPath(mStringPath + "/" + page.Name + ".txt");
            }
            else
            {
                file = mPath.CreateFile(page.Name + ".txt");
            }
            file.WriteAllText(page.Text);
        }