Install Prism via npm

This also splits out the freeipa commands into a separate file for easy
maintenance.

Fixes #7
parent 02c4d95d
Pipeline #56199930 passed with stages
in 1 minute and 24 seconds
......@@ -23,18 +23,35 @@ module.exports = function(grunt) {
src: ['*.css', '!*.min.css'],
dest: 'build/html/_static/css',
ext: '.min.css'
},
{
expand: true,
cwd: 'node_modules/prismjs/themes',
src: ['prism.css', 'prism-okaidia.css'],
dest: 'build/html/_static/css',
ext: '.min.css'
}]
}
},
uglify: {
js: {
cwd: 'source/_static/js',
expand: true,
src: ['**/*.js'],
dest: 'build/html/_static/js',
rename: function (dst, src) {
return dst + '/' + src.replace('.js', '.min.js');
}
target: {
files: [{
cwd: 'source/_static/js',
expand: true,
src: ['**/*.js'],
dest: 'build/html/_static/js',
rename: function (dst, src) {
return dst + '/' + src.replace('.js', '.min.js');
}
}, {
cwd: 'node_modules/prismjs',
expand: true,
src: ['prism.js', 'components/prism-bash.js', 'components/prism-docker.js'],
dest: 'build/html/_static/js',
rename: function (dst, src) {
return dst + '/' + src.replace('.js', '.min.js');
}
}]
}
},
imagemin: {
......
......@@ -709,6 +709,17 @@
"source-map": "~0.6.0"
}
},
"clipboard": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz",
"integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==",
"optional": true,
"requires": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"clone-response": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
......@@ -1138,6 +1149,12 @@
}
}
},
"delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
"optional": true
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
......@@ -1918,6 +1935,15 @@
}
}
},
"good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
"optional": true,
"requires": {
"delegate": "^3.1.2"
}
},
"got": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz",
......@@ -3511,6 +3537,14 @@
"number-is-nan": "^1.0.0"
}
},
"prismjs": {
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.16.0.tgz",
"integrity": "sha512-OA4MKxjFZHSvZcisLGe14THYsug/nF6O1f0pAJc0KN0wTyAcLqmsbE+lTGKSpyh+9pEW57+k6pg2AfYR+coyHA==",
"requires": {
"clipboard": "^2.0.0"
}
},
"process-nextick-args": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
......@@ -3732,6 +3766,12 @@
}
}
},
"select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
"optional": true
},
"semver": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
......@@ -4308,6 +4348,12 @@
"integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=",
"dev": true
},
"tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
"optional": true
},
"to-buffer": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz",
......
......@@ -3,7 +3,9 @@
"version": "1.4.0",
"description": "[![Build Status](https://travis-ci.org/remyabel/linux-guide-and-hints.svg?branch=master)](https://travis-ci.org/remyabel/linux-guide-and-hints)",
"main": "Gruntfile.js",
"dependencies": {},
"dependencies": {
"prismjs": "^1.16.0"
},
"devDependencies": {
"grunt": "^1.0.4",
"grunt-contrib-connect": "^1.0.2",
......
/* PrismJS 1.14.0
http://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+bash+perl+powershell&plugins=line-numbers */
/**
* okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
* @author ocodia
*/
code[class*="language-"],
pre[class*="language-"] {
color: #f8f8f2;
background: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border-radius: 0.3em;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #272822;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #f8f8f2;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
color: #f92672;
}
.token.boolean,
.token.number {
color: #ae81ff;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a6e22e;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: #f8f8f2;
}
.token.atrule,
.token.attr-value,
.token.function {
color: #e6db74;
}
.token.keyword {
color: #66d9ef;
}
.token.regex,
.token.important {
color: #fd971f;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
pre.line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre.line-numbers > code {
position: relative;
white-space: inherit;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
Prism.languages.shell = Prism.languages.extend('shell', {
'function': [
Prism.languages.shell['function'],
{
pattern: /(^|[\s;|&])(ipa[ -]?)(?:automember-add|automember-add-condition|automember-default-group-remove|automember-default-group-set|automember-default-group-show|automember-del|automember-find|automember-find-orphans|automember-mod|automember-rebuild|automember-remove-condition|automember-show|automountkey-add|automountkey-del|automountkey-find|automountkey-mod|automountkey-show|automountlocation-add|automountlocation-del|automountlocation-find|automountlocation-import|automountlocation-show|automountlocation-tofiles|automountmap-add|automountmap-add-indirect|automountmap-del|automountmap-find|automountmap-mod|automountmap-show|ca-add|ca-del|ca-disable|ca-enable|ca-find|ca-mod|ca-show|caacl-add|caacl-add-ca|caacl-add-host|caacl-add-profile|caacl-add-service|caacl-add-user|caacl-del|caacl-disable|caacl-enable|caacl-find|caacl-mod|caacl-remove-ca|caacl-remove-host|caacl-remove-profile|caacl-remove-service|caacl-remove-user|caacl-show|cert-find|cert-remove-hold|cert-request|cert-revoke|cert-show|cert-status|certmap-match|certmapconfig-mod|certmapconfig-show|certmaprule-add|certmaprule-del|certmaprule-disable|certmaprule-enable|certmaprule-find|certmaprule-mod|certmaprule-show|certprofile-del|certprofile-find|certprofile-import|certprofile-mod|certprofile-show|class-find|class-show|command-find|command-show|config-mod|config-show|console|delegation-add|delegation-del|delegation-find|delegation-mod|delegation-show|dns-update-system-records|dnsconfig-mod|dnsconfig-show|dnsforwardzone-add|dnsforwardzone-add-permission|dnsforwardzone-del|dnsforwardzone-disable|dnsforwardzone-enable|dnsforwardzone-find|dnsforwardzone-mod|dnsforwardzone-remove-permission|dnsforwardzone-show|dnsrecord-add|dnsrecord-del|dnsrecord-find|dnsrecord-mod|dnsrecord-show|dnsserver-find|dnsserver-mod|dnsserver-show|dnszone-add|dnszone-add-permission|dnszone-del|dnszone-disable|dnszone-enable|dnszone-find|dnszone-mod|dnszone-remove-permission|dnszone-show|domainlevel-get|domainlevel-set|env|group-add|group-add-member|group-del|group-detach|group-find|group-mod|group-remove-member|group-show|hbacrule-add|hbacrule-add-host|hbacrule-add-service|hbacrule-add-user|hbacrule-del|hbacrule-disable|hbacrule-enable|hbacrule-find|hbacrule-mod|hbacrule-remove-host|hbacrule-remove-service|hbacrule-remove-user|hbacrule-show|hbacsvc-add|hbacsvc-del|hbacsvc-find|hbacsvc-mod|hbacsvc-show|hbacsvcgroup-add|hbacsvcgroup-add-member|hbacsvcgroup-del|hbacsvcgroup-find|hbacsvcgroup-mod|hbacsvcgroup-remove-member|hbacsvcgroup-show|hbactest|help|host-add|host-add-cert|host-add-managedby|host-add-principal|host-allow-create-keytab|host-allow-retrieve-keytab|host-del|host-disable|host-disallow-create-keytab|host-disallow-retrieve-keytab|host-find|host-mod|host-remove-cert|host-remove-managedby|host-remove-principal|host-show|hostgroup-add|hostgroup-add-member|hostgroup-del|hostgroup-find|hostgroup-mod|hostgroup-remove-member|hostgroup-show|idoverridegroup-add|idoverridegroup-del|idoverridegroup-find|idoverridegroup-mod|idoverridegroup-show|idoverrideuser-add|idoverrideuser-add-cert|idoverrideuser-del|idoverrideuser-find|idoverrideuser-mod|idoverrideuser-remove-cert|idoverrideuser-show|idrange-add|idrange-del|idrange-find|idrange-mod|idrange-show|idview-add|idview-apply|idview-del|idview-find|idview-mod|idview-show|idview-unapply|krbtpolicy-mod|krbtpolicy-reset|krbtpolicy-show|location-add|location-del|location-find|location-mod|location-show|migrate-ds|netgroup-add|netgroup-add-member|netgroup-del|netgroup-find|netgroup-mod|netgroup-remove-member|netgroup-show|otpconfig-mod|otpconfig-show|otptoken-add|otptoken-add-managedby|otptoken-add-yubikey|otptoken-del|otptoken-find|otptoken-mod|otptoken-remove-managedby|otptoken-show|otptoken-sync|output-find|output-show|param-find|param-show|passwd|permission-add|permission-del|permission-find|permission-mod|permission-show|ping|pkinit-status|plugins|privilege-add|privilege-add-permission|privilege-del|privilege-find|privilege-mod|privilege-remove-permission|privilege-show|pwpolicy-add|pwpolicy-del|pwpolicy-find|pwpolicy-mod|pwpolicy-show|radiusproxy-add|radiusproxy-del|radiusproxy-find|radiusproxy-mod|radiusproxy-show|realmdomains-mod|realmdomains-show|role-add|role-add-member|role-add-privilege|role-del|role-find|role-mod|role-remove-member|role-remove-privilege|role-show|selfservice-add|selfservice-del|selfservice-find|selfservice-mod|selfservice-show|selinuxusermap-add|selinuxusermap-add-host|selinuxusermap-add-user|selinuxusermap-del|selinuxusermap-disable|selinuxusermap-enable|selinuxusermap-find|selinuxusermap-mod|selinuxusermap-remove-host|selinuxusermap-remove-user|selinuxusermap-show|server-del|server-find|server-mod|server-role-find|server-role-show|server-show|service-add|service-add-cert|service-add-host|service-add-principal|service-allow-create-keytab|service-allow-retrieve-keytab|service-del|service-disable|service-disallow-create-keytab|service-disallow-retrieve-keytab|service-find|service-mod|service-remove-cert|service-remove-host|service-remove-principal|service-show|servicedelegationrule-add|servicedelegationrule-add-member|servicedelegationrule-add-target|servicedelegationrule-del|servicedelegationrule-find|servicedelegationrule-remove-member|servicedelegationrule-remove-target|servicedelegationrule-show|servicedelegationtarget-add|servicedelegationtarget-add-member|servicedelegationtarget-del|servicedelegationtarget-find|servicedelegationtarget-remove-member|servicedelegationtarget-show|show-mappings|stageuser-activate|stageuser-add|stageuser-add-cert|stageuser-add-certmapdata|stageuser-add-manager|stageuser-add-principal|stageuser-del|stageuser-find|stageuser-mod|stageuser-remove-cert|stageuser-remove-certmapdata|stageuser-remove-manager|stageuser-remove-principal|stageuser-show|sudocmd-add|sudocmd-del|sudocmd-find|sudocmd-mod|sudocmd-show|sudocmdgroup-add|sudocmdgroup-add-member|sudocmdgroup-del|sudocmdgroup-find|sudocmdgroup-mod|sudocmdgroup-remove-member|sudocmdgroup-show|sudorule-add|sudorule-add-allow-command|sudorule-add-deny-command|sudorule-add-host|sudorule-add-option|sudorule-add-runasgroup|sudorule-add-runasuser|sudorule-add-user|sudorule-del|sudorule-disable|sudorule-enable|sudorule-find|sudorule-mod|sudorule-remove-allow-command|sudorule-remove-deny-command|sudorule-remove-host|sudorule-remove-option|sudorule-remove-runasgroup|sudorule-remove-runasuser|sudorule-remove-user|sudorule-show|topic-find|topic-show|topologysegment-add|topologysegment-del|topologysegment-find|topologysegment-mod|topologysegment-reinitialize|topologysegment-show|topologysuffix-find|topologysuffix-show|topologysuffix-verify|trust-add|trust-del|trust-fetch-domains|trust-find|trust-mod|trust-show|trustconfig-mod|trustconfig-show|trustdomain-del|trustdomain-disable|trustdomain-enable|trustdomain-find|user-add|user-add-cert|user-add-certmapdata|user-add-manager|user-add-principal|user-del|user-disable|user-enable|user-find|user-mod|user-remove-cert|user-remove-certmapdata|user-remove-manager|user-remove-principal|user-show|user-stage|user-status|user-undel|user-unlock|vault-add|vault-add-member|vault-add-owner|vault-archive|vault-del|vault-find|vault-mod|vault-remove-member|vault-remove-owner|vault-retrieve|vault-show|vaultconfig-show|vaultcontainer-add-owner|vaultcontainer-del|vaultcontainer-remove-owner|vaultcontainer-show)(?=$|[\s;|&])/,
lookbehind: true
}
]
});
This diff is collapsed.
{% extends "!layout.html" %}
{% set script_files = script_files + [
'_static/js/prism.min.js'
'_static/js/prism.min.js',
'_static/js/components/prism-bash.min.js',
'_static/js/components/prism-docker.min.js',
'_static/js/prism-freeipa.min.js'
] %}
{% set css_files = css_files + [
'_static/css/prism.min.css',
'_static/css/prism-okaidia.min.css',
'_static/css/style.min.css'
] %}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment