octopress-codeblock 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a8d963285d4e2e9e375a83c09323173e9d6b476
4
- data.tar.gz: 57a18c04383f01bb377204fba692527812c616e5
3
+ metadata.gz: 3960abd79a5edaa4949c47119cc67a47fddda358
4
+ data.tar.gz: ae9af203849773f3e2d49483862e2e531d85cc08
5
5
  SHA512:
6
- metadata.gz: cb3c9aee6c42914f1c2a9cffcc9d7bf40d8171dad23da1ec64920fa1e096523c54fa940827842e035fa902ec9345750fd37a59b50a57b1c04c06db98406a0e48
7
- data.tar.gz: 13317282009f99119e99bc912b780e7a308dcffbc550b979aaff9d90300e7588cc6783ffcfa975b405c22482821568c7306cf930f74b4c242b152651d59b0ba5
6
+ metadata.gz: e92238b97afd3cfd0da8e5ba8ae1d38eda1d7057fd5c06fdcbef29a3f7605a290e3ac00f364e8500b3acd65131e8605764e3b0cdafdf97a1aa48e02a46c40206
7
+ data.tar.gz: e18fde3d4b605aebe7520b1349ebefd33b23ff27d8a005dc15f1ac4ed62de4c3b1bccd389a524270aa32aa718f651b6bd1c3485110f974ef8f31958ff0501fac
@@ -1,6 +1,15 @@
1
1
  # Changelog
2
2
 
3
- ## 1.0.2 - 2014-06-24
3
+ ## 1.0.5 - 2015-01-04
4
+ - Documented options and added an example.
5
+
6
+ ## 1.0.4 - 2015-01-03
7
+ - Added support for Octopress docs
8
+
9
+ ## 1.0.4 - 2014-06-29
10
+ - Updated to latest octopress-code-highlighter.
11
+
12
+ ## 1.0.3 - 2014-06-28
4
13
  - Relaxed dependency versions.
5
14
 
6
15
  ## 1.0.2 - 2014-06-24
data/README.md CHANGED
@@ -6,21 +6,70 @@ Write beautiful code snippets within any template.
6
6
 
7
7
  ## Installation
8
8
 
9
- Add this line to your application's Gemfile:
9
+ ### Using Bundler
10
10
 
11
- gem 'octopress-codeblock'
11
+ Add this gem to your site's Gemfile in the `:jekyll_plugins` group:
12
12
 
13
- And then execute:
13
+ group :jekyll_plugins do
14
+ gem 'octopress-codeblock'
15
+ end
16
+
17
+ Then install the gem with Bundler
14
18
 
15
19
  $ bundle
16
20
 
17
- Or install it yourself as:
21
+ ### Manual Installation
18
22
 
19
23
  $ gem install octopress-codeblock
20
24
 
25
+ Then add the gem to your Jekyll configuration.
26
+
27
+ gems:
28
+ - octopress-codeblock
29
+
21
30
  ## Usage
22
31
 
23
- TODO: Write usage instructions here
32
+ {% codeblock [options] %}
33
+ [lines of code code]
34
+ {% endcodeblock %}
35
+
36
+ ### Options
37
+
38
+ Note that order does not matter.
39
+
40
+ | Options | Example | Description |
41
+ |:-------------|:-----------------------|:----------------------------------------------------------------------|
42
+ |`lang` | `lang:ruby` | Used by the syntax highlighter. Passing 'plain' disables highlighting.|
43
+ |`title` | `title:"Figure 1.A"` | Add a figcaption title to your code block. |
44
+ |`link_text` | `link_text:"Download"` | Text for the link, default: `"link"`. |
45
+ |`linenos` | `lineos:false` | Disable line numbering. |
46
+ |`start` | `start:5` | Start the line numbering at the given value. |
47
+ |`mark` | `mark:1-4,8` | Highlight lines of code. This example marks lines 1,2,3,4 and 8 |
48
+ |`class` | `class:"css example"` | Add CSS class names to the code `<figure>` element |
49
+
50
+
51
+ ### Example
52
+
53
+ ```
54
+ {% codeblock lang:ruby title:"Check if a number is prime" mark:3 %}
55
+ class Fixnum
56
+ def prime?
57
+ ('1' * self) !~ /^1?$|^(11+?)\1+$/
58
+ end
59
+ end
60
+ {% endcodeblock %}
61
+ ```
62
+
63
+ Demo
64
+
65
+ <!-- title:"Check if a number is prime" mark:3 -->
66
+ ```ruby
67
+ class Fixnum
68
+ def prime?
69
+ ('1' * self) !~ /^1?$|^(11+?)\1+$/
70
+ end
71
+ end
72
+ ```
24
73
 
25
74
  ## Contributing
26
75
 
@@ -58,3 +58,14 @@ module Octopress
58
58
  end
59
59
 
60
60
  Liquid::Template.register_tag('codeblock', Octopress::Codeblock::Tag)
