Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Use google-code-prettify instead of highlightjs for better performance
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jul 23, 2014
1 parent 28cce53 commit fed2165
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"core-header-panel": "Polymer/core-header-panel#master",
"context-free-parser": "Polymer/context-free-parser#master",
"marked-element": "PolymerLabs/marked-element#master",
"highlightjs-element": "PolymerLabs/highlightjs-element#master"
"prettify-element": "PolymerLabs/prettify-element#master"
}
}
29 changes: 29 additions & 0 deletions elements/core-doc-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,32 @@ pre code {
font-size: 1.2em;
}

code, pre {
color: #9f499b;
font-family: "Source Code Pro",Monaco,Menlo,Consolas,"Courier New",monospace;
}

pre .typ,pre .inline,.prettyprint .typ,.prettyprint .inline {
color: #6b499f
}
pre .pun,.prettyprint .pun {
color: #5c6bc0
}
pre .str,pre .string,.prettyprint .str,.prettyprint .string {
color: #ff4081
}
pre .pln,.prettyprint .pln {
color: #7986cb
}
pre .kwd,.prettyprint .kwd {
color: #d61a7f
}
pre .atn,pre .attribute-name,.prettyprint .atn,.prettyprint .attribute-name {
color: #6b499f
}
pre .atv,pre .attribute-value,.prettyprint .atv,.prettyprint .attribute-value {
color: #7986cb
}
pre .com,pre .comment,.prettyprint .com,.prettyprint .comment {
color: #8a8a8a
}
5 changes: 2 additions & 3 deletions elements/core-doc-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link rel="import" href="../../core-toolbar/core-toolbar.html">
<link rel="import" href="../../core-header-panel/core-header-panel.html">
<link rel="import" href="../../marked-element/marked-element.html">
<link rel="import" href="../../highlightjs-element/highlightjs-element.html">
<link rel="import" href="../../prettify-element/prettify-import.html">
<link rel="import" href="../../context-free-parser/context-free-parser.html">

<!--
Expand All @@ -26,7 +26,6 @@

<template>

<link rel="stylesheet" href="../../highlightjs/styles/default.css">
<link rel="stylesheet" href="core-doc-page.css">

<core-header-panel id="panel" mode="waterfall">
Expand Down Expand Up @@ -136,7 +135,7 @@ <h1 style="font-size: 52px; color: #E91E63;">
Polymer('core-doc-page', {

hilight: function(event, detail, sender) {
detail.code = hljs.highlightAuto(detail.code).value;
detail.code = prettyPrintOne((detail.code || '').replace(/</g,'&lt;').replace(/>/g,'&gt;'));
},

homepageFilter: function(data) {
Expand Down

0 comments on commit fed2165

Please sign in to comment.