qiita_org 0.1.16 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/qiita_org.rb +18 -7
- data/lib/qiita_org/decide_option.rb +22 -0
- data/lib/qiita_org/get.rb +14 -5
- data/lib/qiita_org/get_file_path.rb +16 -8
- data/lib/qiita_org/md_converter_for_image.rb +29 -0
- data/lib/qiita_org/post.rb +4 -0
- data/lib/qiita_org/show_file_and_url.rb +83 -3
- data/lib/qiita_org/version.rb +1 -1
- data/{hoge.rb → tests/hoge.rb} +0 -0
- data/tests/test.html +280 -0
- data/tests/test.org +26 -0
- data/{test.md → tests/test2.md} +1 -3
- data/{test.org → tests/test2.org} +2 -3
- data/tests/test3.org +15 -0
- metadata +10 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08e12d5c8b442eedf009fa8f48b4e2f0b1af5379600ccf15a1c1d1d035481a05'
|
4
|
+
data.tar.gz: 3841ad75ffacd131b9f6dd55fa7dfd098e3ea78af2c1cf539158c193efaae356
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca8bfb7e6d185931783d261776ae3335478df595b7411afd07a8fbf71f1f4e6d509eece8f661af95d97f4add8559f8b5bbf2d0b8cacee208077d1112c9e4e94e
|
7
|
+
data.tar.gz: f1a7b942323d6294f38bc4f21ca70ed081ca4bb331dad8d40e171fd3499bb7f6040fd3eef75a133fb00500cd209298d49156f0f0d97956a0d65c021fa34e41f1
|
data/Gemfile.lock
CHANGED
data/lib/qiita_org.rb
CHANGED
@@ -11,6 +11,7 @@ require "qiita_org/get_template"
|
|
11
11
|
require "qiita_org/check_pc_os"
|
12
12
|
require "qiita_org/get_file_path"
|
13
13
|
require "qiita_org/show_file_and_url"
|
14
|
+
require "qiita_org/decide_option"
|
14
15
|
#require "qiita_org/qiita_org_thor"
|
15
16
|
|
16
17
|
module QiitaOrg
|
@@ -38,7 +39,7 @@ module QiitaOrg
|
|
38
39
|
|
39
40
|
p ["in qiita_org.rb", argv]
|
40
41
|
p file = argv[0] || "README.org"
|
41
|
-
p mode = argv[1] ||
|
42
|
+
p mode = argv[1] || DecideOption.new(file).decide_option()
|
42
43
|
qiita = QiitaPost.new(file, mode, os)
|
43
44
|
begin
|
44
45
|
qiita.select_option(mode)
|
@@ -47,21 +48,31 @@ module QiitaOrg
|
|
47
48
|
else
|
48
49
|
qiita.run
|
49
50
|
end
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "upload [FILE] [teams/public/private]", "upload about image to qiita"
|
54
|
+
|
55
|
+
def upload(*argv)
|
56
|
+
checkos = CheckPcOs.new
|
57
|
+
os = checkos.return_os()
|
58
|
+
|
59
|
+
p file = argv[0] || "README.org"
|
60
|
+
p mode = argv[1] || "private"
|
50
61
|
|
51
|
-
=begin
|
52
62
|
getpath = GetFilePath.new(file)
|
53
63
|
paths = getpath.get_file_path()
|
54
64
|
unless paths.empty?
|
55
|
-
showfile = ShowFile.new(paths, file, mode)
|
65
|
+
showfile = ShowFile.new(paths, file, mode, os)
|
56
66
|
showfile.open_file_dir()
|
57
|
-
|
67
|
+
showfile.open_qiita()
|
68
|
+
|
69
|
+
puts "Input file URL's on #{file}? (y/n)".green
|
58
70
|
ans = STDIN.getch
|
59
71
|
|
60
72
|
if ans == "y"
|
61
|
-
showfile.
|
73
|
+
showfile.input_url_to_org()
|
62
74
|
end
|
63
75
|
end
|
64
|
-
=end
|
65
76
|
end
|
66
77
|
|
67
78
|
desc "config [global/local] [option] [input]", "set config"
|
@@ -74,7 +85,7 @@ module QiitaOrg
|
|
74
85
|
config.run
|
75
86
|
end
|
76
87
|
|
77
|
-
desc "get [qiita/teams] [
|
88
|
+
desc "get [qiita/teams] [ITEM_ID]", "get qiita report"
|
78
89
|
|
79
90
|
def get(*argv)
|
80
91
|
p mode = argv[0] || "qiita"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class DecideOption
|
2
|
+
def initialize(src)
|
3
|
+
@src = src
|
4
|
+
end
|
5
|
+
|
6
|
+
def decide_option()
|
7
|
+
lines = File.readlines(@src)
|
8
|
+
|
9
|
+
lines.each do |line|
|
10
|
+
if line.match(/\#\+qiita_(.+): (.+)/)
|
11
|
+
option = line.match(/\#\+qiita_(.+): (.+)/)[1]
|
12
|
+
return option
|
13
|
+
end
|
14
|
+
end
|
15
|
+
option = "private"
|
16
|
+
return option
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
if __FILE__ == $0
|
21
|
+
DecideOption.new("test.org").decide_option()
|
22
|
+
end
|
data/lib/qiita_org/get.rb
CHANGED
@@ -40,11 +40,19 @@ class QiitaGet
|
|
40
40
|
headers = { "Authorization" => "Bearer #{@access_token}",
|
41
41
|
"Content-Type" => "application/json" }
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
begin
|
44
|
+
response = URI.open(
|
45
|
+
"#{uri}",
|
46
|
+
"Authorization" => "#{headers["Authorization"]}",
|
47
|
+
)
|
48
|
+
#raise "NOT FOUND: # {@get_id} report".red
|
49
|
+
rescue => e
|
50
|
+
puts "#{$!}".red
|
51
|
+
exit
|
52
|
+
else
|
53
|
+
p response
|
54
|
+
@items = JSON.parse(response.read)
|
55
|
+
end
|
48
56
|
end
|
49
57
|
|
50
58
|
# select report
|
@@ -121,6 +129,7 @@ EOS
|
|
121
129
|
# see massage and delete id.md
|
122
130
|
def puts_massage_and_delete_md()
|
123
131
|
puts "created #{@id}.org".green
|
132
|
+
puts "URL: #{@items["url"]}"
|
124
133
|
system "rm -f #{@id}.md"
|
125
134
|
end
|
126
135
|
|
@@ -4,19 +4,27 @@ class GetFilePath
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def get_file_path()
|
7
|
-
lines = File.readlines(@src.gsub(".org", ".md"))
|
7
|
+
#lines = File.readlines(@src.gsub(".org", ".md"))
|
8
|
+
lines = File.readlines(@src)
|
8
9
|
files = []
|
9
10
|
lines.each do |line|
|
10
|
-
if path2 = line.match(/\!\[img\]\(((.+))"(.+)"\)/)
|
11
|
-
|
11
|
+
#if path2 = line.match(/\!\[img\]\(((.+))/)# "(.+)"\)/)
|
12
|
+
#if path2 = line.match(/\[\[file\:(.+)\](.+)\]\]/) || line.match(/\[\[file:(.+)\]\]/)
|
13
|
+
if path2 = line.match(/\[\[(.+)\]\[file:(.+)\]\]/) || line.match(/\[\[file:(.+)\]\]/)
|
14
|
+
if path2[2] == nil
|
15
|
+
files << path2[1]
|
16
|
+
else
|
17
|
+
files << path2[2]
|
18
|
+
end
|
12
19
|
end
|
13
20
|
end
|
14
21
|
|
15
|
-
paths = []
|
16
|
-
files.each do |file|
|
17
|
-
paths << File.join(Dir.pwd, file)
|
18
|
-
end
|
19
|
-
return paths
|
22
|
+
#paths = []
|
23
|
+
#files.each do |file|
|
24
|
+
#paths << File.join(Dir.pwd, file)
|
25
|
+
#end
|
26
|
+
#return paths
|
27
|
+
return files
|
20
28
|
end
|
21
29
|
end
|
22
30
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class MdConverter
|
2
|
+
def initialize(lines)
|
3
|
+
@lines = lines
|
4
|
+
end
|
5
|
+
|
6
|
+
def convert_for_image()
|
7
|
+
@lines.each_with_index do |line, i|
|
8
|
+
m = []
|
9
|
+
if m = line.match(/\[\!\[img\]\((.+) "(.+)"\)\]\((.+)\)/)
|
10
|
+
path = File.basename(m[1])
|
11
|
+
url = m[3]
|
12
|
+
@lines[i] = "![#{path}](#{url})\n"
|
13
|
+
elsif m = line.match(/\[\!\[img\]\((.+)\)\]\((.+)\)/)
|
14
|
+
path = File.basename(m[1])
|
15
|
+
url = m[2]
|
16
|
+
@lines[i] = "![#{path}](#{url})\n"
|
17
|
+
else
|
18
|
+
next
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
return @lines
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
if __FILE__ == $0
|
27
|
+
p lines = File.readlines("test.md")
|
28
|
+
p lines2 = MdConverter.new(lines).convert_for_image()
|
29
|
+
end
|
data/lib/qiita_org/post.rb
CHANGED
@@ -5,6 +5,7 @@ require "json"
|
|
5
5
|
require "command_line/global"
|
6
6
|
require "colorize"
|
7
7
|
require "qiita_org/search_conf_path.rb"
|
8
|
+
require "qiita_org/md_converter_for_image"
|
8
9
|
|
9
10
|
class QiitaPost
|
10
11
|
def initialize(file, option, os)
|
@@ -155,6 +156,7 @@ class QiitaPost
|
|
155
156
|
set_config()
|
156
157
|
convert_org_to_md()
|
157
158
|
add_source_path_in_md()
|
159
|
+
@lines = MdConverter.new(@lines).convert_for_image()
|
158
160
|
select_patch_or_post()
|
159
161
|
@qiita, @private = select_option(@option)
|
160
162
|
qiita_post()
|
@@ -163,6 +165,8 @@ class QiitaPost
|
|
163
165
|
open_qiita()
|
164
166
|
|
165
167
|
add_qiita_id_on_org()
|
168
|
+
|
169
|
+
system "rm #{@src.gsub(".org", ".md")}"
|
166
170
|
end
|
167
171
|
end
|
168
172
|
|
@@ -2,25 +2,71 @@ require "colorize"
|
|
2
2
|
require "qiita_org/get_file_url.rb"
|
3
3
|
|
4
4
|
class ShowFile
|
5
|
-
def initialize(paths, src, mode)
|
5
|
+
def initialize(paths, src, mode, os)
|
6
6
|
@paths = paths
|
7
7
|
@src = src
|
8
8
|
@mode = (mode == "qiita" || mode == "open")? "public" : mode
|
9
|
+
@os = os
|
10
|
+
search = SearchConfPath.new(Dir.pwd, Dir.home)
|
11
|
+
@conf_dir = search.search_conf_path()
|
12
|
+
end
|
13
|
+
|
14
|
+
def set_config()
|
15
|
+
conf_path = File.join(@conf_dir, ".qiita.conf")
|
16
|
+
@conf = JSON.load(File.read(conf_path))
|
17
|
+
@access_token = @conf["access_token"]
|
18
|
+
@teams_url = @conf["teams_url"]
|
9
19
|
end
|
10
20
|
|
11
21
|
def open_file_dir()
|
12
22
|
previous_paths = []
|
13
23
|
previous_paths << File.join(@paths[0].split("/")[0..-2])
|
14
|
-
|
24
|
+
if @os == "mac"
|
25
|
+
system "open #{File.join(@paths[0].split("/")[0..-2])}"
|
26
|
+
elsif @os == "windows"
|
27
|
+
system "explorer.exe #{File.join(@paths[0].split("/")[0..-2])}"
|
28
|
+
else
|
29
|
+
system "open #{File.join(@paths[0].split("/")[0..-2])}"
|
30
|
+
system "xdg-open #{File.join(@paths[0].split("/")[0..-2])}"
|
31
|
+
end
|
15
32
|
@paths.each do |path|
|
16
33
|
dir_path = File.join(path.split("/")[0..-2])
|
17
34
|
unless previous_paths.include?(dir_path)
|
18
35
|
previous_paths << dir_path
|
19
|
-
system "open #{dir_path}"
|
36
|
+
#system "open #{dir_path}"
|
37
|
+
if @os == "mac"
|
38
|
+
system "open #{dir_path}"
|
39
|
+
elsif @os == "windows"
|
40
|
+
system "explorer.exe #{dir_path}"
|
41
|
+
else
|
42
|
+
system "open #{dir_path}"
|
43
|
+
system "xdg-open #{dir_path}"
|
44
|
+
end
|
20
45
|
end
|
21
46
|
end
|
22
47
|
end
|
23
48
|
|
49
|
+
def open_qiita()
|
50
|
+
conts = File.read(@src)
|
51
|
+
id = conts.match(/\#\+qiita_#{@mode}: (.+)/)[1]
|
52
|
+
|
53
|
+
set_config()
|
54
|
+
|
55
|
+
qiita = (@mode == "teams")? @teams_url : "https://qiita.com/"
|
56
|
+
path = "api/v2/items/#{id}"
|
57
|
+
|
58
|
+
items = access_qiita(@access_token, qiita, path)
|
59
|
+
|
60
|
+
if @os == "mac"
|
61
|
+
system "open #{items["url"]}"
|
62
|
+
elsif @os == "windows"
|
63
|
+
system "explorer.exe #{items["url"]}"
|
64
|
+
else
|
65
|
+
system "open #{items["url"]}"
|
66
|
+
system "xdg-open #{items["url"]}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
24
70
|
def show_file_url()
|
25
71
|
conts = File.read(@src)
|
26
72
|
id = conts.match(/\#\+qiita_#{@mode}: (.+)/)[1]
|
@@ -33,4 +79,38 @@ class ShowFile
|
|
33
79
|
puts url
|
34
80
|
end
|
35
81
|
end
|
82
|
+
|
83
|
+
def input_url_to_org()
|
84
|
+
lines = File.readlines(@src)
|
85
|
+
conts = File.read(@src)
|
86
|
+
id = conts.match(/\#\+qiita_#{@mode}: (.+)/)[1]
|
87
|
+
|
88
|
+
@paths.each do |path|
|
89
|
+
file_name = File.basename(path).strip
|
90
|
+
geturl = GetFileUrl.new(id, file_name, @mode)
|
91
|
+
url = geturl.get_file_url()
|
92
|
+
lines.each_with_index do |line, i|
|
93
|
+
if line.match(/\[\[file:#{path}\]\]/)
|
94
|
+
#lines[i] = "[[file:# {path}][# {url}]]\n"
|
95
|
+
lines[i] = "[[#{url}][file:#{path}]]\n"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
#p lines
|
100
|
+
File.write(@src, lines.join)
|
101
|
+
end
|
102
|
+
|
103
|
+
def access_qiita(access_token, qiita, path)
|
104
|
+
uri = URI.parse(qiita + path)
|
105
|
+
|
106
|
+
headers = { "Authorization" => "Bearer #{access_token}",
|
107
|
+
"Content-Type" => "application/json" }
|
108
|
+
|
109
|
+
response = URI.open(
|
110
|
+
"#{uri}",
|
111
|
+
"Authorization" => "#{headers["Authorization"]}",
|
112
|
+
)
|
113
|
+
items = JSON.parse(response.read)
|
114
|
+
return items
|
115
|
+
end
|
36
116
|
end
|
data/lib/qiita_org/version.rb
CHANGED
data/{hoge.rb → tests/hoge.rb}
RENAMED
File without changes
|
data/tests/test.html
ADDED
@@ -0,0 +1,280 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
|
5
|
+
<head>
|
6
|
+
<!-- 2020-10-20 火 14:30 -->
|
7
|
+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
9
|
+
<title>test</title>
|
10
|
+
<meta name="generator" content="Org mode" />
|
11
|
+
<meta name="author" content="Kenta Yamamoto" />
|
12
|
+
<style type="text/css">
|
13
|
+
<!--/*--><![CDATA[/*><!--*/
|
14
|
+
.title { text-align: center;
|
15
|
+
margin-bottom: .2em; }
|
16
|
+
.subtitle { text-align: center;
|
17
|
+
font-size: medium;
|
18
|
+
font-weight: bold;
|
19
|
+
margin-top:0; }
|
20
|
+
.todo { font-family: monospace; color: red; }
|
21
|
+
.done { font-family: monospace; color: green; }
|
22
|
+
.priority { font-family: monospace; color: orange; }
|
23
|
+
.tag { background-color: #eee; font-family: monospace;
|
24
|
+
padding: 2px; font-size: 80%; font-weight: normal; }
|
25
|
+
.timestamp { color: #bebebe; }
|
26
|
+
.timestamp-kwd { color: #5f9ea0; }
|
27
|
+
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
|
28
|
+
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
|
29
|
+
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
|
30
|
+
.underline { text-decoration: underline; }
|
31
|
+
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
|
32
|
+
p.verse { margin-left: 3%; }
|
33
|
+
pre {
|
34
|
+
border: 1px solid #ccc;
|
35
|
+
box-shadow: 3px 3px 3px #eee;
|
36
|
+
padding: 8pt;
|
37
|
+
font-family: monospace;
|
38
|
+
overflow: auto;
|
39
|
+
margin: 1.2em;
|
40
|
+
}
|
41
|
+
pre.src {
|
42
|
+
position: relative;
|
43
|
+
overflow: visible;
|
44
|
+
padding-top: 1.2em;
|
45
|
+
}
|
46
|
+
pre.src:before {
|
47
|
+
display: none;
|
48
|
+
position: absolute;
|
49
|
+
background-color: white;
|
50
|
+
top: -10px;
|
51
|
+
right: 10px;
|
52
|
+
padding: 3px;
|
53
|
+
border: 1px solid black;
|
54
|
+
}
|
55
|
+
pre.src:hover:before { display: inline;}
|
56
|
+
/* Languages per Org manual */
|
57
|
+
pre.src-asymptote:before { content: 'Asymptote'; }
|
58
|
+
pre.src-awk:before { content: 'Awk'; }
|
59
|
+
pre.src-C:before { content: 'C'; }
|
60
|
+
/* pre.src-C++ doesn't work in CSS */
|
61
|
+
pre.src-clojure:before { content: 'Clojure'; }
|
62
|
+
pre.src-css:before { content: 'CSS'; }
|
63
|
+
pre.src-D:before { content: 'D'; }
|
64
|
+
pre.src-ditaa:before { content: 'ditaa'; }
|
65
|
+
pre.src-dot:before { content: 'Graphviz'; }
|
66
|
+
pre.src-calc:before { content: 'Emacs Calc'; }
|
67
|
+
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
|
68
|
+
pre.src-fortran:before { content: 'Fortran'; }
|
69
|
+
pre.src-gnuplot:before { content: 'gnuplot'; }
|
70
|
+
pre.src-haskell:before { content: 'Haskell'; }
|
71
|
+
pre.src-hledger:before { content: 'hledger'; }
|
72
|
+
pre.src-java:before { content: 'Java'; }
|
73
|
+
pre.src-js:before { content: 'Javascript'; }
|
74
|
+
pre.src-latex:before { content: 'LaTeX'; }
|
75
|
+
pre.src-ledger:before { content: 'Ledger'; }
|
76
|
+
pre.src-lisp:before { content: 'Lisp'; }
|
77
|
+
pre.src-lilypond:before { content: 'Lilypond'; }
|
78
|
+
pre.src-lua:before { content: 'Lua'; }
|
79
|
+
pre.src-matlab:before { content: 'MATLAB'; }
|
80
|
+
pre.src-mscgen:before { content: 'Mscgen'; }
|
81
|
+
pre.src-ocaml:before { content: 'Objective Caml'; }
|
82
|
+
pre.src-octave:before { content: 'Octave'; }
|
83
|
+
pre.src-org:before { content: 'Org mode'; }
|
84
|
+
pre.src-oz:before { content: 'OZ'; }
|
85
|
+
pre.src-plantuml:before { content: 'Plantuml'; }
|
86
|
+
pre.src-processing:before { content: 'Processing.js'; }
|
87
|
+
pre.src-python:before { content: 'Python'; }
|
88
|
+
pre.src-R:before { content: 'R'; }
|
89
|
+
pre.src-ruby:before { content: 'Ruby'; }
|
90
|
+
pre.src-sass:before { content: 'Sass'; }
|
91
|
+
pre.src-scheme:before { content: 'Scheme'; }
|
92
|
+
pre.src-screen:before { content: 'Gnu Screen'; }
|
93
|
+
pre.src-sed:before { content: 'Sed'; }
|
94
|
+
pre.src-sh:before { content: 'shell'; }
|
95
|
+
pre.src-sql:before { content: 'SQL'; }
|
96
|
+
pre.src-sqlite:before { content: 'SQLite'; }
|
97
|
+
/* additional languages in org.el's org-babel-load-languages alist */
|
98
|
+
pre.src-forth:before { content: 'Forth'; }
|
99
|
+
pre.src-io:before { content: 'IO'; }
|
100
|
+
pre.src-J:before { content: 'J'; }
|
101
|
+
pre.src-makefile:before { content: 'Makefile'; }
|
102
|
+
pre.src-maxima:before { content: 'Maxima'; }
|
103
|
+
pre.src-perl:before { content: 'Perl'; }
|
104
|
+
pre.src-picolisp:before { content: 'Pico Lisp'; }
|
105
|
+
pre.src-scala:before { content: 'Scala'; }
|
106
|
+
pre.src-shell:before { content: 'Shell Script'; }
|
107
|
+
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
|
108
|
+
/* additional language identifiers per "defun org-babel-execute"
|
109
|
+
in ob-*.el */
|
110
|
+
pre.src-cpp:before { content: 'C++'; }
|
111
|
+
pre.src-abc:before { content: 'ABC'; }
|
112
|
+
pre.src-coq:before { content: 'Coq'; }
|
113
|
+
pre.src-groovy:before { content: 'Groovy'; }
|
114
|
+
/* additional language identifiers from org-babel-shell-names in
|
115
|
+
ob-shell.el: ob-shell is the only babel language using a lambda to put
|
116
|
+
the execution function name together. */
|
117
|
+
pre.src-bash:before { content: 'bash'; }
|
118
|
+
pre.src-csh:before { content: 'csh'; }
|
119
|
+
pre.src-ash:before { content: 'ash'; }
|
120
|
+
pre.src-dash:before { content: 'dash'; }
|
121
|
+
pre.src-ksh:before { content: 'ksh'; }
|
122
|
+
pre.src-mksh:before { content: 'mksh'; }
|
123
|
+
pre.src-posh:before { content: 'posh'; }
|
124
|
+
/* Additional Emacs modes also supported by the LaTeX listings package */
|
125
|
+
pre.src-ada:before { content: 'Ada'; }
|
126
|
+
pre.src-asm:before { content: 'Assembler'; }
|
127
|
+
pre.src-caml:before { content: 'Caml'; }
|
128
|
+
pre.src-delphi:before { content: 'Delphi'; }
|
129
|
+
pre.src-html:before { content: 'HTML'; }
|
130
|
+
pre.src-idl:before { content: 'IDL'; }
|
131
|
+
pre.src-mercury:before { content: 'Mercury'; }
|
132
|
+
pre.src-metapost:before { content: 'MetaPost'; }
|
133
|
+
pre.src-modula-2:before { content: 'Modula-2'; }
|
134
|
+
pre.src-pascal:before { content: 'Pascal'; }
|
135
|
+
pre.src-ps:before { content: 'PostScript'; }
|
136
|
+
pre.src-prolog:before { content: 'Prolog'; }
|
137
|
+
pre.src-simula:before { content: 'Simula'; }
|
138
|
+
pre.src-tcl:before { content: 'tcl'; }
|
139
|
+
pre.src-tex:before { content: 'TeX'; }
|
140
|
+
pre.src-plain-tex:before { content: 'Plain TeX'; }
|
141
|
+
pre.src-verilog:before { content: 'Verilog'; }
|
142
|
+
pre.src-vhdl:before { content: 'VHDL'; }
|
143
|
+
pre.src-xml:before { content: 'XML'; }
|
144
|
+
pre.src-nxml:before { content: 'XML'; }
|
145
|
+
/* add a generic configuration mode; LaTeX export needs an additional
|
146
|
+
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
|
147
|
+
pre.src-conf:before { content: 'Configuration File'; }
|
148
|
+
|
149
|
+
table { border-collapse:collapse; }
|
150
|
+
caption.t-above { caption-side: top; }
|
151
|
+
caption.t-bottom { caption-side: bottom; }
|
152
|
+
td, th { vertical-align:top; }
|
153
|
+
th.org-right { text-align: center; }
|
154
|
+
th.org-left { text-align: center; }
|
155
|
+
th.org-center { text-align: center; }
|
156
|
+
td.org-right { text-align: right; }
|
157
|
+
td.org-left { text-align: left; }
|
158
|
+
td.org-center { text-align: center; }
|
159
|
+
dt { font-weight: bold; }
|
160
|
+
.footpara { display: inline; }
|
161
|
+
.footdef { margin-bottom: 1em; }
|
162
|
+
.figure { padding: 1em; }
|
163
|
+
.figure p { text-align: center; }
|
164
|
+
.equation-container {
|
165
|
+
display: table;
|
166
|
+
text-align: center;
|
167
|
+
width: 100%;
|
168
|
+
}
|
169
|
+
.equation {
|
170
|
+
vertical-align: middle;
|
171
|
+
}
|
172
|
+
.equation-label {
|
173
|
+
display: table-cell;
|
174
|
+
text-align: right;
|
175
|
+
vertical-align: middle;
|
176
|
+
}
|
177
|
+
.inlinetask {
|
178
|
+
padding: 10px;
|
179
|
+
border: 2px solid gray;
|
180
|
+
margin: 10px;
|
181
|
+
background: #ffffcc;
|
182
|
+
}
|
183
|
+
#org-div-home-and-up
|
184
|
+
{ text-align: right; font-size: 70%; white-space: nowrap; }
|
185
|
+
textarea { overflow-x: auto; }
|
186
|
+
.linenr { font-size: smaller }
|
187
|
+
.code-highlighted { background-color: #ffff00; }
|
188
|
+
.org-info-js_info-navigation { border-style: none; }
|
189
|
+
#org-info-js_console-label
|
190
|
+
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
|
191
|
+
.org-info-js_search-highlight
|
192
|
+
{ background-color: #ffff00; color: #000000; font-weight: bold; }
|
193
|
+
.org-svg { width: 90%; }
|
194
|
+
/*]]>*/-->
|
195
|
+
</style>
|
196
|
+
<script type="text/javascript">
|
197
|
+
/*
|
198
|
+
@licstart The following is the entire license notice for the
|
199
|
+
JavaScript code in this tag.
|
200
|
+
|
201
|
+
Copyright (C) 2012-2020 Free Software Foundation, Inc.
|
202
|
+
|
203
|
+
The JavaScript code in this tag is free software: you can
|
204
|
+
redistribute it and/or modify it under the terms of the GNU
|
205
|
+
General Public License (GNU GPL) as published by the Free Software
|
206
|
+
Foundation, either version 3 of the License, or (at your option)
|
207
|
+
any later version. The code is distributed WITHOUT ANY WARRANTY;
|
208
|
+
without even the implied warranty of MERCHANTABILITY or FITNESS
|
209
|
+
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
210
|
+
|
211
|
+
As additional permission under GNU GPL version 3 section 7, you
|
212
|
+
may distribute non-source (e.g., minimized or compacted) forms of
|
213
|
+
that code without the copy of the GNU GPL normally required by
|
214
|
+
section 4, provided you include this license notice and a URL
|
215
|
+
through which recipients can access the Corresponding Source.
|
216
|
+
|
217
|
+
|
218
|
+
@licend The above is the entire license notice
|
219
|
+
for the JavaScript code in this tag.
|
220
|
+
*/
|
221
|
+
<!--/*--><![CDATA[/*><!--*/
|
222
|
+
function CodeHighlightOn(elem, id)
|
223
|
+
{
|
224
|
+
var target = document.getElementById(id);
|
225
|
+
if(null != target) {
|
226
|
+
elem.cacheClassElem = elem.className;
|
227
|
+
elem.cacheClassTarget = target.className;
|
228
|
+
target.className = "code-highlighted";
|
229
|
+
elem.className = "code-highlighted";
|
230
|
+
}
|
231
|
+
}
|
232
|
+
function CodeHighlightOff(elem, id)
|
233
|
+
{
|
234
|
+
var target = document.getElementById(id);
|
235
|
+
if(elem.cacheClassElem)
|
236
|
+
elem.className = elem.cacheClassElem;
|
237
|
+
if(elem.cacheClassTarget)
|
238
|
+
target.className = elem.cacheClassTarget;
|
239
|
+
}
|
240
|
+
/*]]>*///-->
|
241
|
+
</script>
|
242
|
+
</head>
|
243
|
+
<body>
|
244
|
+
<div id="content">
|
245
|
+
<h1 class="title">test</h1>
|
246
|
+
<p>
|
247
|
+
![Mac OS X-10.13.3](<a href="https://img.shields.io/badge/MacOSX-10.13.3-brightgreen">https://img.shields.io/badge/MacOSX-10.13.3-brightgreen</a>) ![ruby-2.7.0p0](<a href="https://img.shields.io/badge/ruby-2.7.0p0-brightgreen">https://img.shields.io/badge/ruby-2.7.0p0-brightgreen</a>)
|
248
|
+
</p>
|
249
|
+
|
250
|
+
<p>
|
251
|
+
fogefoge
|
252
|
+
</p>
|
253
|
+
|
254
|
+
|
255
|
+
<div class="figure">
|
256
|
+
<p><a href="figs/fig1.png"><img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png" alt="a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png" /></a>
|
257
|
+
</p>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
<div id="org244c236" class="figure">
|
263
|
+
<p><img src="figs/fig2.png" alt="fig2.png" />
|
264
|
+
</p>
|
265
|
+
<p><span class="figure-number">Figure 2: </span>example qiita template command</p>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
|
269
|
+
<div class="figure">
|
270
|
+
<p><img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png" alt="a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png" />
|
271
|
+
</p>
|
272
|
+
</div>
|
273
|
+
</div>
|
274
|
+
<div id="postamble" class="status">
|
275
|
+
<p class="author">Author: Kenta Yamamoto</p>
|
276
|
+
<p class="date">Created: 2020-10-20 火 14:30</p>
|
277
|
+
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
278
|
+
</div>
|
279
|
+
</body>
|
280
|
+
</html>
|
data/tests/test.org
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#+qiita_private: 5f8c73e8007e52ef3f40
|
2
|
+
#+OPTIONS: ^:{}
|
3
|
+
#+STARTUP: indent nolineimages
|
4
|
+
#+TITLE: test
|
5
|
+
#+AUTHOR: Kenta Yamamoto
|
6
|
+
#+EMAIL: (concat "doi35077@kwansei.ac.jp")
|
7
|
+
#+LANGUAGE: jp
|
8
|
+
# +OPTIONS: H:4 toc:t num:2
|
9
|
+
#+OPTIONS: toc:nil
|
10
|
+
#+TAG: test
|
11
|
+
# +SETUPFILE: ~/.emacs.d/org-mode/theme-readtheorg.setup
|
12
|
+
|
13
|
+
![Mac OS X-10.13.3](https://img.shields.io/badge/MacOSX-10.13.3-brightgreen) ![ruby-2.7.0p0](https://img.shields.io/badge/ruby-2.7.0p0-brightgreen)
|
14
|
+
|
15
|
+
fogefoge
|
16
|
+
# +caption: example qiita template command
|
17
|
+
# +name: fig:fig1
|
18
|
+
#+ATTR_LATEX: :width 8cm
|
19
|
+
[[file:~/Github/qiita_org/figs/fig1.png][https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png]]
|
20
|
+
|
21
|
+
|
22
|
+
#+caption: example qiita template command
|
23
|
+
#+name: fig:fig1
|
24
|
+
[[file:../figs/fig2.png]]
|
25
|
+
|
26
|
+
https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png
|
data/{test.md → tests/test2.md}
RENAMED
@@ -2,7 +2,5 @@
|
|
2
2
|
|
3
3
|
fogefoge
|
4
4
|
|
5
|
-
[![img](figs/fig1.png)](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/
|
6
|
-
|
7
|
-
![img](figs/fig0.png)
|
5
|
+
[![img](../figs/fig1.png)](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/ebf505d2-6960-6bb9-20f0-e16dab142f4a.png)
|
8
6
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#+qiita_private:
|
1
|
+
#+qiita_private: ca3a6b6e1f5e8c0ba743
|
2
2
|
#+OPTIONS: ^:{}
|
3
3
|
#+STARTUP: indent nolineimages
|
4
4
|
#+TITLE: test
|
@@ -16,7 +16,6 @@ fogefoge
|
|
16
16
|
# +caption: example qiita template command
|
17
17
|
# +name: fig:fig1
|
18
18
|
#+ATTR_LATEX: :width 8cm
|
19
|
-
[[https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/
|
19
|
+
[[https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/ebf505d2-6960-6bb9-20f0-e16dab142f4a.png][file:../figs/fig1.png]]
|
20
20
|
|
21
|
-
file:figs/fig0.png
|
22
21
|
|
data/tests/test3.org
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#+qiita_teams: bd41ced53b4b18701453
|
2
|
+
#+OPTIONS: ^:{}
|
3
|
+
#+STARTUP: indent nolineimages
|
4
|
+
#+TITLE: test
|
5
|
+
#+AUTHOR: Kenta Yamamoto
|
6
|
+
#+EMAIL: (concat "doi35077@kwansei.ac.jp")
|
7
|
+
#+LANGUAGE: jp
|
8
|
+
# +OPTIONS: H:4 toc:t num:2
|
9
|
+
#+OPTIONS: toc:nil
|
10
|
+
#+TAG: test
|
11
|
+
# +SETUPFILE: ~/.emacs.d/org-mode/theme-readtheorg.setup
|
12
|
+
|
13
|
+
![Mac OS X-10.13.3](https://img.shields.io/badge/MacOSX-10.13.3-brightgreen) ![ruby-2.7.0p0](https://img.shields.io/badge/ruby-2.7.0p0-brightgreen)
|
14
|
+
|
15
|
+
fogefoge
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qiita_org
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenta Yamamoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -955,18 +955,19 @@ files:
|
|
955
955
|
- gems/ruby/2.7.0/specifications/rspec-mocks-3.9.1.gemspec
|
956
956
|
- gems/ruby/2.7.0/specifications/rspec-support-3.9.3.gemspec
|
957
957
|
- gems/ruby/2.7.0/specifications/thor-1.0.1.gemspec
|
958
|
-
- hoge.rb
|
959
958
|
- lib/qiita_org.rb
|
960
959
|
- lib/qiita_org/.qiita.conf
|
961
960
|
- lib/qiita_org/check_pc_os.rb
|
962
961
|
- lib/qiita_org/config.json
|
963
962
|
- lib/qiita_org/config.rb
|
963
|
+
- lib/qiita_org/decide_option.rb
|
964
964
|
- lib/qiita_org/get.rb
|
965
965
|
- lib/qiita_org/get_file_path.rb
|
966
966
|
- lib/qiita_org/get_file_url.rb
|
967
967
|
- lib/qiita_org/get_template.rb
|
968
968
|
- lib/qiita_org/hoge.txt
|
969
969
|
- lib/qiita_org/list.rb
|
970
|
+
- lib/qiita_org/md_converter_for_image.rb
|
970
971
|
- lib/qiita_org/ox-qmd/ox-qmd.el
|
971
972
|
- lib/qiita_org/post.rb
|
972
973
|
- lib/qiita_org/search_conf_path.rb
|
@@ -974,8 +975,12 @@ files:
|
|
974
975
|
- lib/qiita_org/template.org
|
975
976
|
- lib/qiita_org/version.rb
|
976
977
|
- qiita_org.gemspec
|
977
|
-
-
|
978
|
-
- test.
|
978
|
+
- tests/hoge.rb
|
979
|
+
- tests/test.html
|
980
|
+
- tests/test.org
|
981
|
+
- tests/test2.md
|
982
|
+
- tests/test2.org
|
983
|
+
- tests/test3.org
|
979
984
|
homepage: https://github.com/yamatoken/qiita_org
|
980
985
|
licenses:
|
981
986
|
- MIT
|