开发者

How to add F# syntax highlight in blog

开发者 https://www.devze.com 2022-12-25 05:26 出处:网络
I use blogger and I install a windows li开发者_开发百科ve writer, I don\'t know how to insert F# code.

I use blogger and I install a windows li开发者_开发百科ve writer, I don't know how to insert F# code.

I installed several code highlighter, none of which support ocaml or f#.


I now use VSPaste, a plugin for WLW, which can 'paste from Visual Studio' and copies the VS colors.


Get a better syntax highlighter. Alternatively, store your code in Github Gists and embed on your blog. That way, any code that Github can highlight, you can highlight.

[BTW, the tool you use to write your blog has nothing to do with your syntax highlighting woes.]


You may want to post this question on HubFS. There's more likely to be people there who know what options are available.


I think it depends on how sophisticated syntax highlighting you need. However, most of the formatters should be customizable, so you should be able to adapt them to work reasonably well with F#. On my blog, I use this formatter for C# (which is based on regular expressions), and I added my definition for the F# langauge.

Since I typically use the // comment format in blog posts and strings are formatted in the same way as in C#, I didn't have to do many changes. I only added a couple of F# operators (mostly as I needed them). I also added F# keywords which you can find in the language specification.


Since F# is somehow based on ML -- Ocaml or ML highlighter can help in most cases (except for example "//" comments).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号