Fix for google-code-prettify w/ c#

前端 未结 4 1180
忘掉有多难
忘掉有多难 2021-02-07 09:19

Prettify gives types and methods the same class when tokenizing c# so they are colored the same. This is because methods are pascal case in c# instead of camel case like in java

4条回答
  •  一向
    一向 (楼主)
    2021-02-07 10:03

    TextMate (OS X) or E-TextEditor (Windows)

    TextMate/E-TextEditor will generate HTML & CSS from syntax highlighting for many, many languages.

    Here is what you do:

    1. Open the file in TextMate/E-TextEditor
    2. Select the language from the menu at the bottom of the screen if it doesn't choose it automatically
    3. Go to Bundles->TextMate->Create HTML From Document
      • This will create all the HTMl/CSS in a new document.
      • Note: Windows users also choose the 'TextMate' bundle (not 'E-TextEditor')
    4. Profit!

    Note: You will have to install the C# bundle for C# syntax (every other common language is included). To do this, install the "Get Bundles" bundle, and use that to install the C# bundle.

    EDIT: Reading the comments I realized TextMate is only a solution for Mac users. Sometimes I forget about Windows.

    You can also use E-TextEditor for Windows. The steps are the same.

提交回复
热议问题