https://github.com/highlightjs/highlightjs-cshtml-razor
Highlight.js Razor CSHTML language repository
https://github.com/highlightjs/highlightjs-cshtml-razor
Last synced: 2 months ago
JSON representation
Highlight.js Razor CSHTML language repository
- Host: GitHub
- URL: https://github.com/highlightjs/highlightjs-cshtml-razor
- Owner: highlightjs
- License: cc0-1.0
- Created: 2018-10-08T02:02:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-25T20:53:04.000Z (over 3 years ago)
- Last Synced: 2024-04-26T03:02:51.787Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 61.5 KB
- Stars: 16
- Watchers: 5
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# CSHTML Razor - a language grammar for [highlight.js](https://highlightjs.org/)
 
 CSHTML is a markup language created by Microsoft for ASP.NET MVC, ASP.NET Core and Blazor applications. It allows to create markup containing both C# and HTML code.
For more about the CSHTML Razor syntax here: https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor.
## Usage
Simply include the `Highlight.js` library in your webpage or Node app, then load this module.
### Static website or simple usage
Simply load the module after loading Highlight.js. You'll use the minified version found in the dist directory. This module is just a CDN build of the language, so it will register itself as the Javascript is loaded.```html
hljs.highlightAll();
```
### Using directly from the UNPKG CDN
Add the following script tag in your page:
```html
```
### With Node or another build system
If you're using Node / Webpack / Rollup / Browserify, etc, simply require the language module, then register it with Highlight.js.
```javascript
var hljs = require('highlightjs');
var hljsRazor = require('highlightjs-cshtml-razor');hljs.registerLanguage("cshtml-razor", hljsRazor);
hljs.highlightAll();
```### License
[](http://creativecommons.org/publicdomain/zero/1.0/)