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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80a9071c584ad61bd0e434ebea1c30d648d6d892
4
- data.tar.gz: bd42c14b27ca99b2ee9c10e249a182800fc00220
3
+ metadata.gz: e409a71d34c7ae17bc155ac62dda45af506f6acc
4
+ data.tar.gz: e4ae5dea307bc29d9287feba75741bb61044bd60
5
5
  SHA512:
6
- metadata.gz: c2d4b5ad80ee5c5642c8f1e31ad1686417fda0c8df513a3450e6485c58ef4583d8823aeaea62c0ef01a18a46fcd95886e55a926787958d6a31d11bf86f8956a2
7
- data.tar.gz: fc160826045cd01e252eb62838154a799981fac0a302ca0837994ba09d477039350bacf0890e1e02a30b6b6fb6cb34c4c8b33b3a95fee7d4a3160ae49e862891
6
+ metadata.gz: 87c77ac0c1c82331d1b6707df935e0b87a02f8007c83fe581581bccc26c9c78bdb0968dc05bfae4564dda021a0460f416fa46c6fb2e6feba69223f79a3a8a50c
7
+ data.tar.gz: 6306df315cada70b2c976bbe3fbccb8e2751176a2a2555f6fb916c1fd540caef368510f0abcf23586ac60e35ae93a7695e512e973ba6a46c7b7064e2d6d7343b
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # Jekyll::Quicklatex
1
+ # Jekyll-Quicklatex
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jekyll/quicklatex`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
24
+ for example, we use package tikz to describe a picture
26
25
 
27
- ## Development
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
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
56
+ it'll render the img and show its source below!
30
57
 
31
- 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).
58
+ [see result here: learn tikz by examples][tikz]
32
59
 
33
- ## Contributing
60
+ ## Strategy
34
61
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jekyll-quicklatex. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
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
- ## License
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
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
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
- ## Code of Conduct
90
+ MIT
42
91
 
43
- Everyone interacting in the Jekyll::Quicklatex project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/jekyll-quicklatex/blob/master/CODE_OF_CONDUCT.md).
92
+ [tikz]: http://dreamanddead.github.io/2017/03/25/learn-tikz-by-examples.html
93
+ [quicklatex]: http://quicklatex.com/
@@ -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 tikz.}
13
- spec.description = %q{jekyll-quicklatex, a jekyll converter plugin for latex tikz.}
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
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Quicklatex
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
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.0
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: jekyll-quicklatex, a jekyll converter plugin for latex tikz.
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 tikz.
126
+ summary: a jekyll converter plugin for latex.
125
127
  test_files: []