Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions styleguide/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
source 'https://rubygems.org'

gem 'hologram', '~> 1.4.0'
gem 'rouge', '>= 2.0.6'
gem 'pry'
gem 'rspec'
gem 'capybara'
Expand Down
9 changes: 5 additions & 4 deletions styleguide/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ GEM
coderay (1.1.1)
diff-lcs (1.2.5)
execjs (2.7.0)
ffi (1.9.14)
ffi (1.9.17)
hologram (1.4.0)
redcarpet (>= 2.2, < 4.0)
rouge (>= 1.5)
Expand All @@ -29,7 +29,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
nokogiri (1.6.8.1)
nokogiri (1.7.0.1)
mini_portile2 (~> 2.1.0)
pry (0.10.4)
coderay (~> 1.1.0)
Expand All @@ -39,7 +39,7 @@ GEM
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
redcarpet (3.3.4)
redcarpet (3.4.0)
rouge (2.0.7)
rspec (3.5.0)
rspec-core (~> 3.5.0)
Expand All @@ -55,7 +55,7 @@ GEM
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubyzip (1.2.0)
selenium-webdriver (3.0.4)
selenium-webdriver (3.0.5)
childprocess (~> 0.5)
rubyzip (~> 1.0)
websocket (~> 1.0)
Expand All @@ -73,6 +73,7 @@ DEPENDENCIES
capybara
hologram (~> 1.4.0)
pry
rouge (>= 2.0.6)
rspec
selenium-webdriver

Expand Down
4 changes: 2 additions & 2 deletions styleguide/hologram/code_example_renderers/jsx_renderer.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'babel/transpiler'

Hologram::CodeExampleRenderer::Factory.define 'jsx' do
example_template 'js_example_template'
example_template 'jsx_example_template'

lexer { Rouge::Lexer.find(:js) }
lexer { Rouge::Lexer.find(:jsx) }

rendered_example do |code|
Babel::Transpiler.transform(code.strip)["code"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script type='text/jsx'><%= rendered_example %></script>
<div class="codeBlock jsExample" aria-hidden="true">
<div class="codeBlock jsxExample" aria-hidden="true">
<div class="highlight" data-code-to-copy>
<pre><%= code_example %></pre>
</div>
Expand Down
2 changes: 0 additions & 2 deletions styleguide/hologram/css_critic_test_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class CssCriticTestGenerator < Hologram::Plugin
<link rel="stylesheet" href="components.css">
<link rel="stylesheet" href="styleguide/styleguide.css">
<link rel="stylesheet" href="styleguide/github.css">
<link rel="stylesheet" disabled href="prismjs/prism.css">
<link rel="stylesheet" href="prismjs/prism-okaidia.css">
</head>
<body class="pam">
eos
Expand Down
3 changes: 1 addition & 2 deletions styleguide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"pui-css-typography": "file:../library/dist/css/typography",
"pui-css-vertical-alignment": "file:../library/dist/css/vertical-alignment",
"pui-css-whitespace": "file:../library/dist/css/whitespace",
"pui-prismjs": "0.0.1",
"pui-prismjs": "file:../library/src/pivotal-ui/prismjs",
"pui-react-alerts": "file:../library/dist/react/alerts",
"pui-react-autocomplete": "file:../library/dist/react/autocomplete",
"pui-react-back-to-top": "file:../library/dist/react/back-to-top",
Expand Down Expand Up @@ -138,7 +138,6 @@
"phantomjs": "^1.9.17",
"phantomjs-polyfill": "0.0.2",
"postcss-cssnext": "^2.9.0",
"prismjs": "^1.3.0",
"react-dom": "^15.0.1",
"require-dir": "^0.3.0",
"run-sequence": "^1.1.4",
Expand Down
16 changes: 1 addition & 15 deletions styleguide/src/styleguide.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
'use strict';
var $ = require('jquery');


/* Stylesheet swappin */
$(document).ready(function(){
$('input.alternate-css').change(function() {
if($(this).get(0).checked) {
$("link[href*='prism-okaida.css']").attr('disabled', 'disabled');
$("link[href*='prism-default.css']").removeAttr('disabled');
} else {
$("link[href*='prism-okaida.css']").removeAttr('disabled');
$("link[href*='prism-default.css']").attr('disabled', 'disabled');
}
});
});

/* Adjust scrollTop when navigating to a subsection on the current page */

$(document).ready(function() {
Expand All @@ -24,7 +10,7 @@ $(document).ready(function() {
window.history.pushState('', '', e.target.hash);
$('body, html').animate({
scrollTop: desiredScrollPosition
}, 500, function () {
}, 500, function() {
$target.focus();
});
return false;
Expand Down