Skip to content

Commit

Permalink
Version 0.1. Very rough. Content incomplete. No styling yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayliu50 committed Jul 15, 2017
1 parent e83747e commit 42ad9e0
Show file tree
Hide file tree
Showing 19 changed files with 4,701 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.idea/*
dist/*
.tmp/
tmp/*
node_modules/*
Expand Down
8 changes: 4 additions & 4 deletions app/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ doctype html
html(lang="en")
head
title QMK Cheatsheet
script(src='/bower/prism/prism.js')
script(src='/bower/prism/components/prism-c.js')
link(rel='stylesheet', href='/styles/vendor.css')
link(rel='stylesheet', href='/styles/app.css')
script(src='bower/prism/prism.js')
script(src='bower/prism/components/prism-c.js')
link(rel='stylesheet', href='styles/vendor.css')
link(rel='stylesheet', href='styles/app.css')

body
h1 QMK Cheatsheet
Expand Down
33 changes: 33 additions & 0 deletions dist/bower/prism/components/prism-c.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Prism.languages.c = Prism.languages.extend('clike', {
'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i
});

Prism.languages.insertBefore('c', 'string', {
'macro': {
// allow for multiline macro definitions
// spaces after the # character compile fine with gcc
pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
lookbehind: true,
alias: 'property',
inside: {
// highlight the path of the include statement as a string
'string': {
pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,
lookbehind: true
},
// highlight macro directives as keywords
'directive': {
pattern: /(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,
lookbehind: true,
alias: 'keyword'
}
}
},
// highlight predefined macros as constants
'constant': /\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/
});

delete Prism.languages.c['class-name'];
delete Prism.languages.c['boolean'];
Loading

0 comments on commit 42ad9e0

Please sign in to comment.