Skip to content

prettify code blocks for api site #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
44 changes: 44 additions & 0 deletions themes/jquery/css/prettify.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Pretty printing styles. Used with prettify.js. */

.str { color: #080; }
.kwd { color: #008; }
.com { color: #800; }
.typ { color: #606; }
.lit { color: #066; }
.pun { color: #660; }
.pln { color: #000; }
.tag { color: #008; }
.atn { color: #606; }
.atv { color: #080; }
.dec { color: #606; }
pre.prettyprint { padding: 2px; border: 1px solid #888 }

/* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 { list-style-type: none }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 { background: #eee }

@media print {
.str { color: #060; }
.kwd { color: #006; font-weight: bold; }
.com { color: #600; font-style: italic; }
.typ { color: #404; font-weight: bold; }
.lit { color: #044; }
.pun { color: #440; }
.pln { color: #000; }
.tag { color: #006; font-weight: bold; }
.atn { color: #404; }
.atv { color: #060; }
}
11 changes: 9 additions & 2 deletions themes/jquery/footer.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php
$site = str_replace(".", "-", str_replace("https://", "", str_replace("http://", "", home_url())));
?>
</div>
<!-- /container -->

<!-- footer -->
<footer id="site-footer" class="clearfix">

<div class="constrain">

<?php // get_sidebar( 'footer' ); ?>
<?php // get_sidebar( 'footer' ); ?>

<div class="col7-3 col">
<h3><span>Quick Access</span></h3>
Expand Down Expand Up @@ -98,6 +100,11 @@

<script src="<?php echo get_template_directory_uri(); ?>/js/plugins/jquery.ba-outside-events.min.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/js/plugins.js"></script>

<?php if ( is_single() && stristr($site, 'api')) { ?>
<script src="<?php echo get_template_directory_uri(); ?>/js/prettify.js"></script>
<?php } ?>

<script src="<?php echo get_template_directory_uri(); ?>/js/scripts.js"></script>

<!-- /scripts -->
Expand Down
82 changes: 43 additions & 39 deletions themes/jquery/header.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
global $sidebar;
$sidebar = "sidebar-right";
$site = str_replace(".", "-", str_replace("https://", "", str_replace("http://", "", home_url())));
Expand All @@ -23,13 +23,13 @@
$tlsite = "qunitjs";
}
?>
<!DOCTYPE html>
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="no-js ie6 <?php echo $site . " " . $tlsite; ?>" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7 <?php echo $site . " " . $tlsite; ?>" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8 <?php echo $site . " " . $tlsite; ?>" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 9 ]> <html class="no-js ie9 <?php echo $site . " " . $tlsite; ?>" <?php language_attributes(); ?>> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js <?php echo $site . " " . $tlsite; ?>" <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
Expand All @@ -41,64 +41,68 @@
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
?></title>
<meta name="author" content="The jQuery Project - jQuery.org">
<meta name="description" content="jQuery: The Write Less, Do More, JavaScript Library">
?></title>

<meta name="author" content="The jQuery Project - jQuery.org">
<meta name="description" content="jQuery: The Write Less, Do More, JavaScript Library">

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/i/favicon.ico">
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/style.css?v=1">
<?php if (stristr($site, "api")) { ?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/prettify.css?v=1">
<?php } ?>
<link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>">

<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />

<script src="<?php echo get_template_directory_uri(); ?>/js/modernizr.custom.2.0.6.min.js"></script>
<!--[if (gte IE 6)&(lte IE 8)]>
<script src="<?php echo get_template_directory_uri(); ?>/js/selectivizr.js"></script>
<![endif]-->

<?php
<?php
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
wp_head();

wp_head();
?>

</head>
</head>
<body <?php body_class(); ?>>

<!-- projects -->
<div class="project-select">
<ul class="constrain">
<ul class="constrain">
<li>
<a href="http://jquery.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-jquery.png" alt="jQuery" />
<em>The core JS framework that allows you to write less, do more.</em>
<a href="http://jquery.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-jquery.png" alt="jQuery" />
<em>The core JS framework that allows you to write less, do more.</em>
</a>
</li>
</li>
<li>
<a href="http://jqueryui.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-ui.png" alt="jQuery UI" />
<em>The officially supported User Interface library for jQuery.</em>
<a href="http://jqueryui.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-ui.png" alt="jQuery UI" />
<em>The officially supported User Interface library for jQuery.</em>
</a>
</li>
</li>
<li>
<a href="http://jquerymobile.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-mobile.png" alt="jQuery Mobile">
<em>Build mobile web apps with jQuery using this framework.</em>
<a href="http://jquerymobile.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-mobile.png" alt="jQuery Mobile">
<em>Build mobile web apps with jQuery using this framework.</em>
</a>
</li>
</li>
<li>
<a href="http://sizzlejs.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-sizzlejs.png" alt="SizzleJS" />
<em>A smoking fast CSS selector engine for JavaScript.</em>
<a href="http://sizzlejs.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-sizzlejs.png" alt="SizzleJS" />
<em>A smoking fast CSS selector engine for JavaScript.</em>
</a>
</li>
</li>
<li>
<a href="http://qunitjs.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-qunitjs.png" alt="QUnit" />
<em>Write solid JavaScript apps by unit testing with QUnit.</em>
<a href="http://qunitjs.com/" title="" class="" tabindex="-1">
<img src="<?php echo get_template_directory_uri(); ?>/i/logo-top-qunitjs.png" alt="QUnit" />
<em>Write solid JavaScript apps by unit testing with QUnit.</em>
</a>
</li>
</ul>
Expand All @@ -107,7 +111,7 @@

<!-- nav -->
<header class="border clearfix">

<nav class="constrain clearfix top">
<ul class="projects">
<li class="jquery"><a href="http://jquery.com/" title="jQuery">jQuery</a></li>
Expand Down Expand Up @@ -153,24 +157,24 @@
</li>
</ul>
</nav>

</header>
<!-- /nav -->

<!-- container -->
<div id="container" class="constrain">
<!-- container -->
<div id="container" class="constrain">

<!-- header -->
<header class="clearfix">

<!-- logo -->
<h1 class="site-title"><a href="/" title="<?php bloginfo( 'name' ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<!-- /logo -->

<!-- ads or events -->
<aside></aside>
<!-- /ads or events -->



<!-- secondary nav -->
Expand Down
Loading