Markdig.SyntaxHighlighting icon indicating copy to clipboard operation
Markdig.SyntaxHighlighting copied to clipboard

How to use `Markdig.SyntaxHighlighting`?

Open it19862 opened this issue 6 years ago • 0 comments

There is:

  • the file "Code.cs", which contains the code;   Logics:
  1. Get the code from the file "Code.cs";
  2. Format the syntax;
  3. Insert the code into the file "* .rtf";  4. User. Opens the file "* .rtf", sees the formatted code (with syntax highlighting);

Objectives: Minimum: do at least some formatting of the code. Maximum: make code formatting as in VisualStruio.   Questions.

  1. How to apply your library to my task?

Code (preliminary)

public List<string> GetContetn()
        {
            string[] lines = File.ReadAllLines(@"c:\test\visualStudio\01\Code.cs");
           
            List<string> list = new List<string>(); // Результат
            for (int i = 1; i < lines.Length; i++)
            {
                if (lines[i] == "")
                    continue;
                // string[] lineParts = lines[i].Split(' ');
                list.Add(lines[i]);
            }
 
            return list;
        }

it19862 avatar Oct 03 '19 16:10 it19862