Skip to content

Commit a9d2ad6

Browse files
committed
init
1 parent 9dbbf4a commit a9d2ad6

File tree

3 files changed

+458
-0
lines changed

3 files changed

+458
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
`highlight.js` syntax definition for Razor CSHTML.
2+
3+
For more about highlight.js, see https://highlightjs.org/
4+
5+
CSHTML is a markup language created by Microsoft for ASP.NET MVC and ASP.NET Core applications. It allows to create markup containing both C# and HTML code.
6+
7+
For more about the CSHTML Razor syntax here: https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor.
8+
9+
### Usage
10+
11+
Simply include the `highlight.js` script package in your webpage or node app, load up this module and apply it to `hljs`.
12+
13+
If you're not using a build system and just want to embed this in your webpage:
14+
15+
```html
16+
<script type="text/javascript" src="/path/to/highlight.pack.js"></script>
17+
<script type="text/javascript" src="/path/to/highlightjs-cshtml-razor/cshtml.js"></script>
18+
<script type="text/javascript">
19+
hljs.registerLanguage('cshtml-razor', window.hljsDefineRazorCshtml);
20+
hljs.initHighlightingOnLoad();
21+
</script>
22+
```
23+
24+
If you're using webpack / rollup / browserify / node:
25+
26+
```javascript
27+
var hljs = require('highlightjs');
28+
var hljsDefineRazorCshtml = require('highlightjs-cshtml-razor');
29+
30+
hljsDefineRazorCshtml(hljs);
31+
hljs.initHighlightingOnLoad();
32+
```
33+
34+
### License
35+
36+
[![License: CC0-1.0](https://img.shields.io/badge/License-CC0%201.0-lightgrey.svg)](http://creativecommons.org/publicdomain/zero/1.0/)

0 commit comments

Comments
 (0)