Skip to content

How to use Markdig.SyntaxHighlighting? #15

@it19862

Description

@it19862

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions