jekyll-quicklatex 0.1.0 → 0.1.1
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/README.md +64 -14
- data/jekyll-quicklatex.gemspec +3 -2
- data/lib/jekyll/quicklatex/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e409a71d34c7ae17bc155ac62dda45af506f6acc
|
4
|
+
data.tar.gz: e4ae5dea307bc29d9287feba75741bb61044bd60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87c77ac0c1c82331d1b6707df935e0b87a02f8007c83fe581581bccc26c9c78bdb0968dc05bfae4564dda021a0460f416fa46c6fb2e6feba69223f79a3a8a50c
|
7
|
+
data.tar.gz: 6306df315cada70b2c976bbe3fbccb8e2751176a2a2555f6fb916c1fd540caef368510f0abcf23586ac60e35ae93a7695e512e973ba6a46c7b7064e2d6d7343b
|
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
# Jekyll
|
1
|
+
# Jekyll-Quicklatex
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Jekyll-Quicklatex is a converter plugin for Jekyll. It convert latex code
|
4
|
+
snippet to picture embeded in your page.
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
@@ -22,22 +21,73 @@ Or install it yourself as:
|
|
22
21
|
|
23
22
|
## Usage
|
24
23
|
|
25
|
-
|
24
|
+
for example, we use package tikz to describe a picture
|
26
25
|
|
27
|
-
|
26
|
+
```
|
27
|
+
{% latex %}
|
28
|
+
{% highlight latex %}
|
29
|
+
\usepackage{tikz}
|
30
|
+
\begin{tikzpicture}[scale=3]
|
31
|
+
\tikzset{Karl's grid/.style ={help lines,color=#1!50},
|
32
|
+
Karl's grid/.default=blue}
|
33
|
+
|
34
|
+
\clip (-0.1,-0.2) rectangle (1.1,1.51);
|
35
|
+
|
36
|
+
\draw[step=.5cm,Karl's grid] (-1.4,-1.4) grid (1.4,1.4);
|
37
|
+
\draw[->] (-1.5,0) -- (1.5,0);
|
38
|
+
\draw[->] (0, -1.5) -- (0,1.5);
|
39
|
+
\draw (0,0) circle [radius=1cm];
|
40
|
+
\shadedraw[left color=gray, right color=green, draw=green!50!black] (0,0) -- (3mm,0mm)
|
41
|
+
arc [start angle=0, end angle=30, radius=3mm] -- cycle;
|
42
|
+
|
43
|
+
\draw[red,very thick] (30:1cm) -- +(0,-0.5);
|
44
|
+
\draw[blue,very thick] (30:1cm) ++(0,-0.5) -- (0,0);
|
45
|
+
\draw[orange,very thick] (1,0) -- (1, {tan(30)});
|
46
|
+
|
47
|
+
\foreach \x in {-1cm,-0.5cm,1cm}
|
48
|
+
\draw (\x,-1pt) -- (\x,1pt);
|
49
|
+
\foreach \y in {-1cm,-0.5cm,0.5cm,1cm}
|
50
|
+
\draw (-1pt,\y) -- (1pt,\y);
|
51
|
+
\end{tikzpicture}
|
52
|
+
{% endhighlight %}
|
53
|
+
{% endlatex %}
|
54
|
+
```
|
28
55
|
|
29
|
-
|
56
|
+
it'll render the img and show its source below!
|
30
57
|
|
31
|
-
|
58
|
+
[see result here: learn tikz by examples][tikz]
|
32
59
|
|
33
|
-
##
|
60
|
+
## Strategy
|
34
61
|
|
35
|
-
|
62
|
+
This plugin visit [quicklatex][quicklatex] to compile code snippet into
|
63
|
+
picture, then fetch the picture back into `./assets/latex` directory, and
|
64
|
+
render a `<img>` on your page.
|
36
65
|
|
37
|
-
|
66
|
+
At the same time, it'll write new file named `latex.cache` to avoid recompile
|
67
|
+
the snippet again. If you want to recompile all the snippets, delete
|
68
|
+
`latex.cache` first.
|
69
|
+
|
70
|
+
**WARNING BELOW**
|
71
|
+
|
72
|
+
The process of fetching picture back is after copy assets into _site
|
73
|
+
directory when `jekyll build`. So after first build, pictures are fetched but
|
74
|
+
not in _site/. If you build again, everything's fine. That's the way I
|
75
|
+
recommend.
|
38
76
|
|
39
|
-
|
77
|
+
In this plugin, I use the stratery that adding a fallback quicklatex
|
78
|
+
link for every `<img>` links. If local picture is not found, it'll fetch remote
|
79
|
+
picture automatically. **Pay attention**, link in quicklatex has a expire time,
|
80
|
+
so don't rely on this stratery.
|
81
|
+
|
82
|
+
## Development
|
83
|
+
|
84
|
+
After checking out the repo, run `bundle install` to install dependencies. Then, run `rake` to run the tests.
|
85
|
+
|
86
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
87
|
+
|
88
|
+
## License
|
40
89
|
|
41
|
-
|
90
|
+
MIT
|
42
91
|
|
43
|
-
|
92
|
+
[tikz]: http://dreamanddead.github.io/2017/03/25/learn-tikz-by-examples.html
|
93
|
+
[quicklatex]: http://quicklatex.com/
|
data/jekyll-quicklatex.gemspec
CHANGED
@@ -9,8 +9,9 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["DreamAndDead"]
|
10
10
|
spec.email = ["aquairain@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{a jekyll converter plugin for latex
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{a jekyll converter plugin for latex.}
|
13
|
+
spec.description = %q{Jekyll-Quicklatex is a converter plugin for Jekyll. It convert latex code
|
14
|
+
snippet to picture embeded in your page.}
|
14
15
|
spec.homepage = "https://github.com/DreamAndDead/jekyll-quicklatex"
|
15
16
|
spec.license = "MIT"
|
16
17
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-quicklatex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DreamAndDead
|
@@ -80,7 +80,9 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.0'
|
83
|
-
description:
|
83
|
+
description: |-
|
84
|
+
Jekyll-Quicklatex is a converter plugin for Jekyll. It convert latex code
|
85
|
+
snippet to picture embeded in your page.
|
84
86
|
email:
|
85
87
|
- aquairain@gmail.com
|
86
88
|
executables: []
|
@@ -121,5 +123,5 @@ rubyforge_project:
|
|
121
123
|
rubygems_version: 2.6.12
|
122
124
|
signing_key:
|
123
125
|
specification_version: 4
|
124
|
-
summary: a jekyll converter plugin for latex
|
126
|
+
summary: a jekyll converter plugin for latex.
|
125
127
|
test_files: []
|