diff --git a/.gitignore b/.gitignore index 68a68305bf9..3d7868e302c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ .sass-cache .gist-cache .pygments-cache +.code-highlighter-cache +Gemfile.lock _deploy public sass.old diff --git a/.themes/classic/sass/_base.scss b/.themes/classic/sass/_base.scss index 05fdd005cbe..acac463832a 100644 --- a/.themes/classic/sass/_base.scss +++ b/.themes/classic/sass/_base.scss @@ -1,5 +1,5 @@ @import "base/utilities"; -@import "base/solarized"; +@import "base/solarized/index"; @import "base/theme"; @import "base/typography"; @import "base/layout"; diff --git a/.themes/classic/sass/_partials.scss b/.themes/classic/sass/_partials.scss index 99c28b6378c..f90a9c69fa1 100644 --- a/.themes/classic/sass/_partials.scss +++ b/.themes/classic/sass/_partials.scss @@ -2,7 +2,6 @@ @import "partials/navigation"; @import "partials/blog"; @import "partials/sharing"; -@import "partials/syntax"; @import "partials/archive"; @import "partials/sidebar"; @import "partials/footer"; diff --git a/.themes/classic/sass/base/_solarized.scss b/.themes/classic/sass/base/_solarized.scss deleted file mode 100644 index 45d8fc5eff3..00000000000 --- a/.themes/classic/sass/base/_solarized.scss +++ /dev/null @@ -1,46 +0,0 @@ -$base03: #002b36 !default; //darkest blue -$base02: #073642 !default; //dark blue -$base01: #586e75 !default; //darkest gray -$base00: #657b83 !default; //dark gray -$base0: #839496 !default; //medium gray -$base1: #93a1a1 !default; //medium light gray -$base2: #eee8d5 !default; //cream -$base3: #fdf6e3 !default; //white -$solar-yellow: #b58900 !default; -$solar-orange: #cb4b16 !default; -$solar-red: #dc322f !default; -$solar-magenta: #d33682 !default; -$solar-violet: #6c71c4 !default; -$solar-blue: #268bd2 !default; -$solar-cyan: #2aa198 !default; -$solar-green: #859900 !default; - -$solarized: dark !default; - -@if $solarized == light { - - $_base03: $base03; - $_base02: $base02; - $_base01: $base01; - $_base00: $base00; - $_base0: $base0; - $_base1: $base1; - $_base2: $base2; - $_base3: $base3; - - $base03: $_base3; - $base02: $_base2; - $base01: $_base1; - $base00: $_base0; - $base0: $_base00; - $base1: $_base01; - $base2: $_base02; - $base3: $_base03; -} - -/* non highlighted code colors */ -$pre-bg: $base03 !default; -$pre-border: darken($base02, 5) !default; -$pre-color: $base1 !default; - - diff --git a/.themes/classic/sass/base/solarized/_code-highlight.scss b/.themes/classic/sass/base/solarized/_code-highlight.scss new file mode 100644 index 00000000000..43277619b50 --- /dev/null +++ b/.themes/classic/sass/base/solarized/_code-highlight.scss @@ -0,0 +1,175 @@ +@include solarized-theme($solarized); + +// Inilne element styles +// +code, +kbd, +samp, +tt { + color: inherit; + background-color: $code-bg; + border: 1px solid $code-border; + font-family: $code-font-family; + border-radius: 3px; + font-size: $code-font-size; + &:before, &:after { + content: "\00a0"; + letter-spacing: -0.2em; + } +} + +// Overide styles beneath
+//
+pre code {
+  &:before, &:after {
+    content: none;
+  }
+  border: none;
+  background: none;
+  border-raidus: 0;
+  font-size: inherit;
+}
+
+// Basic pre styles
+//
+pre, pre code { 
+  * { box-sizing: border-box; }
+  font-size: $pre-font-size;
+  font-family: $pre-font-family;
+}
+
+// Styles for pre's which aren't highlighted by Octopress's highlighter
+//
+.highlight pre,
+pre:not(.code-highlight-pre),
+.code-highlight {
+  span { font-style: normal; font-weight: normal; }
+
+  overflow: scroll;
+  overflow-y: hidden;
+  overflow-x: auto;
+  line-height: 1.45em;
+}
+
+
+// Styles for Octopress highlighted code blocks.
+//
+.code-highlight-figure {
+  margin: 1.8em 0;
+  font-size: 14px;
+  * { box-sizing: border-box; }
+  background: none;
+  padding: 0;
+  border: 0;
+
+  pre { margin: { top: 0; bottom: 0; } }
+  
+}
+
+.code-highlight-caption {
+  position: relative;
+  text-align: center;
+  line-height: 2em;
+  text-shadow: rgba(#fff, .8) 0 1px 0;
+  color: #474747;
+  font-weight: normal;
+  margin-bottom: 0;
+  background-color: #ccc;
+  @include background(linear-gradient(#ffffff, #f0f0f0 6%, #e5e5e5 90%, #e5e5e5));
+  border-top-left-radius: 5px;
+  border-top-right-radius: 5px;
+  font-family: "Helvetica Neue", Arial, "Lucida Grande", "Lucida Sans Unicode", Lucida, sans-serif;
+  border: 1px solid #cbcbcb;
+  + .code-highlight { border-top: 0; }
+}
+
+.code-highlight-caption-link { 
+  position: absolute; right: .8em;
+  color: #666;
+  z-index: 1;
+  text-shadow: rgba(#fff, .8) 0 1px 0;
+  padding-left: 3em;
+}
+
+.highlight pre,
+pre:not(.code-highlight-pre) {
+  padding: 1em .8rem;
+  border-radius: .4em;
+  margin: 1.8em 0;
+}
+
+.code-highlight-pre {
+  width: 100%;
+  margin-bottom: 0;
+  display: table;
+}
+
+.code-highlight-row {
+  display: table-row;
+  width: 100%;
+
+  &:before, .code-highlight-line {
+    padding: {left: $pre-line-padding + .8; right: $pre-line-padding + .8 }
+  }
+
+  &:first-child {
+    &:before, .code-highlight-line { padding-top: $pre-line-padding; }
+  }
+
+  &:last-child {
+    &:before, .code-highlight-line { padding-bottom: $pre-line-padding; }
+  }
+
+  &.numbered {
+
+    &:before, .code-highlight-line {
+      padding: {left: $pre-line-padding; right: $pre-line-padding }
+    }
+
+    &:before {
+      display: table-cell;
+      content: attr(data-line);
+      min-width: 1.2em;
+      text-align: right;
+      line-height: 1.45em;
+    }
+  }
+}
+
+.code-highlight-line {
+  display: table-cell;
+  width: 100%;
+  position: relative;
+  z-index: 1;
+}
+
+
+.marked-line {
+  position: relative;
+  .code-highlight-line {
+    &:before {
+      content: "";
+      position: absolute;
+      left: 0; top: 0; bottom: 0; right: 0;
+      border-right: 1px solid $pre-marker-border;
+    }
+  }
+  &.unnumbered .code-highlight-line:before {
+    border-left: 3px solid $pre-marker-border-left;
+  }
+  &.numbered:before {
+    border-left: 3px solid $pre-marker-border-left;
+  }
+}
+
+.start-marked-line {
+  &:before, .code-highlight-line:before {
+    border-top: 1px solid $pre-marker-border;
+  }
+}
+
+.end-marked-line {
+  &:before, .code-highlight-line:before {
+    border-bottom: 1px solid $pre-marker-border;
+  }
+}
diff --git a/.themes/classic/sass/base/solarized/_code-mixins.scss b/.themes/classic/sass/base/solarized/_code-mixins.scss
new file mode 100644
index 00000000000..cad183d6481
--- /dev/null
+++ b/.themes/classic/sass/base/solarized/_code-mixins.scss
@@ -0,0 +1,161 @@
+$pre-line-padding:  .8em !default;
+$pre-font-family:   "Source Code Pro", Inconsolata-dz, Inconsolata, Menlo, Monaco, Consolas, "Liberation Mono", Courier, monospace !default;
+$pre-font-size:     13px !default;
+
+$code-font-family:  $pre-font-family;
+$code-font-size:    .85em !default;
+
+%octopress-diff-bg {
+  content: "";
+  position: absolute;
+  z-index: -1;
+  left: 0; right: 0; top: 0; bottom: 0;
+}
+
+@mixin octopress-diff-bg($bg) {
+  &:after {
+    background: $bg;
+    @extend %octopress-diff-bg;
+  }
+}
+
+@mixin solarized-theme($s: dark) {
+  // Core colors
+  $base03:  if($s == light, $solar-base3, $solar-base03);
+  $base02:  if($s == light, $solar-base2, $solar-base02);
+  $base01:  if($s == light, $solar-base1, $solar-base01);
+  $base00:  if($s == light, $solar-base0, $solar-base00);
+  $base0:   if($s == light, $solar-base00, $solar-base0);
+  $base1:   if($s == light, $solar-base01, $solar-base1);
+  $base2:   if($s == light, $solar-base02, $solar-base2);
+  $base3:   if($s == light, $solar-base03, $solar-base3);
+
+  $pre-marker-bg: if($s == light, rgba($pre-marker, .05), rgba($pre-marker, .13));
+
+  $pre-bg: $base03;
+  $pre-color: $base1;
+  $pre-border: darken($base02, 5);
+  $code-highlight-border: $pre-border;
+
+  .code-highlight-pre {
+    background: darken($base03, 1);
+  }
+
+  .code-highlight-row.numbered:before {
+    color: $base01;
+    @if $solarized == light {
+      background: lighten($base03, 1);
+      border-right: 1px solid darken($base02, 2);
+      text-shadow: lighten($base02, 2) 0 -1px;
+    } @else {
+      background: $base02;
+      border-right: 1px solid darken($base03, 2);
+      box-shadow: lighten($base02, 2) -1px 0 inset;
+      text-shadow: darken($base02, 10) 0 -1px;
+    }
+  }
+
+  .marked-line {
+    .code-highlight-line:before {
+      background: $pre-marker-bg;
+    }
+
+    &.numbered:before {
+      background: $pre-marker-bg;
+      border-right-color: darken($pre-marker-bg, 20);
+    }
+  }
+
+  .highlight pre,
+  pre:not(.code-highlight-pre),
+  .code-highlight {
+    border: 1px solid $code-highlight-border;
+    background: $pre-bg;
+    color: $base1;
+  }
+
+  pre {
+    span { color: $base1; }
+
+    .c      { color: $base01; font-style: italic; }                      /* Comment */
+    .cm     { color: $base01; font-style: italic; }                      /* Comment.Multiline */
+    .cp     { color: $base01; font-style: italic;  }                     /* Comment.Preproc */
+    .c1     { color: $base01; font-style: italic; }                      /* Comment.Single */
+    .cs     {                                                            /* Comment.Special */
+              color: $base01; 
+              font-weight: bold;
+              font-style: italic; }
+    .err    { color: $solar-red; background: none; }                     /* Error */
+    .k      { color: $solar-orange; }                                    /* Keyword */
+    .o      { color: $base1; font-weight: bold; }                        /* Operator */
+    .p      { color: $base1; }                                           /* Operator */
+    .ow     { color: $solar-cyan; font-weight: bold; }                   /* Operator.Word */
+    .gd     { 
+              color: $base1;                                             /* Generic.Deleted */
+              @include octopress-diff-bg(mix($solar-red, $base03, 25%));
+            }
+    .gd .x  {                                                            /* Generic.Deleted.Specific */
+              color: $base1;
+              @include octopress-diff-bg(mix($solar-red, $base03, 35%)); 
+            }
+    .ge     {                                                            /* Generic.Emph */
+              color: $base1;
+              font-style: italic; }
+    //.gr     { color: #aa0000 }                                         /* Generic.Error */
+    .gh     { color: $base01; }                                          /* Generic.Heading */
+    .gi     {                                                            /* Generic.Inserted */
+              color: $base1;
+              @include octopress-diff-bg(mix($solar-green, $base03, 20%)); 
+            }
+    .gi .x  {                                                            /* Generic.Inserted.Specific */
+              color: $base1;
+              @include octopress-diff-bg(mix($solar-green, $base03, 40%)); 
+            }
+    .go     { color: $base0; }                                           /* Generic.Output */
+    .gp     { color: $solar-cyan; }                                      /* Generic.Prompt */
+    .gs     { color: $base1; font-weight: bold; }                        /* Generic.Strong */
+    .gu     { color: $solar-violet; }                                    /* Generic.Subheading */
+    .gt     { color: $solar-red; }                                       /* Generic.Traceback */
+    .kc     { color: $solar-green; font-weight: bold; }                  /* Keyword.Constant */
+    .kd     { color: $solar-blue; }                                      /* Keyword.Declaration */
+    .kp     { color: $solar-orange; font-weight: bold; }                 /* Keyword.Pseudo */
+    .kr     { color: $solar-magenta; font-weight: bold; }                /* Keyword.Reserved */
+    .kt     { color: $solar-cyan; }                                      /* Keyword.Type */
+    .n      { color: $solar-blue; }
+    .na     { color: $solar-blue; }                                      /* Name.Attribute */
+    .nb     { color: $solar-green; }                                     /* Name.Builtin */
+    .nc     { color: $solar-magenta;}                                    /* Name.Class */
+    .no     { color: $solar-yellow; }                                    /* Name.Constant */
+    .ni     { color: $solar-magenta; }                                   /* Name.Entity */
+    .nl     { color: $solar-green; }
+    .ne     { color: $solar-blue; font-weight: bold; }                   /* Name.Exception */
+    .nf     { color: $solar-blue; font-weight: bold; }                   /* Name.Function */
+    .nn     { color: $solar-yellow; }                                    /* Name.Namespace */
+    .nt     { color: $solar-blue; font-weight: bold; }                   /* Name.Tag */
+    .nx     { color: $solar-yellow; }
+    .bp     { color: $base1;  }                                          /* Name.Builtin.Pseudo */
+    .vc     { color: $solar-green; }                                     /* Name.Variable.Class */
+    .vg     { color: $solar-blue; }                                      /* Name.Variable.Global */
+    .vi     { color: $solar-blue; }                                      /* Name.Variable.Instance */
+    .nv     { color: $solar-blue; }                                      /* Name.Variable */
+    .w      { color: $base00; }                                          /* Text.Whitespace */
+    .mf     { color: $solar-cyan; }                                      /* Literal.Number.Float */
+    .m      { color: $solar-cyan; }                                      /* Literal.Number */
+    .mh     { color: $solar-cyan; }                                      /* Literal.Number.Hex */
+    .mi     { color: $solar-cyan; }                                      /* Literal.Number.Integer */
+    .mo     { color: $solar-cyan; }                                      /* Literal.Number.Oct */
+    .s      { color: $solar-cyan; }                                      /* Literal.String */
+    .sb     { color: $solar-green; }                                     /* Literal.String.Backtick */
+    .sc     { color: $solar-green; }                                     /* Literal.String.Char */
+    .sd     { color: $solar-cyan; }                                      /* Literal.String.Doc */
+    .s2     { color: $solar-cyan; }                                      /* Literal.String.Double */
+    .se     { color: $solar-red; }                                       /* Literal.String.Escape */
+    .sh     { color: $solar-green; }                                     /* Literal.String.Heredoc */
+    .si     { color: $solar-blue; }                                      /* Literal.String.Interpol */
+    .sx     { color: $solar-green; }                                     /* Literal.String.Other */
+    .sr     { color: $solar-cyan; }                                      /* Literal.String.Regex */
+    .s1     { color: $solar-cyan; }                                      /* Literal.String.Single */
+    .ss     { color: $solar-orange; }                                    /* Literal.String.Symbol */
+    .il     { color: $solar-yellow; }                                    /* Literal.Number.Integer.Long */
+  }
+}
diff --git a/.themes/classic/sass/base/solarized/_index.scss b/.themes/classic/sass/base/solarized/_index.scss
new file mode 100644
index 00000000000..e2505b53d4f
--- /dev/null
+++ b/.themes/classic/sass/base/solarized/_index.scss
@@ -0,0 +1,3 @@
+@import 'solarized';
+@import 'code-mixins';
+@import 'code-highlight';
diff --git a/.themes/classic/sass/base/solarized/_solarized.scss b/.themes/classic/sass/base/solarized/_solarized.scss
new file mode 100644
index 00000000000..9ec6e94ea68
--- /dev/null
+++ b/.themes/classic/sass/base/solarized/_solarized.scss
@@ -0,0 +1,25 @@
+$solar-base03:        #002b36; //darkest blue
+$solar-base02:        #073642; //dark blue
+$solar-base01:        #586e75; //darkest gray
+$solar-base00:        #657b83; //dark gray
+$solar-base0:         #839496; //medium gray
+$solar-base1:         #93a1a1; //medium light gray
+$solar-base2:         #f2f2f2; //very light gray
+$solar-base3:         #ffffff; //white
+$solar-yellow:        #b58900;
+$solar-orange:        #cb4b16;
+$solar-red:           #dc322f;
+$solar-magenta:       #d33682;
+$solar-violet:        #6c71c4;
+$solar-blue:          #268bd2;
+$solar-cyan:          #2aa198;
+$solar-green:         #859900;
+
+$pre-marker:              rgba(#00baff, .5) !default;
+$pre-marker-border:       rgba($pre-marker, .13) !default;
+$pre-marker-border-left:  $pre-marker;
+
+$code-bg:                 rgba(#fff, .3);
+$code-border:             rgba(#000, .1);
+
+$solarized: dark;
diff --git a/.themes/classic/sass/partials/_syntax.scss b/.themes/classic/sass/partials/_syntax.scss
deleted file mode 100644
index 5465286fdee..00000000000
--- a/.themes/classic/sass/partials/_syntax.scss
+++ /dev/null
@@ -1,261 +0,0 @@
-.highlight, html .gist .gist-file .gist-syntax .gist-highlight {
-  table td.code { width: 100%; }
-  border: 1px solid $pre-border !important;
-}
-.highlight .line-numbers, html .gist .gist-file .gist-syntax .highlight .line_numbers {
-  text-align: right;
-  font-size: 13px;
-  line-height: 1.45em;
-  @if $solarized == light {
-    background: lighten($base03, 1) $noise-bg !important;
-    border-right: 1px solid darken($base02, 2) !important;
-    @include box-shadow(lighten($base03, 2) -1px 0 inset);
-    text-shadow: lighten($base02, 2) 0 -1px;
-  } @else {
-    background: $base02 $noise-bg !important;
-    border-right: 1px solid darken($base03, 2) !important;
-    @include box-shadow(lighten($base02, 2) -1px 0 inset);
-    text-shadow: darken($base02, 10) 0 -1px;
-  }
-  span { color: $base01 !important; }
-  padding: .8em !important;
-  @include border-radius(0);
-}
-
-figure.code, .gist-file, pre {
-  @include box-shadow(rgba(#000, .06) 0 0 10px);
-  .highlight pre { @include box-shadow(none); }
-}
-
-.gist .highlight, figure.code .highlight {
-  @include selection(adjust-color($base03, $lightness: 23%, $saturation: -65%), $text-shadow: $base03 0 1px);
-}
-html .gist .gist-file {
-  margin-bottom: 1.8em;
-  position: relative;
-  border: none;
-  padding-top: image-height("code_bg.png") !important;
-  .highlight {
-    margin-bottom: 0;
-  }
-  .gist-syntax {
-    border-bottom: 0 !important;
-    background: none !important;
-    .gist-highlight {
-      background: $base03 !important;
-    }
-    .highlight pre {
-      @extend .pre-code;
-      padding: 0;
-    }
-  }
-  .gist-meta {
-   padding: .6em 0.8em;
-   border: 1px solid lighten($base02, 2) !important;
-   color: $base01;
-   font-size: .7em !important;
-   @if $solarized == light {
-     background: lighten($base03, 2) $noise-bg;
-     border: 1px solid $pre-border !important;
-     border-top: 1px solid lighten($base03, 2) !important;
-   } @else {
-     background: $base02 $noise-bg;
-   }
-   @extend .sans;
-   line-height: 1.5em;
-    a {
-      color: mix($base1, $base01) !important;
-      @include hover-link;
-      &:hover { color: $base1 !important; }
-    }
-    a[href*='#file'] {
-      position: absolute; top: 0; left:0; right:-10px;
-      color: #474747 !important;
-      @extend .code-title;
-      &:hover { color: $link-color !important; }
-    }
-    a[href*=raw]{
-      @extend .download-source;
-      top: .4em;
-    }
-  }
-}
-pre {
-  background: $pre-bg $noise-bg;
-  @include border-radius(.4em);
-  @extend .mono;
-  border: 1px solid $pre-border;
-  line-height: 1.45em;
-  font-size: 13px;
-  margin-bottom: 2.1em;
-  padding: .8em 1em;
-  color: $pre-color;
-  overflow: auto;
-}
-h3.filename {
-  @extend .code-title;
-  + pre { @include border-top-radius(0px); }
-}
-
-p, li {
-  code {
-    @extend .mono;
-    display: inline-block;
-    white-space: no-wrap;
-    background: #fff;
-    font-size: .8em;
-    line-height: 1.5em;
-    color: #555;
-    border: 1px solid #ddd;
-    @include border-radius(.4em);
-    padding: 0 .3em;
-    margin: -1px 0;
-  }
-  pre code { font-size: 1em !important; background: none; border: none; }
-}
-
-.pre-code {
-  font-family: $mono !important;
-  overflow: scroll;
-  overflow-y: hidden;
-  display: block;
-  padding: .8em;
-  overflow-x: auto;
-  line-height: 1.45em;
-  background: $base03 $noise-bg !important;
-  color: $base1 !important;
-  span { color: $base1 !important; }
-  span { font-style: normal !important; font-weight: normal !important; }
-
-  .c      { color: $base01 !important; font-style: italic !important; }                     /* Comment */
-  .cm     { color: $base01 !important; font-style: italic !important; }                     /* Comment.Multiline */
-  .cp     { color: $base01 !important; font-style: italic !important;  }                     /* Comment.Preproc */
-  .c1     { color: $base01 !important; font-style: italic !important; }                     /* Comment.Single */
-  .cs     { color: $base01 !important; font-weight: bold !important; font-style: italic !important; }   /* Comment.Special */
-  .err    { color: $solar-red !important; background: none !important; }                                            /* Error */
-  .k      { color: $solar-orange !important; }                       /* Keyword */
-  .o      { color: $base1 !important; font-weight: bold !important; }                       /* Operator */
-  .p      { color: $base1 !important; }                                             /* Operator */
-  .ow     { color: $solar-cyan !important; font-weight: bold !important; }                       /* Operator.Word */
-  .gd     { color: $base1 !important; background-color: mix($solar-red, $base03, 25%) !important; display: inline-block; }               /* Generic.Deleted */
-  .gd .x  { color: $base1 !important; background-color: mix($solar-red, $base03, 35%) !important; display: inline-block; }               /* Generic.Deleted.Specific */
-  .ge     { color: $base1 !important; font-style: italic !important; }                      /* Generic.Emph */
-  //.gr     { color: #aa0000 }                                          /* Generic.Error */
-  .gh     { color: $base01 !important; }                                          /* Generic.Heading */
-  .gi     { color: $base1 !important; background-color: mix($solar-green, $base03, 20%) !important; display: inline-block; }               /* Generic.Inserted */
-  .gi .x  { color: $base1 !important; background-color: mix($solar-green, $base03, 40%) !important; display: inline-block; }               /* Generic.Inserted.Specific */
-  //.go     { color: #888888 }                                          /* Generic.Output */
-  //.gp     { color: #555555 }                                          /* Generic.Prompt */
-  .gs     { color: $base1 !important; font-weight: bold !important; }                                       /* Generic.Strong */
-  .gu     { color: $solar-violet !important; }                                          /* Generic.Subheading */
-  //.gt     { color: #aa0000 }                                          /* Generic.Traceback */
-  .kc     { color: $solar-green !important; font-weight: bold !important; }                       /* Keyword.Constant */
-  .kd     { color: $solar-blue !important; }                       /* Keyword.Declaration */
-  .kp     { color: $solar-orange !important; font-weight: bold !important; }                       /* Keyword.Pseudo */
-  .kr     { color: $solar-magenta !important; font-weight: bold !important; }                       /* Keyword.Reserved */
-  .kt     { color: $solar-cyan !important; }                       /* Keyword.Type */
-  .n      { color: $solar-blue !important; }
-  .na     { color: $solar-blue !important; }                                          /* Name.Attribute */
-  .nb     { color: $solar-green !important; }                                          /* Name.Builtin */
-  .nc     { color: $solar-magenta !important;}                                                   /* Name.Class */
-  .no     { color: $solar-yellow !important; }                                          /* Name.Constant */
-  //.ni     { color: #800080 }                                          /* Name.Entity */
-  .nl     { color: $solar-green !important; }
-  .ne     { color: $solar-blue !important; font-weight: bold !important; }                       /* Name.Exception */
-  .nf     { color: $solar-blue !important; font-weight: bold !important; }                       /* Name.Function */
-  .nn     { color: $solar-yellow !important; }                                          /* Name.Namespace */
-  .nt     { color: $solar-blue !important; font-weight: bold !important; }                                          /* Name.Tag */
-  .nx     { color: $solar-yellow !Important; }
-  //.bp     { color: #999999 }                                          /* Name.Builtin.Pseudo */
-  //.vc     { color: #008080 }                                          /* Name.Variable.Class */
-  .vg     { color: $solar-blue !important; }                                          /* Name.Variable.Global */
-  .vi     { color: $solar-blue !important; }                                          /* Name.Variable.Instance */
-  .nv     { color: $solar-blue !important; }                                          /* Name.Variable */
-  //.w      { color: #bbbbbb }                                          /* Text.Whitespace */
-  .mf     { color: $solar-cyan !important; }                                          /* Literal.Number.Float */
-  .m      { color: $solar-cyan !important; }                                          /* Literal.Number */
-  .mh     { color: $solar-cyan !important; }                                          /* Literal.Number.Hex */
-  .mi     { color: $solar-cyan !important; }                                          /* Literal.Number.Integer */
-  //.mo     { color: #009999 }                                          /* Literal.Number.Oct */
-  .s      { color: $solar-cyan !important; }                                             /* Literal.String */
-  //.sb     { color: #d14 }                                             /* Literal.String.Backtick */
-  //.sc     { color: #d14 }                                             /* Literal.String.Char */
-  .sd     { color: $solar-cyan !important; }                                             /* Literal.String.Doc */
-  .s2     { color: $solar-cyan !important; }                                             /* Literal.String.Double */
-  .se     { color: $solar-red !important; }                                             /* Literal.String.Escape */
-  //.sh     { color: #d14 }                                             /* Literal.String.Heredoc */
-  .si     { color: $solar-blue !important; }                                             /* Literal.String.Interpol */
-  //.sx     { color: #d14 }                                             /* Literal.String.Other */
-  .sr     { color: $solar-cyan !important; }                                          /* Literal.String.Regex */
-  .s1     { color: $solar-cyan !important; }                                             /* Literal.String.Single */
-  //.ss     { color: #990073 }                                          /* Literal.String.Symbol */
-  //.il     { color: #009999 }                                          /* Literal.Number.Integer.Long */
-  div { .gd, .gd .x, .gi, .gi .x { display: inline-block; width: 100%; }}
-}
-
-.highlight, .gist-highlight {
-  pre { background: none; @include border-radius(0px); border: none; padding: 0; margin-bottom: 0; }
-  margin-bottom: 1.8em;
-  background: $base03;
-  overflow-y: hidden;
-  overflow-x: auto;
-}
-
-$solar-scroll-bg: rgba(#fff, .15);
-$solar-scroll-thumb: rgba(#fff, .2);
-@if $solarized == light {
-  $solar-scroll-bg: rgba(#000, .15);
-  $solar-scroll-thumb: rgba(#000, .15);
-}
-
-pre, .highlight, .gist-highlight {
-  &::-webkit-scrollbar {  height: .5em; background: $solar-scroll-bg; }
-  &::-webkit-scrollbar-thumb:horizontal { background: $solar-scroll-thumb;  -webkit-border-radius: 4px; border-radius: 4px }
-}
-
-.highlight code { 
-  @extend .pre-code; background: #000;
-}
-figure.code {
-  background: none;
-  padding: 0;
-  border: 0;
-  margin-bottom: 1.5em;
-  pre { margin-bottom: 0; }
-  figcaption {
-    position: relative;
-    @extend .code-title;
-    a { @extend .download-source; }
-  }
-  .highlight {
-    margin-bottom: 0;
-  }
-}
-
-.code-title {
-  text-align: center;
-  font-size: 13px;
-  line-height: 2em;
-  text-shadow: #cbcccc 0 1px 0;
-  color: #474747;
-  font-weight: normal;
-  margin-bottom: 0;
-  @include border-top-radius(5px);
-  font-family: "Helvetica Neue", Arial, "Lucida Grande", "Lucida Sans Unicode", Lucida, sans-serif;
-  background: #aaaaaa image-url("code_bg.png") top repeat-x;
-  border: 1px solid #565656;
-  border-top-color: #cbcbcb;
-  border-left-color: #a5a5a5;
-  border-right-color: #a5a5a5;
-  border-bottom: 0;
-}
-
-.download-source {
-  position: absolute; right: .8em;
-  @include hover-link;
-  color: #666 !important;
-  z-index: 1;
-  font-size: 13px;
-  text-shadow: #cbcccc 0 1px 0;
-  padding-left: 3em;
-}
diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
index 0da6ecb6593..c25446e89c2 100644
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,5 +1,10 @@
 # Octopress Changelog
 
+## 2.1
+
+- Now using on Jekyll 2.0
+- Upgraded all syntax highlighting plugins (now using external gem plugins)
+
 ## 2.0
 
 - Now based on [mojombo/jekyll](http://github.com/mojombo/jekyll)
diff --git a/Gemfile b/Gemfile
index 9557d593b74..81ce02930bb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -6,14 +6,19 @@ group :development do
   gem 'jekyll-page-hooks', '~> 1.2'
   gem 'jekyll-date-format', '~> 1.0'
   gem 'jekyll-sitemap'
+  gem 'octopress-codefence', '~> 1.4'
+  gem 'octopress-codeblock', '~> 1.0'
+  gem 'octopress-gist', '~> 1.3'
+  gem 'octopress-render-code', '~> 1.0'
+  gem 'octopress-render-tag', '~> 1.0'
   gem 'rdiscount', '~> 2.0'
-  gem 'RedCloth', '~> 4.2.9'
+  gem 'RedCloth', '~> 4.2'
   gem 'haml', '~> 4.0'
-  gem 'compass', '~> 0.12.2'
-  gem 'sass-globbing', '~> 1.0.0'
-  gem 'rubypants', '~> 0.2.0'
+  gem 'compass', '~> 0.12'
+  gem 'sass-globbing', '~> 1.0'
+  gem 'rubypants', '~> 0.2'
   gem 'rb-fsevent', '~> 0.9'
-  gem 'stringex', '~> 1.4.0'
+  gem 'stringex', '~> 1.4'
 end
 
 gem 'sinatra', '~> 1.4.2'
diff --git a/Gemfile.lock b/Gemfile.lock
deleted file mode 100644
index 55a3c463b63..00000000000
--- a/Gemfile.lock
+++ /dev/null
@@ -1,104 +0,0 @@
-GEM
-  remote: https://rubygems.org/
-  specs:
-    RedCloth (4.2.9)
-    blankslate (2.1.2.4)
-    celluloid (0.15.2)
-      timers (~> 1.1.0)
-    chunky_png (1.3.1)
-    classifier (1.3.4)
-      fast-stemmer (>= 1.0.0)
-    coffee-script (2.2.0)
-      coffee-script-source
-      execjs
-    coffee-script-source (1.7.0)
-    colorator (0.1)
-    compass (0.12.6)
-      chunky_png (~> 1.2)
-      fssm (>= 0.2.7)
-      sass (~> 3.2.19)
-    execjs (2.2.0)
-    fast-stemmer (1.0.2)
-    ffi (1.9.3)
-    fssm (0.2.10)
-    haml (4.0.5)
-      tilt
-    jekyll (2.0.3)
-      classifier (~> 1.3)
-      colorator (~> 0.1)
-      jekyll-coffeescript (~> 1.0)
-      jekyll-sass-converter (~> 1.0)
-      kramdown (~> 1.3)
-      liquid (~> 2.5.5)
-      listen (~> 2.5)
-      mercenary (~> 0.3.3)
-      pygments.rb (~> 0.5.0)
-      redcarpet (~> 3.1)
-      safe_yaml (~> 1.0)
-      toml (~> 0.1.0)
-    jekyll-coffeescript (1.0.0)
-      coffee-script (~> 2.2)
-    jekyll-date-format (1.0.0)
-      jekyll (>= 1.0.0)
-    jekyll-page-hooks (1.2.0)
-      jekyll (>= 2.0.0)
-    jekyll-sass-converter (1.0.0)
-      sass (~> 3.2)
-    jekyll-sitemap (0.4.1)
-      jekyll (~> 2.0)
-    kramdown (1.4.0)
-    liquid (2.5.5)
-    listen (2.7.9)
-      celluloid (>= 0.15.2)
-      rb-fsevent (>= 0.9.3)
-      rb-inotify (>= 0.9)
-    mercenary (0.3.3)
-    parslet (1.5.0)
-      blankslate (~> 2.0)
-    posix-spawn (0.3.8)
-    pygments.rb (0.5.4)
-      posix-spawn (~> 0.3.6)
-      yajl-ruby (~> 1.1.0)
-    rack (1.5.2)
-    rack-protection (1.5.3)
-      rack
-    rake (10.3.2)
-    rb-fsevent (0.9.4)
-    rb-inotify (0.9.5)
-      ffi (>= 0.5.0)
-    rdiscount (2.0.7.3)
-    redcarpet (3.1.2)
-    rubypants (0.2.0)
-    safe_yaml (1.0.3)
-    sass (3.2.19)
-    sass-globbing (1.0.0)
-      sass (>= 3.1)
-    sinatra (1.4.5)
-      rack (~> 1.4)
-      rack-protection (~> 1.4)
-      tilt (~> 1.3, >= 1.3.4)
-    stringex (1.4.0)
-    tilt (1.4.1)
-    timers (1.1.0)
-    toml (0.1.1)
-      parslet (~> 1.5.0)
-    yajl-ruby (1.1.0)
-
-PLATFORMS
-  ruby
-
-DEPENDENCIES
-  RedCloth (~> 4.2.9)
-  compass (~> 0.12.2)
-  haml (~> 4.0)
-  jekyll (~> 2.0)
-  jekyll-date-format (~> 1.0)
-  jekyll-page-hooks (~> 1.2)
-  jekyll-sitemap
-  rake (~> 10.0)
-  rb-fsevent (~> 0.9)
-  rdiscount (~> 2.0)
-  rubypants (~> 0.2.0)
-  sass-globbing (~> 1.0.0)
-  sinatra (~> 1.4.2)
-  stringex (~> 1.4.0)
diff --git a/plugins/backtick_code_block.rb b/plugins/backtick_code_block.rb
deleted file mode 100644
index 8e2c11414a1..00000000000
--- a/plugins/backtick_code_block.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require './plugins/pygments_code'
-
-module BacktickCodeBlock
-  include HighlightCode
-  AllOptions = /([^\s]+)\s+(.+?)\s+(https?:\/\/\S+|\/\S+)\s*(.+)?/i
-  LangCaption = /([^\s]+)\s*(.+)?/i
-  def render_code_block(input)
-    @options = nil
-    @caption = nil
-    @lang = nil
-    @url = nil
-    @title = nil
-    input.gsub(/^`{3} *([^\n]+)?\n(.+?)\n`{3}/m) do
-      @options = $1 || ''
-      str = $2
-
-      if @options =~ AllOptions
-        @lang = $1
-        @caption = "
#{$2}#{$4 || 'link'}
" - elsif @options =~ LangCaption - @lang = $1 - @caption = "
#{$2}
" - end - - if str.match(/\A( {4}|\t)/) - str = str.gsub(/^( {4}|\t)/, '') - end - if @lang.nil? || @lang == 'plain' - code = tableize_code(str.gsub('<','<').gsub('>','>')) - "
#{@caption}#{code}
" - else - if @lang.include? "-raw" - raw = "``` #{@options.sub('-raw', '')}\n" - raw += str - raw += "\n```\n" - else - code = highlight(str, @lang) - "
#{@caption}#{code}
" - end - end - end - end -end diff --git a/plugins/code_block.rb b/plugins/code_block.rb deleted file mode 100644 index 46620d86c0d..00000000000 --- a/plugins/code_block.rb +++ /dev/null @@ -1,94 +0,0 @@ -# Title: Simple Code Blocks for Jekyll -# Author: Brandon Mathis http://brandonmathis.com -# Description: Write codeblocks with semantic HTML5
and
elements and optional syntax highlighting — all with a simple, intuitive interface. -# -# Syntax: -# {% codeblock [title] [url] [link text] %} -# code snippet -# {% endcodeblock %} -# -# For syntax highlighting, put a file extension somewhere in the title. examples: -# {% codeblock file.sh %} -# code snippet -# {% endcodeblock %} -# -# {% codeblock Time to be Awesome! (awesome.rb) %} -# code snippet -# {% endcodeblock %} -# -# Example: -# -# {% codeblock Got pain? painreleif.sh http://site.com/painreleief.sh Download it! %} -# $ rm -rf ~/PAIN -# {% endcodeblock %} -# -# Output: -# -#
-#
Got pain? painrelief.sh Download it! -#

-# -- nicely escaped highlighted code --
-# 
-#
-# -# Example 2 (no syntax highlighting): -# -# {% codeblock %} -# Ooooh, sarcasm... How original! -# {% endcodeblock %} -# -#
-#
<sarcasm> Ooooh, sarcasm... How original!</sarcasm>
-#
-# -require './plugins/pygments_code' -require './plugins/raw' - -module Jekyll - - class CodeBlock < Liquid::Block - include HighlightCode - include TemplateWrapper - CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/\S+|\/\S+)\s*(.+)?/i - Caption = /(\S[\S\s]*)/ - def initialize(tag_name, markup, tokens) - @title = nil - @caption = nil - @filetype = nil - @highlight = true - if markup =~ /\s*lang:(\S+)/i - @filetype = $1 - markup = markup.sub(/\s*lang:(\S+)/i,'') - end - if markup =~ CaptionUrlTitle - @file = $1 - @caption = "
#{$1}#{$3 || 'link'}
" - elsif markup =~ Caption - @file = $1 - @caption = "
#{$1}
\n" - end - if @file =~ /\S[\S\s]*\w+\.(\w+)/ && @filetype.nil? - @filetype = $1 - end - super - end - - def render(context) - output = super - code = super - source = "
" - source += @caption if @caption - if @filetype - source += "#{highlight(code, @filetype)}
" - else - source += "#{tableize_code(code.lstrip.rstrip.gsub(/" - end - source = safe_wrap(source) - source = context['pygments_prefix'] + source if context['pygments_prefix'] - source = source + context['pygments_suffix'] if context['pygments_suffix'] - source - end - end -end - -Liquid::Template.register_tag('codeblock', Jekyll::CodeBlock) diff --git a/plugins/gist_tag.rb b/plugins/gist_tag.rb deleted file mode 100644 index 5120115621a..00000000000 --- a/plugins/gist_tag.rb +++ /dev/null @@ -1,130 +0,0 @@ -# A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers. -# by: Brandon Tilly -# Source URL: https://gist.github.com/1027674 -# Post http://brandontilley.com/2011/01/31/gist-tag-for-jekyll.html -# -# Example usage: {% gist 1027674 gist_tag.rb %} //embeds a gist for this plugin - -require 'cgi' -require 'digest/md5' -require 'net/https' -require 'uri' - -module Jekyll - class GistTag < Liquid::Tag - def initialize(tag_name, text, token) - super - @text = text - @cache_disabled = false - @cache_folder = File.expand_path "../.gist-cache", File.dirname(__FILE__) - FileUtils.mkdir_p @cache_folder - end - - def render(context) - if parts = @text.match(/([a-zA-Z\d]*) (.*)/) - gist, file = parts[1].strip, parts[2].strip - else - gist, file = @text.strip, "" - end - if gist.empty? - "" - else - script_url = script_url_for gist, file - code = get_cached_gist(gist, file) || get_gist_from_web(gist, file) - html_output_for script_url, code - end - end - - def html_output_for(script_url, code) - code = CGI.escapeHTML code - <<-HTML -
-
- HTML - end - - def script_url_for(gist_id, filename) - url = "https://gist.github.com/#{gist_id}.js" - url = "#{url}?file=#{filename}" unless filename.nil? or filename.empty? - url - end - - def get_gist_url_for(gist, file) - "https://gist.githubusercontent.com/raw/#{gist}/#{file}" - end - - def cache(gist, file, data) - cache_file = get_cache_file_for gist, file - File.open(cache_file, "w") do |io| - io.write data - end - end - - def get_cached_gist(gist, file) - return nil if @cache_disabled - cache_file = get_cache_file_for gist, file - File.read cache_file if File.exist? cache_file - end - - def get_cache_file_for(gist, file) - bad_chars = /[^a-zA-Z0-9\-_.]/ - gist = gist.gsub bad_chars, '' - file = file.gsub bad_chars, '' - md5 = Digest::MD5.hexdigest "#{gist}-#{file}" - File.join @cache_folder, "#{gist}-#{file}-#{md5}.cache" - end - - def get_gist_from_web(gist, file) - gist_url = get_gist_url_for(gist, file) - data = get_web_content(gist_url) - - locations = Array.new - while (data.code.to_i == 301 || data.code.to_i == 302) - data = handle_gist_redirecting(data) - break if locations.include? data.header['Location'] - locations << data.header['Location'] - end - - if data.code.to_i != 200 - raise RuntimeError, "Gist replied with #{data.code} for #{gist_url}" - end - - cache(gist, file, data.body) unless @cache_disabled - data.body - end - - def handle_gist_redirecting(data) - redirected_url = data.header['Location'] - if redirected_url.nil? || redirected_url.empty? - raise ArgumentError, "GitHub replied with a 302 but didn't provide a location in the response headers." - end - - get_web_content(redirected_url) - end - - def get_web_content(url) - raw_uri = URI.parse url - proxy = ENV['http_proxy'] - if proxy - proxy_uri = URI.parse(proxy) - https = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port).new raw_uri.host, raw_uri.port - else - https = Net::HTTP.new raw_uri.host, raw_uri.port - end - https.use_ssl = true - https.verify_mode = OpenSSL::SSL::VERIFY_NONE - request = Net::HTTP::Get.new raw_uri.request_uri - data = https.request request - end - end - - class GistTagNoCache < GistTag - def initialize(tag_name, text, token) - super - @cache_disabled = true - end - end -end - -Liquid::Template.register_tag('gist', Jekyll::GistTag) -Liquid::Template.register_tag('gistnocache', Jekyll::GistTagNoCache) diff --git a/plugins/include_code.rb b/plugins/include_code.rb deleted file mode 100644 index 41f30337bd6..00000000000 --- a/plugins/include_code.rb +++ /dev/null @@ -1,73 +0,0 @@ -# Title: Include Code Tag for Jekyll -# Author: Brandon Mathis http://brandonmathis.com -# Description: Import files on your filesystem into any blog post as embedded code snippets with syntax highlighting and a download link. -# Configuration: You can set default import path in _config.yml (defaults to code_dir: downloads/code) -# -# Syntax {% include_code path/to/file %} -# -# Example 1: -# {% include_code javascripts/test.js %} -# -# This will import test.js from source/downloads/code/javascripts/test.js -# and output the contents in a syntax highlighted code block inside a figure, -# with a figcaption listing the file name and download link -# -# Example 2: -# You can also include an optional title for the
-# -# {% include_code Example 2 javascripts/test.js %} -# -# will output a figcaption with the title: Example 2 (test.js) -# - -require './plugins/pygments_code' -require './plugins/raw' -require 'pathname' - -module Jekyll - - class IncludeCodeTag < Liquid::Tag - include HighlightCode - include TemplateWrapper - def initialize(tag_name, markup, tokens) - @title = nil - @file = nil - if markup.strip =~ /\s*lang:(\S+)/i - @filetype = $1 - markup = markup.strip.sub(/lang:\S+/i,'') - end - if markup.strip =~ /(.*)?(\s+|^)(\/*\S+)/i - @title = $1 || nil - @file = $3 - end - super - end - - def render(context) - code_dir = (context.registers[:site].config['code_dir'].sub(/^\//,'') || 'downloads/code') - code_path = (Pathname.new(context.registers[:site].source) + code_dir).expand_path - file = code_path + @file - - if File.symlink?(code_path) - return "Code directory '#{code_path}' cannot be a symlink" - end - - unless file.file? - return "File #{file} could not be found" - end - - Dir.chdir(code_path) do - code = file.read - @filetype = file.extname.sub('.','') if @filetype.nil? - title = @title ? "#{@title} (#{file.basename})" : file.basename - url = "/#{code_dir}/#{@file}" - source = "
#{title} download
\n" - source += "#{highlight(code, @filetype)}
" - safe_wrap(source) - end - end - end - -end - -Liquid::Template.register_tag('include_code', Jekyll::IncludeCodeTag) diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb index aad5bf9f960..eb9f3e3f55f 100644 --- a/plugins/octopress_filters.rb +++ b/plugins/octopress_filters.rb @@ -1,42 +1,11 @@ #custom filters for Octopress -require './plugins/backtick_code_block' -require 'jekyll-page-hooks' +require 'octopress-codefence' +require 'octopress-codeblock' +require 'octopress-gist' +require 'octopress-render-code' +require 'octopress-render-tag' require 'jekyll-sitemap' require 'jekyll-date-format' -require './plugins/raw' -require 'rubypants' - -module OctopressFilters - include BacktickCodeBlock - include TemplateWrapper - def pre_filter(input) - input = render_code_block(input) - input.gsub /(.+?<\/figure>)/m do - safe_wrap($1) - end - end - def post_filter(input) - input = unwrap(input) - RubyPants.new(input).to_html - end -end - -module Jekyll - class ContentFilters < PageHooks - include OctopressFilters - def pre_render(post) - if post.ext.match('html|textile|markdown|md|haml|slim|xml') - post.content = pre_filter(post.content) - end - end - def post_render(post) - if post.ext.match('html|textile|markdown|md|haml|slim|xml') - post.content = post_filter(post.content) - end - end - end -end - module OctopressLiquidFilters @@ -131,5 +100,6 @@ def titlecase(input) end end + Liquid::Template.register_filter OctopressLiquidFilters diff --git a/plugins/pullquote.rb b/plugins/pullquote.rb index 3c65e66e88d..ce6ff3834db 100644 --- a/plugins/pullquote.rb +++ b/plugins/pullquote.rb @@ -22,6 +22,8 @@ # # Note: this plugin now creates pullquotes with the class of pullquote-right by default +require 'rubypants' + module Jekyll class PullquoteTag < Liquid::Block diff --git a/plugins/pygments_code.rb b/plugins/pygments_code.rb deleted file mode 100644 index 8b851a3bdd8..00000000000 --- a/plugins/pygments_code.rb +++ /dev/null @@ -1,45 +0,0 @@ -require 'pygments' -require 'fileutils' -require 'digest/md5' - -PYGMENTS_CACHE_DIR = File.expand_path('../../.pygments-cache', __FILE__) -FileUtils.mkdir_p(PYGMENTS_CACHE_DIR) - -module HighlightCode - def highlight(str, lang) - lang = 'ruby' if lang == 'ru' - lang = 'objc' if lang == 'm' - lang = 'perl' if lang == 'pl' - lang = 'yaml' if lang == 'yml' - str = pygments(str, lang).match(/
(.+)<\/pre>/m)[1].to_s.gsub(/ *$/, '') #strip out divs 
- tableize_code(str, lang) - end - - def pygments(code, lang) - if defined?(PYGMENTS_CACHE_DIR) - path = File.join(PYGMENTS_CACHE_DIR, "#{lang}-#{Digest::MD5.hexdigest(code)}.html") - if File.exist?(path) - highlighted_code = File.read(path) - else - begin - highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8', :startinline => true}) - rescue MentosError - raise "Pygments can't parse unknown language: #{lang}." - end - File.open(path, 'w') {|f| f.print(highlighted_code) } - end - else - highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8', :startinline => true}) - end - highlighted_code - end - def tableize_code (str, lang = '') - table = '
'
-    code = ''
-    str.lines.each_with_index do |line,index|
-      table += "#{index+1}\n"
-      code  += "#{line}"
-    end
-    table += "
#{code}
" - end -end diff --git a/plugins/raw.rb b/plugins/raw.rb deleted file mode 100644 index 4b002625d5c..00000000000 --- a/plugins/raw.rb +++ /dev/null @@ -1,40 +0,0 @@ -# Author: Brandon Mathis -# Description: Provides plugins with a method for wrapping and unwrapping input to prevent Markdown and Textile from parsing it. -# Purpose: This is useful for preventing Markdown and Textile from being too aggressive and incorrectly parsing in-line HTML. -module TemplateWrapper - # Wrap input with a
- def safe_wrap(input) - "
#{input}
" - end - # This must be applied after the - def unwrap(input) - input.gsub /
(.+?)<\/notextile><\/div>/m do - $1 - end - end -end - -# Author: phaer, https://github.com/phaer -# Source: https://gist.github.com/1020852 -# Description: Raw tag for jekyll. Keeps liquid from parsing text betweeen {% raw %} and {% endraw %} - -module Jekyll - class RawTag < Liquid::Block - def parse(tokens) - @nodelist ||= [] - @nodelist.clear - - while token = tokens.shift - if token =~ FullToken - if block_delimiter == $1 - end_tag - return - end - end - @nodelist << token if not token.empty? - end - end - end -end - -Liquid::Template.register_tag('raw', Jekyll::RawTag) diff --git a/plugins/render_partial.rb b/plugins/render_partial.rb deleted file mode 100644 index b6ebfe8b549..00000000000 --- a/plugins/render_partial.rb +++ /dev/null @@ -1,69 +0,0 @@ -# Title: Render Partial Tag for Jekyll -# Author: Brandon Mathis http://brandonmathis.com -# Description: Import files on your filesystem into any blog post and render them inline. -# Note: Paths are relative to the source directory, if you import a file with yaml front matter, the yaml will be stripped out. -# -# Syntax {% render_partial path/to/file %} -# -# Example 1: -# {% render_partial about/_bio.markdown %} -# -# This will import source/about/_bio.markdown and render it inline. -# In this example I used an underscore at the beginning of the filename to prevent Jekyll -# from generating an about/bio.html (Jekyll doesn't convert files beginning with underscores) -# -# Example 2: -# {% render_partial ../README.markdown %} -# -# You can use relative pathnames, to include files outside of the source directory. -# This might be useful if you want to have a page for a project's README without having -# to duplicated the contents -# -# - -require 'pathname' -require './plugins/octopress_filters' - -module Jekyll - - class RenderPartialTag < Liquid::Tag - include OctopressFilters - def initialize(tag_name, markup, tokens) - @file = nil - @raw = false - if markup =~ /^(\S+)\s?(\w+)?/ - @file = $1.strip - @raw = $2 == 'raw' - end - super - end - - def render(context) - file_dir = (context.registers[:site].source || 'source') - file_path = Pathname.new(file_dir).expand_path - file = file_path + @file - - unless file.file? - return "File #{file} could not be found" - end - - Dir.chdir(file_path) do - contents = file.read - if contents =~ /\A-{3}.+[^\A]-{3}\n(.+)/m - contents = $1.lstrip - end - contents = pre_filter(contents) - if @raw - contents - else - partial = Liquid::Template.parse(contents) - context.stack do - partial.render(context) - end - end - end - end - end -end - -Liquid::Template.register_tag('render_partial', Jekyll::RenderPartialTag) diff --git a/plugins/rubypants.rb b/plugins/rubypants.rb deleted file mode 100644 index e4f4502f57c..00000000000 --- a/plugins/rubypants.rb +++ /dev/null @@ -1,489 +0,0 @@ -# -# = RubyPants -- SmartyPants ported to Ruby -# -# Ported by Christian Neukirchen -# Copyright (C) 2004 Christian Neukirchen -# -# Incooporates ideas, comments and documentation by Chad Miller -# Copyright (C) 2004 Chad Miller -# -# Original SmartyPants by John Gruber -# Copyright (C) 2003 John Gruber -# - -# -# = RubyPants -- SmartyPants ported to Ruby -# -# == Synopsis -# -# RubyPants is a Ruby port of the smart-quotes library SmartyPants. -# -# The original "SmartyPants" is a free web publishing plug-in for -# Movable Type, Blosxom, and BBEdit that easily translates plain ASCII -# punctuation characters into "smart" typographic punctuation HTML -# entities. -# -# -# == Description -# -# RubyPants can perform the following transformations: -# -# * Straight quotes (" and ') into "curly" quote -# HTML entities -# * Backticks-style quotes (``like this'') into "curly" quote -# HTML entities -# * Dashes (-- and ---) into en- and em-dash -# entities -# * Three consecutive dots (... or . . .) into an -# ellipsis entity -# -# This means you can write, edit, and save your posts using plain old -# ASCII straight quotes, plain dashes, and plain dots, but your -# published posts (and final HTML output) will appear with smart -# quotes, em-dashes, and proper ellipses. -# -# RubyPants does not modify characters within
,
-# , ,  or
-#