rust_playground_highlight 0.1.1 → 0.1.2

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: 1c5c72a7fc01087051546bc74ff730daafe70be3
4
- data.tar.gz: 5e65de416638025c5f52d8cb96bdb861c9da9e4a
3
+ metadata.gz: e469cd5bc98db826aca7b1c4e1fd5f2aed8ab092
4
+ data.tar.gz: 1580e4a75b5129008c05797d248ba0ec5ff71978
5
5
  SHA512:
6
- metadata.gz: b5308f18cafa27081619bece3a652d4618b2bf54ad552cb2728077294b8093a3e6d6df9a225f1c21763230e99bc52b6c30612e8cd7f201a11992d0c4a4b6556f
7
- data.tar.gz: cccd163653d4bece3779aa97a2adc385a96b5503e3517c2166c650be4fa80e16b04fb4201f77aba55d2929186c2bb8526bd9f9e4b1e72ae2514c44b5ad1f9414
6
+ metadata.gz: 83a11cbeb938615ad95b80bf9e3148343af2c1204e570a9afe8e350655b3a766dbedc8f4c2f074c55bfae19c20b38edaaaffbe42e7396e4b35373f2a7bcb8fef
7
+ data.tar.gz: cd8570e8b090334dfe88ec4c4cc76dd5ff377abed671bd0ccf55835f9b9b0261d1b597a2b497992a6cdd63aaa9c50cd5fb3a3ea22d6c002edbcb4353d8399225
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ .bundle
data/README.md CHANGED
@@ -44,9 +44,34 @@ With Gist Generated blocks only the code in the Gist is displayed in the Playgro
44
44
 
45
45
  In the example above, I've left the `main` function out of the sample code, but it is present in the [Playground](https://play.rust-lang.org/?gist=cc6e026b0654a4216074&version=stable)
46
46
 
47
- ## Requirements
47
+ ## Output
48
+
49
+ ```html
50
+ <code>
51
+ <pre>
52
+ /*your sweet Rust code*/
53
+ </pre>
54
+ <a href='https://play.rust-lang.org/...' target='_new' class='playground btn btn-xs btn-primary active' role='button'>Run</a>
55
+ </code>
56
+ ```
57
+ Thus plugin does not change how the code is rendered, it only inserts the link button between the `</pre>` and `</code>` tags.
58
+
59
+ Styling and positioning the button is up to you. No CSS is provided with this plugin. The CSS used in my example screenshot is:
60
+
61
+ ```css
62
+ div.highlight a.playground {
63
+ position: absolute;
64
+ z-index: 10;
65
+ float: right;
66
+ right: 8px;
67
+ top: 8px;
68
+ outline: none;
69
+ }
70
+ ```
48
71
 
49
- I am using this with Jekyll 2.5.3. It *should* work with Jekyll 3
72
+ ## Requirements
73
+ - I am using this with Jekyll 2.5.3. It *should* work with Jekyll 3.
74
+ - The CSS classes on the button assume you have Bootstrap.
50
75
 
51
76
  ## Limitations
52
77
 
data/VERSION.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Version History
2
2
 
3
+ # 0.1.2
4
+
5
+ - Bugfixes
6
+
3
7
  # 0.1.1
4
8
 
5
9
  - Deploying as a gem
@@ -1,7 +1,6 @@
1
1
  module Jekyll
2
2
  module Tags
3
3
  class RustPlaygroundHighlight < HighlightBlock
4
- safe true
5
4
  attr_accessor :raw, :gist_id
6
5
 
7
6
  def add_code_tag(code)
@@ -32,7 +31,7 @@ module Jekyll
32
31
 
33
32
  new(
34
33
  link_type.new(
35
- rust_highlight_block.send(link_type.id_method)
34
+ rust_highlight_block.send(link_type.required_value)
36
35
  )
37
36
  )
38
37
  end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "rust_playground_highlight"
7
+ gem.version = '0.1.2'
8
+ gem.authors = ["IanWhitney"]
9
+ gem.email = "ian@ianwhitney.com"
10
+ gem.description = %q{Automatically add links to the Rust Playground for code samples in your Jekyll site.}
11
+ gem.summary = %q{Adds a 'Run' button to your Rust code samples. You can choose to have the code in Rust Playground be dynamically generated or generated from a Gist. See the Readme for more information.}
12
+ gem.homepage = "https://github.com/IanWhitney/rust_playground_highlight"
13
+
14
+ gem.files = `git ls-files`.split($/)
15
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
16
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
+ gem.require_paths = ["lib"]
18
+ gem.license = "MIT"
19
+
20
+ gem.add_dependency "jekyll", ">= 2.0", "< 4.0"
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rust_playground_highlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - IanWhitney
@@ -37,10 +37,12 @@ executables: []
37
37
  extensions: []
38
38
  extra_rdoc_files: []
39
39
  files:
40
+ - ".gitignore"
40
41
  - README.md
41
42
  - VERSION.md
42
43
  - lib/rust_playground_highlight.rb
43
44
  - license.txt
45
+ - rust_playground_highlight.gemspec
44
46
  homepage: https://github.com/IanWhitney/rust_playground_highlight
45
47
  licenses:
46
48
  - MIT