rust_playground_highlight 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +27 -2
- data/VERSION.md +4 -0
- data/lib/rust_playground_highlight.rb +1 -2
- data/rust_playground_highlight.gemspec +21 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e469cd5bc98db826aca7b1c4e1fd5f2aed8ab092
|
4
|
+
data.tar.gz: 1580e4a75b5129008c05797d248ba0ec5ff71978
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
##
|
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
|
-
|
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,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.
|
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.
|
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
|