Open linpengcheng opened 5 years ago
Its advantages:
It don't break the syntax of any programming language, you can compile directly. comment area markup method can be applied to any programming language and any markup (including Org,rst, asciidoc, etc.), which is the greatest advantage.
you only need a single line of regular replacement preprocessing, then you can use any Markdown parse or converter.
Support any code editor that supports Markdwon Live preview, allowing the source code of any programming language to become rich text in real time. In the code's comment area, You can use the markdown to draw flowcharts, tables, task lists, and display images on the live preview panel, enhance the readability of your code.
If you extend the Markdwon tag, you can implement the eval code, print result, display data visualization and other instruction tags, to achieve live programming, live test.
If you let the plug-in judge that the file extension is not . MD
or . markdown
,
elseif the line comment character is empty, it is treated as a normal text file. :
\r\n\\\\
)" with "line breaks(\r\n
)" , then get standard Markdwon text.
//reference MarkdownViewerPlusPlus: MarkdownViewer.cs, AbstractRenderer.cs
using System.Text.RegularExpressions;
editor = new ScintillaGateway(PluginBase.GetCurrentScintilla());
txt = editor.GetText(editor.GetLength() + 1);
markdown_txt = Replace(txt, "\r\n\\\\","\r\n");
Markdig.Markdown.ToHtml(markdown_txt, this.markdownPipeline);
I am not a .net programmer, is a clojure language programmer, not installing vs, Compiling this project with msbuild.exe failed.
Now, I have a temporary NPP solution and patch.
Issue description
Markdown Literary programming for compatible codes
Markdown to reproduce
Compatible code for Markdown literary programming. Just add a custom line comment character before each line of Markdown.
In the comments of code, you can draw flowcharts, tasklist, display data visualizations image, etc.
When previewing or converting a format, you only need to simply preprocess: replace the
\r\n\\\\\
with\r\n
Note:
\\
;
when we edit the code, we can preview the effect in real time. Editing literary code has a live preview like most markdown editors.
The editor has a Live Preview panel to do the following work:
Get the current text
replace the
\r\n\;
with\r\n
live Preview markdown string
For example:
//# Markdown literary programming
//## example01:
//```csharp
////The comment of the code requires at least two line comment characters
public void PluginCleanUp()
{
}
//```
Screenshot