org2hiki 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3dd737566797eec4731b6291981c7516d63cb754f5dd414c12103dc08e97cd0
4
- data.tar.gz: b922d9af8548b5c7f3a5b8f9d86c9fb153771442526edc16e080db9e3cd0dc55
3
+ metadata.gz: 4655130115704ca329995ede55b9e1cf67c628fb9f87eeb9f6ccb7f0fc61b729
4
+ data.tar.gz: 6672da4dd4ea152905ce905e0909d9390d61007638279c2add1c40946166e9c8
5
5
  SHA512:
6
- metadata.gz: bede8fc05b93760524908911b83660abd54d0d4103ad43a0c3d705a57377ea8409e4a16452335ae6df9d2066c4423a3ec9b8fb1d7ef3ad4be7c75931492ee0f1
7
- data.tar.gz: b3b75715ee08e3dea5d119d570ca93f3fa34a62fa89e27f97c21300d426565bcfe5efcf2cf489438164e0065397b3c6cbf47923f73c1cc77c05ea8a92e88f1aa
6
+ metadata.gz: d64560405a96f1d9e2ec70c46d57d7517bdfe1ce484d2836655fb7246be66ebbc002fd9b5a57d56313b47abb2e242c9a560057e5b0d984e81cd1bc95ace49268
7
+ data.tar.gz: a65b7ac61d6b7b597149f5bb3e3df32d1cc8a0b28e0500ce5a55a880e0fad236eaad7bbe2a3ad04b60801eb57f570d15ff7c1ccf89cb2e783951b893c7370493
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- org2hiki (0.1.0)
4
+ org2hiki (0.1.1)
5
5
  thor
6
6
 
7
7
  GEM
@@ -84,6 +84,9 @@ class ToHiki
84
84
  when "begin_src ruby"
85
85
  @in_example = true
86
86
  return "<<< ruby"
87
+ when "begin_src python"
88
+ @in_example = true
89
+ return "<<< python"
87
90
  when "end_src", "end_example"
88
91
  @in_example = false
89
92
  return ">>>"
@@ -128,7 +131,7 @@ class ToHiki
128
131
  end
129
132
  else
130
133
  if m = string.match(/file:(.+)\]\]/) # url? judges file:hoge.pdf == url
131
- "{{attach_anchor(#{m[1]})}}"
134
+ check_file_extension(m[1])
132
135
  else
133
136
  if m2 = m1[2].match(/\[(.+)\]/)
134
137
  "[[#{m2[1]}|#{m1[1]}]]"
@@ -140,6 +143,18 @@ class ToHiki
140
143
  return string2
141
144
  end
142
145
 
146
+ def check_file_extension(m)
147
+ if m.match(/\.(.+)$/) == nil
148
+ raise "The file link #{m} has an xceptional file extension."
149
+ end
150
+ case m.match(/\.(.+)$/)[1]
151
+ when "png"; "{{attach_view(#{m})}}"
152
+ when "pdf"; "{{attach_anchor(#{m})}}"
153
+ else
154
+ "{{attach_anchor(#{m})}}"
155
+ end
156
+ end
157
+
143
158
  require "uri"
144
159
 
145
160
  def url?(url_string)
@@ -1,3 +1,3 @@
1
1
  module Org2hiki
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: org2hiki
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
  - Shigeto R. Nishitani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-26 00:00:00.000000000 Z
11
+ date: 2022-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler