highlightjs-cshtml-razor
Advanced tools
Comparing version 2.0.1 to 2.1.0
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
## [2.1.0] - 2021-04-14 | ||
- Add the dist directory, and a minified version of the script | ||
## [2.0.1] - 2021-03-02 | ||
@@ -5,0 +8,0 @@ ### Fixed |
{ | ||
"name": "highlightjs-cshtml-razor", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "highlight.js syntax definition for ASP.NET Razor CSHTML language", | ||
"main": "cshtml-razor.js", | ||
"main": "src/languages/cshtml-razor.js", | ||
"scripts": { | ||
@@ -13,8 +13,6 @@ "test": "./node_modules/.bin/mocha --reporter spec" | ||
}, | ||
"files": [ | ||
"cshtml-razor.js" | ||
], | ||
"keywords": [ | ||
"cshtml", | ||
"cshtml-razor", | ||
"cshtml-blazor", | ||
"razor-cshtml", | ||
@@ -28,3 +26,4 @@ "razor", | ||
"c#", | ||
"csharp" | ||
"csharp", | ||
"blazor" | ||
], | ||
@@ -38,7 +37,9 @@ "author": "RomanResh", | ||
"devDependencies": { | ||
"highlight.js": "^10.0.0", | ||
"highlight.js": "^10.7.2", | ||
"mocha": "^5.2.0", | ||
"should": "^13.2.3" | ||
}, | ||
"dependencies": {} | ||
"dependencies": { | ||
"minimist": "^1.2.5" | ||
} | ||
} |
@@ -1,18 +0,20 @@ | ||
`highlight.js` syntax definition for Razor CSHTML. | ||
# CSHTML Razor - a language grammar for [highlight.js](https://highlightjs.org/) | ||
For more about highlight.js, see https://highlightjs.org/ | ||
  | ||
  | ||
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. | ||
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 | ||
## Usage | ||
Simply include the `highlight.js` script package in your webpage or node app, load up this module and apply it to `hljs`. | ||
Simply include the `Highlight.js` library in your webpage or Node app, then load this module. | ||
If you're not using a build system and just want to embed this in your webpage: | ||
### 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 | ||
<script src="/path/to/highlight.js/highlight.pack.js"></script> | ||
<script src="/path/to/highlightjs-cshtml-razor/cshtml-razor.js"></script> | ||
<script type="text/javascript" src="/path/to/highlight.min.js"></script> | ||
<script type="text/javascript" src="/path/to/highlightjs-cshtml-razor/dist/cshtml-razor.min.js"></script> | ||
<script> | ||
@@ -24,9 +26,19 @@ hljs.registerLanguage('cshtml-razor', window.hljsDefineCshtmlRazor); | ||
If you're using webpack / rollup / browserify / node: | ||
### Using directly from the UNPKG CDN | ||
Add the following script tag in your page: | ||
```html | ||
<script type="text/javascript" src="https://unpkg.com/highlightjs-cshtml-razor/dist/cshtml-razor.min.js"></script> | ||
``` | ||
### 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('highlight.js'); | ||
var hljsDefineCshtmlRazor = require('highlightjs-cshtml-razor'); | ||
var hljs = require('highlightjs'); | ||
var hljsRazor = require('highlightjs-cshtml-razor'); | ||
hljsDefineCshtmlRazor(hljs); | ||
hljs.registerLanguage("highlightjs-cshtml-razor", hljsRazor); | ||
hljs.initHighlightingOnLoad(); | ||
@@ -33,0 +45,0 @@ ``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
40444
20
516
48
1
1
1
+ Addedminimist@^1.2.5
+ Addedminimist@1.2.8(transitive)