Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Oct 7, 2014
1 parent 144ebd0 commit 87909ae
Show file tree
Hide file tree
Showing 57 changed files with 5,821 additions and 4 deletions.
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Andy Miller
Copyright (c) 2014 Grav

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

77 changes: 75 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,75 @@
grav-plugin-highlight
=====================
# Grav Highlight Plugin


`highlight` is a [Grav](http://github.com/getgrav/grav) plugin that adds simple and powerful code highlighting functionality utilizing the jQuery plugin [Highlight.js](https://highlightjs.org/).

# Installation

To install this plugin, just download the zip version of this repository and unzip it under `/your/site/grav/user/plugins`. Then, rename the folder to `highlight`.

You should now have all the plugin files under

/your/site/grav/user/plugins/highlight

>> NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav), the [Error](https://github.com/getgrav/grav-plugin-error) and [Problems](https://github.com/getgrav/grav-plugin-problems) plugins, and a theme to be installed in order to operate.
# Usage

To best understand how Highlight works, you should read through the original project [documentation](https://highlightjs.org/usage/).

You can override any default setings from the page headers:

eg:

---
title: Sample Code With Custom Theme
highlight:
theme: monakai
---

```
@font-face {
font-family: Chunkfive; src: url('Chunkfive.otf');
}

body, .usertext {
color: #F0F0F0; background: #600;
font-family: Chunkfive, sans;
}

@import url(print.css);
@media print {
a[href^=http]::after {
content: attr(href)
}
}
```


You can also disable highlighting for a particular page if causes issues:

---
title: Sample Code with Highlight disabled
highlight:
enabled: false
---

```
@font-face {
font-family: Chunkfive; src: url('Chunkfive.otf');
}

body, .usertext {
color: #F0F0F0; background: #600;
font-family: Chunkfive, sans;
}

@import url(print.css);
@media print {
a[href^=http]::after {
content: attr(href)
}
}
```

> Note: If you want to see this plugin in action, have a look at [Grav Learn Site](http://learn.getgrav.org)
84 changes: 84 additions & 0 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Highlight
version: 1.0.0
description: "This plugin provides code highlighting functionality via the [Highlight.js](https://highlightjs.org/) jQuery plugin."
icon: code
author:
name: Team Grav
email: devs@getgrav.org
url: http://getgrav.org
homepage: https://github.com/getgrav/grav-plugin-highlight
demo: http://learn.getgrav.org
keywords: highlight, plugin, code
bugs: https://highlight.com/getgrav/grav-plugin-highlight/issues
license: MIT

validation: strict

form:
fields:
enabled:
type: toggle
label: Plugin status
highlight: 1
default: 0
options:
1: Enabled
0: Disabled
validate:
type: bool

theme:
type: select
label: CSS Theme
default: default
options:
default: Default
monokai: Monakai
railscasts: Railscasts
arta: Arta
ascetic: Ascetic
atelier-dune.dark: Atelier Dune Dark
atelier-dune.light: Atelier Dune Light
atelier-forest.dark: Atelier Forest Dark
atelier-forest.light: Atelier Forest Light
atelier-heath.dark: Atelier Heath Dark
atelier-heath.light: Atelier Heath Light
atelier-lakeside.dark: Atelier Lakeside Dark
atelier-lakeside.light: Atelier Lakeside Light
atelier-seaside.dark: Atelier Seaside Dark
atelier-seaside.light: Atelier Seaside Light
brown_paper: Brown Paper
codepen-embed: Codepen Embed
color-brewer: Color Brewer
dark: Dark
docco: Docco
far: Far
foundation: Foundation
github: Github
googlecode: GoogleCode
hybrid: Hybrid
idea: Idea
ir_black: IRBlack
kimbie.dark: Kimbie Dark
kimbie.light: Kimbie Light
magula: Magula
mono-blue: Mono Blue
monokai_sublime: Monokai Sublime
obsidian: Obsidian
paraiso.dark: Paraiso Dark
paraiso.light: Paraiso Light
pojoaque: Pojoaque
rainbow: Rainbow
school_book: School Book
solarized_dark: Solarized Dark
solarized_light: Solarized Light
sunburst: Sunburst
tomorrow-night-blue: Tomorrow Night Blue
tomorrow-night-bright: Tomorrow Night Bright
tomorrow-night-eighties: Tomorrow Night Eighties
tomorrow-night: Tomorrow Night
tomorrow: Tomorrow
vs: VS
xcode: XCode
zenburn: Zenburn

141 changes: 141 additions & 0 deletions css/arta.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
/*
Date: 17.V.2011
Author: pumbur <pumbur@pumbur.net>
*/

.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #222;
-webkit-text-size-adjust: none;
}

.profile .hljs-header *,
.ini .hljs-title,
.nginx .hljs-title {
color: #fff;
}

.hljs-comment,
.hljs-javadoc,
.hljs-preprocessor,
.hljs-preprocessor .hljs-title,
.hljs-pragma,
.hljs-shebang,
.profile .hljs-summary,
.diff,
.hljs-pi,
.hljs-doctype,
.hljs-tag,
.hljs-template_comment,
.css .hljs-rules,
.tex .hljs-special {
color: #444;
}

.hljs-string,
.hljs-symbol,
.diff .hljs-change,
.hljs-regexp,
.xml .hljs-attribute,
.smalltalk .hljs-char,
.xml .hljs-value,
.ini .hljs-value,
.clojure .hljs-attribute,
.coffeescript .hljs-attribute {
color: #ffcc33;
}

.hljs-number,
.hljs-addition {
color: #00cc66;
}

.hljs-built_in,
.hljs-literal,
.hljs-type,
.hljs-typename,
.go .hljs-constant,
.ini .hljs-keyword,
.lua .hljs-title,
.perl .hljs-variable,
.php .hljs-variable,
.mel .hljs-variable,
.django .hljs-variable,
.css .funtion,
.smalltalk .method,
.hljs-hexcolor,
.hljs-important,
.hljs-flow,
.hljs-inheritance,
.parser3 .hljs-variable {
color: #32aaee;
}

.hljs-keyword,
.hljs-tag .hljs-title,
.css .hljs-tag,
.css .hljs-class,
.css .hljs-id,
.css .hljs-pseudo,
.css .hljs-attr_selector,
.hljs-winutils,
.tex .hljs-command,
.hljs-request,
.hljs-status {
color: #6644aa;
}

.hljs-title,
.ruby .hljs-constant,
.vala .hljs-constant,
.hljs-parent,
.hljs-deletion,
.hljs-template_tag,
.css .hljs-keyword,
.objectivec .hljs-class .hljs-id,
.smalltalk .hljs-class,
.lisp .hljs-keyword,
.apache .hljs-tag,
.nginx .hljs-variable,
.hljs-envvar,
.bash .hljs-variable,
.go .hljs-built_in,
.vbscript .hljs-built_in,
.lua .hljs-built_in,
.rsl .hljs-built_in,
.tail,
.avrasm .hljs-label,
.tex .hljs-formula,
.tex .hljs-formula * {
color: #bb1166;
}

.hljs-yardoctag,
.hljs-phpdoc,
.hljs-dartdoc,
.profile .hljs-header,
.ini .hljs-title,
.apache .hljs-tag,
.parser3 .hljs-title {
font-weight: bold;
}

.coffeescript .javascript,
.javascript .xml,
.tex .hljs-formula,
.xml .javascript,
.xml .vbscript,
.xml .css,
.xml .hljs-cdata {
opacity: 0.6;
}

.hljs,
.hljs-subst,
.diff .hljs-chunk,
.css .hljs-value,
.css .hljs-attribute {
color: #aaa;
}
53 changes: 53 additions & 0 deletions css/ascetic.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
*/

.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: white;
color: black;
-webkit-text-size-adjust: none;
}

.hljs-string,
.hljs-tag .hljs-value,
.hljs-filter .hljs-argument,
.hljs-addition,
.hljs-change,
.apache .hljs-tag,
.apache .hljs-cbracket,
.nginx .hljs-built_in,
.tex .hljs-formula {
color: #888;
}

.hljs-comment,
.hljs-template_comment,
.hljs-shebang,
.hljs-doctype,
.hljs-pi,
.hljs-javadoc,
.hljs-deletion,
.apache .hljs-sqbracket {
color: #ccc;
}

.hljs-keyword,
.hljs-tag .hljs-title,
.ini .hljs-title,
.lisp .hljs-title,
.http .hljs-title,
.nginx .hljs-title,
.css .hljs-tag,
.hljs-winutils,
.hljs-flow,
.apache .hljs-tag,
.tex .hljs-command,
.hljs-request,
.hljs-status {
font-weight: bold;
}
Loading

0 comments on commit 87909ae

Please sign in to comment.