-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support
console
family of code highlighters. (#375)
* Support `console` family of code highlighters. This adds support for the often used `console` language family and highlights the first line using a new custom highlighter. The rest of the code will be highlighted using json. * add console syntax documentation
- Loading branch information
Showing
10 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,12 @@ | |
<a class="headerlink" href="@Model.CrossReferenceName" title="Link to this code">¶</a> | ||
</div> | ||
} | ||
<pre><code class="[email protected]">[CONTENT]</code></pre> | ||
<pre> | ||
@if (!string.IsNullOrEmpty(Model.ApiCallHeader)) | ||
{ | ||
<code class="language-apiheader">@Model.ApiCallHeader</code> | ||
} | ||
[CONTENT] | ||
</pre> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,7 @@ | |
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/go.min.js"></script> | ||
|
||
<script src="@Model.Static("hljs.js")"></script> | ||
<script src="@Model.Static("custom.js")"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/mermaid.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
hljs.registerLanguage('apiheader', function() { | ||
return { | ||
case_insensitive: true, // language is case-insensitive | ||
keywords: 'GET POST PUT DELETE HEAD OPTIONS PATCH', | ||
contains: [ | ||
hljs.HASH_COMMENT_MODE, | ||
{ | ||
className: "subst", // (pathname: path1/path2/dothis) color #ab5656 | ||
begin: /(?<=(?:\/|GET |POST |PUT |DELETE |HEAD |OPTIONS |PATH))[^?\n\r\/]+/, | ||
} | ||
], } | ||
}) |