mirror of
https://github.com/knex/knex.git
synced 2025-11-03 19:29:42 +00:00
slick looking highlight.js on the code
This commit is contained in:
parent
abc4b36231
commit
5c2025c962
1
docs/assets/highlight.min.css
vendored
Normal file
1
docs/assets/highlight.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.hljs{display:block;padding:.5em;background:#f0f0f0}.hljs,.hljs-subst,.hljs-tag .hljs-title,.lisp .hljs-title,.clojure .hljs-built_in,.nginx .hljs-title{color:black}.hljs-string,.hljs-title,.hljs-constant,.hljs-parent,.hljs-tag .hljs-value,.hljs-rules .hljs-value,.hljs-rules .hljs-value .hljs-number,.hljs-preprocessor,.hljs-pragma,.haml .hljs-symbol,.ruby .hljs-symbol,.ruby .hljs-symbol .hljs-string,.hljs-aggregate,.hljs-template_tag,.django .hljs-variable,.smalltalk .hljs-class,.hljs-addition,.hljs-flow,.hljs-stream,.bash .hljs-variable,.apache .hljs-tag,.apache .hljs-cbracket,.tex .hljs-command,.tex .hljs-special,.erlang_repl .hljs-function_or_atom,.asciidoc .hljs-header,.markdown .hljs-header,.coffeescript .hljs-attribute{color:#800}.smartquote,.hljs-comment,.hljs-annotation,.hljs-template_comment,.diff .hljs-header,.hljs-chunk,.asciidoc .hljs-blockquote,.markdown .hljs-blockquote{color:#888}.hljs-number,.hljs-date,.hljs-regexp,.hljs-literal,.hljs-hexcolor,.smalltalk .hljs-symbol,.smalltalk .hljs-char,.go .hljs-constant,.hljs-change,.lasso .hljs-variable,.makefile .hljs-variable,.asciidoc .hljs-bullet,.markdown .hljs-bullet,.asciidoc .hljs-link_url,.markdown .hljs-link_url{color:#080}.hljs-label,.hljs-javadoc,.ruby .hljs-string,.hljs-decorator,.hljs-filter .hljs-argument,.hljs-localvars,.hljs-array,.hljs-attr_selector,.hljs-important,.hljs-pseudo,.hljs-pi,.haml .hljs-bullet,.hljs-doctype,.hljs-deletion,.hljs-envvar,.hljs-shebang,.apache .hljs-sqbracket,.nginx .hljs-built_in,.tex .hljs-formula,.erlang_repl .hljs-reserved,.hljs-prompt,.asciidoc .hljs-link_label,.markdown .hljs-link_label,.vhdl .hljs-attribute,.clojure .hljs-attribute,.asciidoc .hljs-attribute,.lasso .hljs-attribute,.coffeescript .hljs-property,.hljs-phony{color:#88F}.hljs-keyword,.hljs-id,.hljs-title,.hljs-built_in,.hljs-aggregate,.css .hljs-tag,.hljs-javadoctag,.hljs-phpdoc,.hljs-yardoctag,.smalltalk .hljs-class,.hljs-winutils,.bash .hljs-variable,.apache .hljs-tag,.go .hljs-typename,.tex .hljs-command,.asciidoc .hljs-strong,.markdown .hljs-strong,.hljs-request,.hljs-status{font-weight:bold}.asciidoc .hljs-emphasis,.markdown .hljs-emphasis{font-style:italic}.nginx .hljs-built_in{font-weight:normal}.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}
|
||||
1
docs/assets/highlight.min.js
vendored
Normal file
1
docs/assets/highlight.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -173,4 +173,9 @@ div.language {
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
pre code.hljs {
|
||||
background: inherit;
|
||||
margin-left: inherit;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
12
index.html
12
index.html
@ -7,6 +7,7 @@
|
||||
<link rel="canonical" href="http://knexjs.org" />
|
||||
<link rel="icon" href="docs/images/favicon.ico" />
|
||||
<link rel="stylesheet" href="/docs/assets/style.css" />
|
||||
<link rel="stylesheet" href="/docs/assets/highlight.min.css" />
|
||||
<title>Knex.js - A SQL Query Builder for Javascript</title>
|
||||
<!--
|
||||
._____. ______
|
||||
@ -1365,6 +1366,7 @@ knex.schema.dropTable('users')
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<code class="js">
|
||||
knex.schema.hasTable('users').then(function(exists) {
|
||||
if (!exists) {
|
||||
return knex.schema.createTable('users', function(t) {
|
||||
@ -1375,6 +1377,7 @@ knex.schema.hasTable('users').then(function(exists) {
|
||||
});
|
||||
}
|
||||
});
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p id="Schema-hasColumn">
|
||||
@ -2103,7 +2106,7 @@ $ npm test
|
||||
<script src="docs/assets/ga.js"></script>
|
||||
<script src="/docs/assets/jquery.min.js"></script>
|
||||
<script src="/docs/assets/jquery.cookie.js"></script>
|
||||
|
||||
<script src="/docs/assets/highlight.min.js"></script>
|
||||
<script src="/browser/deps.js"></script>
|
||||
<script src="/browser/knex.js"></script>
|
||||
<script>
|
||||
@ -2129,11 +2132,14 @@ $ npm test
|
||||
try {
|
||||
var blocks = code.split('\n\n')
|
||||
blocks[blocks.length - 1] = 'return (' + blocks[blocks.length - 1] + ').toString()';
|
||||
$(this).text(code + '\nOutputs: \n' + new Function('knex', 'trx', blocks.join('\n\n'))(dialects[dialect], trx));
|
||||
$(this).html('<code class="js">' + code + '</code>\nOutputs: \n<code class="sql">' + new Function('knex', 'trx', blocks.join('\n\n'))(dialects[dialect], trx)) + '</code>';
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
$('pre code').each(function(i, block) {
|
||||
hljs.highlightBlock(block);
|
||||
});
|
||||
};
|
||||
var currentDialect = $.cookie('dialect') || setDialect('mysql');
|
||||
|
||||
@ -2142,9 +2148,7 @@ $ npm test
|
||||
});
|
||||
$('.js-query-output').val(currentDialect);
|
||||
displayDialect(currentDialect);
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user