qiita_org 0.1.16 → 0.1.17
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 +15 -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 +2 -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.md +10 -0
- data/tests/test.org +26 -0
- data/{test.md → tests/test2.md} +1 -3
- data/{test.org → tests/test2.org} +2 -3
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a463880ab35d7cad18535215cd98fa1dfc34e25828d4dfe4a253278f7d0d3c30
|
4
|
+
data.tar.gz: ccb99abcbdf89214c3e0fd600da6c1e3541b64f3576f481469a50928d62a995d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb48fcced4575c6925f603a26bf4ed958d4719a3aaea774ee48d10532e71003a8f13ee737f7fb15ebbe2eaf5cc14036a6fbff94515d022f71820d213d67fa4e1
|
7
|
+
data.tar.gz: 4d52108691f2c691e70fa31fa549a35df62106538d19845b48f732cbbde512069f5dc611b62b1c71a9b95ce697d935a76f07ba1d4028ff0fd009eb25baee1504
|
data/Gemfile.lock
CHANGED
data/lib/qiita_org.rb
CHANGED
@@ -47,21 +47,31 @@ module QiitaOrg
|
|
47
47
|
else
|
48
48
|
qiita.run
|
49
49
|
end
|
50
|
+
end
|
51
|
+
|
52
|
+
desc "upload [FILE] [teams/public/private]", "upload about image to qiita"
|
53
|
+
|
54
|
+
def upload(*argv)
|
55
|
+
checkos = CheckPcOs.new
|
56
|
+
os = checkos.return_os()
|
57
|
+
|
58
|
+
p file = argv[0] || "README.org"
|
59
|
+
p mode = argv[1] || "private"
|
50
60
|
|
51
|
-
=begin
|
52
61
|
getpath = GetFilePath.new(file)
|
53
62
|
paths = getpath.get_file_path()
|
54
63
|
unless paths.empty?
|
55
|
-
showfile = ShowFile.new(paths, file, mode)
|
64
|
+
showfile = ShowFile.new(paths, file, mode, os)
|
56
65
|
showfile.open_file_dir()
|
57
|
-
|
66
|
+
showfile.open_qiita()
|
67
|
+
|
68
|
+
puts "Input file URL's on #{file}? (y/n)".green
|
58
69
|
ans = STDIN.getch
|
59
70
|
|
60
71
|
if ans == "y"
|
61
|
-
showfile.
|
72
|
+
showfile.input_url_to_org()
|
62
73
|
end
|
63
74
|
end
|
64
|
-
=end
|
65
75
|
end
|
66
76
|
|
67
77
|
desc "config [global/local] [option] [input]", "set config"
|
@@ -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()
|
@@ -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.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
\![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>)
|
2
|
+
|
3
|
+
fogefoge
|
4
|
+
|
5
|
+
[![img](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png)](file:///Users/kentayamamoto/Github/qiita_org/figs/fig1.png)
|
6
|
+
|
7
|
+
![img](../figs/fig2.png "example qiita template command")
|
8
|
+
|
9
|
+
![img](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png)
|
10
|
+
|
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
|
|
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.17
|
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-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -955,7 +955,6 @@ 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
|
@@ -967,6 +966,7 @@ files:
|
|
967
966
|
- lib/qiita_org/get_template.rb
|
968
967
|
- lib/qiita_org/hoge.txt
|
969
968
|
- lib/qiita_org/list.rb
|
969
|
+
- lib/qiita_org/md_converter_for_image.rb
|
970
970
|
- lib/qiita_org/ox-qmd/ox-qmd.el
|
971
971
|
- lib/qiita_org/post.rb
|
972
972
|
- lib/qiita_org/search_conf_path.rb
|
@@ -974,8 +974,12 @@ files:
|
|
974
974
|
- lib/qiita_org/template.org
|
975
975
|
- lib/qiita_org/version.rb
|
976
976
|
- qiita_org.gemspec
|
977
|
-
-
|
978
|
-
- test.
|
977
|
+
- tests/hoge.rb
|
978
|
+
- tests/test.html
|
979
|
+
- tests/test.md
|
980
|
+
- tests/test.org
|
981
|
+
- tests/test2.md
|
982
|
+
- tests/test2.org
|
979
983
|
homepage: https://github.com/yamatoken/qiita_org
|
980
984
|
licenses:
|
981
985
|
- MIT
|