61
+
62
+ if defined? Octopress::Docs
63
+ Octopress::Docs.add({
64
+ name: "Octopress Codeblock",
65
+ gem: "octopress-codeblock",
66
+ description: "A Liquid tag for writing beatuiful code snippets",
67
+ path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
68
+ source_url: "https://github.com/octopress/codeblock",
69
+ version: Octopress::Codeblock::VERSION
70
+ })
71
+ end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Codeblock
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-codeblock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-29 00:00:00.000000000 Z
11
+ date: 2015-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octopress-code-highlighter
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jekyll
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec
56
+ name: clash
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -73,24 +73,11 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - ".gitignore"
77
- - ".rspec"
78
- - ".travis.yml"
79
76
  - CHANGELOG.md
80
- - Gemfile
81
77
  - LICENSE.txt
82
78
  - README.md
83
- - Rakefile
84
79
  - lib/octopress-codeblock.rb
85
80
  - lib/octopress-codeblock/version.rb
86
- - octopress-codeblock.gemspec
87
- - test/.gitignore
88
- - test/Gemfile
89
- - test/_config.yml
90
- - test/_plugins/codeblock.rb
91
- - test/expected.html
92
- - test/index.html
93
- - test/test.rb
94
81
  homepage: https://github.com/octopress/codeblock
95
82
  licenses:
96
83
  - MIT
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- .DS_Store
19
- .pygments-cache
20
- _site
21
- .code-highlighter-cache
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format progress
@@ -1,5 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- script: cd test && bundle exec ruby test.rb
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in octopress-codefence.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,7 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
7
- task :test => :spec
@@ -1,24 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'octopress-codeblock/version'
5
-
6
- Gem::Specification.new do |gem|
7
- gem.name = "octopress-codeblock"
8
- gem.version = Octopress::Codeblock::VERSION
9
- gem.authors = ["Brandon Mathis"]
10
- gem.email = ["brandon@imathis.com"]
11
- gem.description = %q{Write beautiful code snippets within any template.}
12
- gem.summary = %q{Write beautiful code snippets within any template.}
13
- gem.homepage = "https://github.com/octopress/codeblock"
14
- gem.license = "MIT"
15
-
16
- gem.add_runtime_dependency 'octopress-code-highlighter', '~> 4.0'
17
-
18
- gem.add_development_dependency 'jekyll'
19
- gem.add_development_dependency 'rake'
20
- gem.add_development_dependency 'rspec'
21
-
22
- gem.files = `git ls-files`.split($/)
23
- gem.require_paths = ["lib"]
24
- end
@@ -1 +0,0 @@
1
- _site
@@ -1,5 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'jekyll'
4
- gem 'jekyll-page-hooks'
5
- gem 'octopress-codeblock', :path => '../'
@@ -1,5 +0,0 @@
1
- name: Your New Jekyll Site
2
- markdown: redcarpet
3
- highlighter: pygments
4
- pygments_aliases:
5
- abc: ruby
@@ -1 +0,0 @@
1
- require 'octopress-codeblock'
@@ -1,6 +0,0 @@
1
- <figure class='code-highlight-figure'><figcaption class='code-highlight-caption'><span class='code-highlight-caption-title'>some script.rb</span></figcaption><div class='code-highlight'><pre class='code-highlight-pre'><div data-line='1' class='code-highlight-row numbered'><div class='code-highlight-line'>puts</span> <span class="vi">@awesome</span> <span class="k">if</span> <span class="kp">true</span></div></div></pre></div></figure>
2
-
3
- <figure class='code-highlight-figure'><figcaption class='code-highlight-caption'><span class='code-highlight-caption-title'>Coffeescript Tricks</span></figcaption><div class='code-highlight'><pre class='code-highlight-pre'><div data-line='51' class='code-highlight-row numbered marked-line start-marked-line end-marked-line'><div class='code-highlight-line'># Given an alphabet:</span>
4
- </div></div><div data-line='52' class='code-highlight-row numbered'><div class='code-highlight-line'><span class="nv">alphabet = </span><span class="s">&#39;abcdefghijklmnopqrstuvwxyz&#39;</span>
5
- </div></div><div data-line='53' class='code-highlight-row numbered'><div class='code-highlight-line'> </div></div><div data-line='54' class='code-highlight-row numbered marked-line start-marked-line'><div class='code-highlight-line'><span class="c1"># Iterate over part of the alphabet:</span>
6
- </div></div><div data-line='55' class='code-highlight-row numbered marked-line end-marked-line'><div class='code-highlight-line'><span class="nx">console</span><span class="p">.</span><span class="nx">log</span> <span class="nx">letter</span> <span class="k">for</span> <span class="nx">letter</span> <span class="k">in</span> <span class="nx">alphabet</span><span class="p">[</span><span class="mi">4</span><span class="p">..</span><span class="mi">8</span><span class="p">]</span></div></div></pre></div></figure>
@@ -1,14 +0,0 @@
1
- ---
2
- ---
3
-
4
- {% codeblock some script.rb %}
5
- puts @awesome if true
6
- {% endcodeblock %}
7
-
8
- {% codeblock Coffeescript Tricks lang:coffeescript start:51 mark:51,54-55 %}
9
- # Given an alphabet:
10
- alphabet = 'abcdefghijklmnopqrstuvwxyz'
11
-
12
- # Iterate over part of the alphabet:
13
- console.log letter for letter in alphabet[4..8]
14
- {% endcodeblock %}
@@ -1,3 +0,0 @@
1
- system('jekyll build')
2
- diff = `diff _site/index.html expected.html`
3
- abort "Filed with diff: #{diff}" if diff.size > 0