{"id":18718511,"url":"https://github.com/highlightjs/highlightjs-cshtml-razor","last_synced_at":"2025-04-12T13:33:58.065Z","repository":{"id":52848410,"uuid":"152004885","full_name":"highlightjs/highlightjs-cshtml-razor","owner":"highlightjs","description":"Highlight.js Razor CSHTML language repository","archived":false,"fork":false,"pushed_at":"2022-02-25T20:53:04.000Z","size":63,"stargazers_count":16,"open_issues_count":6,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-26T03:02:51.787Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/highlightjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-08T02:02:28.000Z","updated_at":"2024-02-24T12:50:29.000Z","dependencies_parsed_at":"2022-08-23T09:01:32.330Z","dependency_job_id":null,"html_url":"https://github.com/highlightjs/highlightjs-cshtml-razor","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-cshtml-razor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-cshtml-razor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-cshtml-razor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-cshtml-razor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/highlightjs","download_url":"https://codeload.github.com/highlightjs/highlightjs-cshtml-razor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573661,"owners_count":21126879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T13:21:41.157Z","updated_at":"2025-04-12T13:33:53.056Z","avatar_url":"https://github.com/highlightjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSHTML Razor - a language grammar for [highlight.js](https://highlightjs.org/)\r\n\r\n![version](https://badgen.net/npm/v/highlightjs-cshtml-razor) ![license](https://badgen.net/badge/license/CC0%201.0/blue)\r\n![install size](https://badgen.net/packagephobia/install/highlightjs-cshtml-razor) ![minified size](https://badgen.net/bundlephobia/min/highlightjs-cshtml-razor)\r\n\r\nCSHTML 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.\r\n\r\nFor more about the CSHTML Razor syntax here: https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor.\r\n\r\n## Usage\r\n\r\nSimply include the `Highlight.js` library in your webpage or Node app, then load this module.\r\n\r\n### Static website or simple usage\r\nSimply 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.\r\n\r\n```html\r\n\u003cscript type=\"text/javascript\" src=\"/path/to/highlight.min.js\"\u003e\u003c/script\u003e\r\n\u003cscript type=\"text/javascript\" src=\"/path/to/highlightjs-cshtml-razor/dist/cshtml-razor.min.js\"\u003e\u003c/script\u003e\r\n\u003cscript\u003e\r\n    hljs.highlightAll();\r\n\u003c/script\u003e\r\n```\r\n\r\n### Using directly from the UNPKG CDN\r\n\r\nAdd the following script tag in your page:\r\n\r\n```html\r\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/highlightjs-cshtml-razor/dist/cshtml-razor.min.js\"\u003e\u003c/script\u003e\r\n```\r\n\r\n### With Node or another build system\r\n\r\nIf you're using Node / Webpack / Rollup / Browserify, etc, simply require the language module, then register it with Highlight.js.\r\n   \r\n```javascript\r\nvar hljs = require('highlightjs');\r\nvar hljsRazor = require('highlightjs-cshtml-razor');\r\n\r\nhljs.registerLanguage(\"cshtml-razor\", hljsRazor);\r\nhljs.highlightAll();\r\n```\r\n\r\n### License\r\n\r\n[![License: CC0-1.0](https://img.shields.io/badge/License-CC0%201.0-lightgrey.svg)](http://creativecommons.org/publicdomain/zero/1.0/)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighlightjs%2Fhighlightjs-cshtml-razor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhighlightjs%2Fhighlightjs-cshtml-razor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighlightjs%2Fhighlightjs-cshtml-razor/lists"}