mirror of
https://github.com/ent/ent.git
synced 2026-05-06 01:20:56 +03:00
doc: add schema and template annotations (#657)
And add gotemplate to highlight.js as a custom language
This commit is contained in:
@@ -75,6 +75,41 @@ const siteConfig = {
|
||||
highlight: {
|
||||
// Highlight.js theme to use for syntax highlighting in code blocks.
|
||||
theme: 'androidstudio',
|
||||
hljs: function(hljs) {
|
||||
hljs.registerLanguage('gotemplate', function(hljs) {
|
||||
var GO_KEYWORDS = {
|
||||
keyword:
|
||||
'break default func interface select case map struct chan else goto package switch ' +
|
||||
'const fallthrough if range type continue for import return var go defer ' +
|
||||
'bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 ' +
|
||||
'uint16 uint32 uint64 int uint uintptr rune with define block end',
|
||||
literal:
|
||||
'true false iota nil',
|
||||
built_in: 'append cap close complex copy imag len make new panic print println real recover delete' +
|
||||
'printf fail slice dict list'
|
||||
};
|
||||
return {
|
||||
name: 'GoTemplate',
|
||||
aliases: ['gotmpl'],
|
||||
keywords: GO_KEYWORDS,
|
||||
contains: [
|
||||
hljs.COMMENT('{{-* */\\*', '\\*/ *-*}}'),
|
||||
hljs.C_LINE_COMMENT_MODE,
|
||||
{
|
||||
className: 'string',
|
||||
variants: [
|
||||
hljs.QUOTE_STRING_MODE,
|
||||
hljs.APOS_STRING_MODE,
|
||||
{begin: '`', end: '`'},
|
||||
]
|
||||
},
|
||||
{
|
||||
begin: /:=/
|
||||
},
|
||||
]
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Add custom scripts here that would be placed in <script> tags.
|
||||
|
||||
Reference in New Issue
Block a user