mk_semi_lattice 0.4.7 → 0.5.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/lib/abbrev_checker/abbrev_yamls/initialism/dir_tree.yaml +2 -1
- data/lib/hc.rb +6 -0
- data/lib/mk_light_table/math_ex_ala_26s.005.png +0 -0
- data/lib/mk_light_table/math_ex_ala_26s.006.png +0 -0
- data/lib/mk_light_table/math_ex_ala_26s.007.png +0 -0
- data/lib/mk_light_table/mk_light_table.html +268 -0
- data/lib/mk_light_table/mk_light_table.org +31 -0
- data/lib/mk_light_table/mk_light_table.rb +240 -0
- data/lib/mk_light_table/mk_light_table.yaml +6 -0
- data/lib/mk_light_table/mk_light_table_link.key +0 -0
- data/lib/mk_light_table/readme.org +36 -0
- data/lib/mk_light_table/style.css +236 -0
- data/lib/mk_light_table/template.org +30 -0
- data/lib/mk_link_canvas/sample.html +53 -0
- data/lib/mk_semi_lattice/manage_yaml/mk_semi_lattice_yaml.rb +24 -0
- data/lib/mk_semi_lattice/sl_components.rb +20 -17
- data/lib/mk_semi_lattice/version.rb +1 -1
- metadata +15 -4
- data/lib/.semi_lattice/icons/folder.png +0 -0
- /data/lib/{.semi_lattice/icons/document.png → mk_semi_lattice/.semi_lattice/icons/file.png} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 033ace70dffbcfd3491030fab05752a39887c4f12d8b7e7990601d166edd9b04
|
|
4
|
+
data.tar.gz: 867903e8bbba30252779d938c4d3831be54a4a9fa387c4bc208d15096dffcd78
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2de03e16de7fe635ffb0111e85fb38d216f000e98af453a1f0d964873e5b1a745773c5fadbe11110bfc9909b030afe97201bf1b8e9d799e4c005eff009eff2d3
|
|
7
|
+
data.tar.gz: b0a765451fe1fb430dc83d5c758500a3b975a6781d279549fd06f44519e5c71354e65221ba390ac809306ff881783ac541a2bc9ba062862ac94d619882cd5415
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
SQ3R=survey quetioning reading reciting reviewing:
|
|
2
3
|
GPT=generative pre-trained transformer:
|
|
3
4
|
LLM=large language model:
|
|
4
5
|
CLI=command line interface:
|
|
@@ -12,6 +13,6 @@ IP=internet protocol:
|
|
|
12
13
|
OS=operating system:
|
|
13
14
|
pdf=portable document format:
|
|
14
15
|
tar=tape archive:
|
|
15
|
-
wsl=windows subsystem
|
|
16
|
+
wsl=windows subsystem for linux:
|
|
16
17
|
|
|
17
18
|
|
data/lib/hc.rb
CHANGED
|
@@ -3,6 +3,7 @@ require_relative "mk_semi_lattice/version"
|
|
|
3
3
|
require_relative "mk_stack/mk_stack"
|
|
4
4
|
require_relative "voca_buil/multi_check"
|
|
5
5
|
require_relative "split_pdf/split_pdf"
|
|
6
|
+
require_relative "mk_light_table/mk_light_table"
|
|
6
7
|
require_relative "abbrev_checker/abbrev_check"
|
|
7
8
|
require_relative "plot/plot" # 追加
|
|
8
9
|
|
|
@@ -34,6 +35,11 @@ class CLI < Thor
|
|
|
34
35
|
SplitPDF.new(argv).run
|
|
35
36
|
end
|
|
36
37
|
|
|
38
|
+
desc 'mk_light_table', 'mk light table for view figs'
|
|
39
|
+
def mk_light_table(*argv)
|
|
40
|
+
MkLightTable.new(ARGV).run
|
|
41
|
+
end
|
|
42
|
+
|
|
37
43
|
desc 'check', 'check word for vocabulary builder'
|
|
38
44
|
def check(*argv)
|
|
39
45
|
options = VocaBuil::OptionParserWrapper.parse
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
<!-- 2026-04-14 Tue 18:23 -->
|
|
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>template for hyper card stack</title>
|
|
10
|
+
<meta name="author" content="Shigeto R. Nishitani" />
|
|
11
|
+
<meta name="generator" content="Org Mode" />
|
|
12
|
+
<style type="text/css">
|
|
13
|
+
#content { max-width: 60em; margin: auto; }
|
|
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 #e6e6e6;
|
|
35
|
+
border-radius: 3px;
|
|
36
|
+
background-color: #f2f2f2;
|
|
37
|
+
padding: 8pt;
|
|
38
|
+
font-family: monospace;
|
|
39
|
+
overflow: auto;
|
|
40
|
+
margin: 1.2em;
|
|
41
|
+
}
|
|
42
|
+
pre.src {
|
|
43
|
+
position: relative;
|
|
44
|
+
overflow: auto;
|
|
45
|
+
}
|
|
46
|
+
pre.src:before {
|
|
47
|
+
display: none;
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: -8px;
|
|
50
|
+
right: 12px;
|
|
51
|
+
padding: 3px;
|
|
52
|
+
color: #555;
|
|
53
|
+
background-color: #f2f2f299;
|
|
54
|
+
}
|
|
55
|
+
pre.src:hover:before { display: inline; margin-top: 14px;}
|
|
56
|
+
/* Languages per Org manual */
|
|
57
|
+
pre.src-asymptote:before { content: 'Asymptote'; }
|
|
58
|
+
pre.src-awk:before { content: 'Awk'; }
|
|
59
|
+
pre.src-authinfo::before { content: 'Authinfo'; }
|
|
60
|
+
pre.src-C:before { content: 'C'; }
|
|
61
|
+
/* pre.src-C++ doesn't work in CSS */
|
|
62
|
+
pre.src-clojure:before { content: 'Clojure'; }
|
|
63
|
+
pre.src-css:before { content: 'CSS'; }
|
|
64
|
+
pre.src-D:before { content: 'D'; }
|
|
65
|
+
pre.src-ditaa:before { content: 'ditaa'; }
|
|
66
|
+
pre.src-dot:before { content: 'Graphviz'; }
|
|
67
|
+
pre.src-calc:before { content: 'Emacs Calc'; }
|
|
68
|
+
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
|
|
69
|
+
pre.src-fortran:before { content: 'Fortran'; }
|
|
70
|
+
pre.src-gnuplot:before { content: 'gnuplot'; }
|
|
71
|
+
pre.src-haskell:before { content: 'Haskell'; }
|
|
72
|
+
pre.src-hledger:before { content: 'hledger'; }
|
|
73
|
+
pre.src-java:before { content: 'Java'; }
|
|
74
|
+
pre.src-js:before { content: 'Javascript'; }
|
|
75
|
+
pre.src-latex:before { content: 'LaTeX'; }
|
|
76
|
+
pre.src-ledger:before { content: 'Ledger'; }
|
|
77
|
+
pre.src-lisp:before { content: 'Lisp'; }
|
|
78
|
+
pre.src-lilypond:before { content: 'Lilypond'; }
|
|
79
|
+
pre.src-lua:before { content: 'Lua'; }
|
|
80
|
+
pre.src-matlab:before { content: 'MATLAB'; }
|
|
81
|
+
pre.src-mscgen:before { content: 'Mscgen'; }
|
|
82
|
+
pre.src-ocaml:before { content: 'Objective Caml'; }
|
|
83
|
+
pre.src-octave:before { content: 'Octave'; }
|
|
84
|
+
pre.src-org:before { content: 'Org mode'; }
|
|
85
|
+
pre.src-oz:before { content: 'OZ'; }
|
|
86
|
+
pre.src-plantuml:before { content: 'Plantuml'; }
|
|
87
|
+
pre.src-processing:before { content: 'Processing.js'; }
|
|
88
|
+
pre.src-python:before { content: 'Python'; }
|
|
89
|
+
pre.src-R:before { content: 'R'; }
|
|
90
|
+
pre.src-ruby:before { content: 'Ruby'; }
|
|
91
|
+
pre.src-sass:before { content: 'Sass'; }
|
|
92
|
+
pre.src-scheme:before { content: 'Scheme'; }
|
|
93
|
+
pre.src-screen:before { content: 'Gnu Screen'; }
|
|
94
|
+
pre.src-sed:before { content: 'Sed'; }
|
|
95
|
+
pre.src-sh:before { content: 'shell'; }
|
|
96
|
+
pre.src-sql:before { content: 'SQL'; }
|
|
97
|
+
pre.src-sqlite:before { content: 'SQLite'; }
|
|
98
|
+
/* additional languages in org.el's org-babel-load-languages alist */
|
|
99
|
+
pre.src-forth:before { content: 'Forth'; }
|
|
100
|
+
pre.src-io:before { content: 'IO'; }
|
|
101
|
+
pre.src-J:before { content: 'J'; }
|
|
102
|
+
pre.src-makefile:before { content: 'Makefile'; }
|
|
103
|
+
pre.src-maxima:before { content: 'Maxima'; }
|
|
104
|
+
pre.src-perl:before { content: 'Perl'; }
|
|
105
|
+
pre.src-picolisp:before { content: 'Pico Lisp'; }
|
|
106
|
+
pre.src-scala:before { content: 'Scala'; }
|
|
107
|
+
pre.src-shell:before { content: 'Shell Script'; }
|
|
108
|
+
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
|
|
109
|
+
/* additional language identifiers per "defun org-babel-execute"
|
|
110
|
+
in ob-*.el */
|
|
111
|
+
pre.src-cpp:before { content: 'C++'; }
|
|
112
|
+
pre.src-abc:before { content: 'ABC'; }
|
|
113
|
+
pre.src-coq:before { content: 'Coq'; }
|
|
114
|
+
pre.src-groovy:before { content: 'Groovy'; }
|
|
115
|
+
/* additional language identifiers from org-babel-shell-names in
|
|
116
|
+
ob-shell.el: ob-shell is the only babel language using a lambda to put
|
|
117
|
+
the execution function name together. */
|
|
118
|
+
pre.src-bash:before { content: 'bash'; }
|
|
119
|
+
pre.src-csh:before { content: 'csh'; }
|
|
120
|
+
pre.src-ash:before { content: 'ash'; }
|
|
121
|
+
pre.src-dash:before { content: 'dash'; }
|
|
122
|
+
pre.src-ksh:before { content: 'ksh'; }
|
|
123
|
+
pre.src-mksh:before { content: 'mksh'; }
|
|
124
|
+
pre.src-posh:before { content: 'posh'; }
|
|
125
|
+
/* Additional Emacs modes also supported by the LaTeX listings package */
|
|
126
|
+
pre.src-ada:before { content: 'Ada'; }
|
|
127
|
+
pre.src-asm:before { content: 'Assembler'; }
|
|
128
|
+
pre.src-caml:before { content: 'Caml'; }
|
|
129
|
+
pre.src-delphi:before { content: 'Delphi'; }
|
|
130
|
+
pre.src-html:before { content: 'HTML'; }
|
|
131
|
+
pre.src-idl:before { content: 'IDL'; }
|
|
132
|
+
pre.src-mercury:before { content: 'Mercury'; }
|
|
133
|
+
pre.src-metapost:before { content: 'MetaPost'; }
|
|
134
|
+
pre.src-modula-2:before { content: 'Modula-2'; }
|
|
135
|
+
pre.src-pascal:before { content: 'Pascal'; }
|
|
136
|
+
pre.src-ps:before { content: 'PostScript'; }
|
|
137
|
+
pre.src-prolog:before { content: 'Prolog'; }
|
|
138
|
+
pre.src-simula:before { content: 'Simula'; }
|
|
139
|
+
pre.src-tcl:before { content: 'tcl'; }
|
|
140
|
+
pre.src-tex:before { content: 'TeX'; }
|
|
141
|
+
pre.src-plain-tex:before { content: 'Plain TeX'; }
|
|
142
|
+
pre.src-verilog:before { content: 'Verilog'; }
|
|
143
|
+
pre.src-vhdl:before { content: 'VHDL'; }
|
|
144
|
+
pre.src-xml:before { content: 'XML'; }
|
|
145
|
+
pre.src-nxml:before { content: 'XML'; }
|
|
146
|
+
/* add a generic configuration mode; LaTeX export needs an additional
|
|
147
|
+
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
|
|
148
|
+
pre.src-conf:before { content: 'Configuration File'; }
|
|
149
|
+
|
|
150
|
+
table { border-collapse:collapse; }
|
|
151
|
+
caption.t-above { caption-side: top; }
|
|
152
|
+
caption.t-bottom { caption-side: bottom; }
|
|
153
|
+
td, th { vertical-align:top; }
|
|
154
|
+
th.org-right { text-align: center; }
|
|
155
|
+
th.org-left { text-align: center; }
|
|
156
|
+
th.org-center { text-align: center; }
|
|
157
|
+
td.org-right { text-align: right; }
|
|
158
|
+
td.org-left { text-align: left; }
|
|
159
|
+
td.org-center { text-align: center; }
|
|
160
|
+
dt { font-weight: bold; }
|
|
161
|
+
.footpara { display: inline; }
|
|
162
|
+
.footdef { margin-bottom: 1em; }
|
|
163
|
+
.figure { padding: 1em; }
|
|
164
|
+
.figure p { text-align: center; }
|
|
165
|
+
.equation-container {
|
|
166
|
+
display: table;
|
|
167
|
+
text-align: center;
|
|
168
|
+
width: 100%;
|
|
169
|
+
}
|
|
170
|
+
.equation {
|
|
171
|
+
vertical-align: middle;
|
|
172
|
+
}
|
|
173
|
+
.equation-label {
|
|
174
|
+
display: table-cell;
|
|
175
|
+
text-align: right;
|
|
176
|
+
vertical-align: middle;
|
|
177
|
+
}
|
|
178
|
+
.inlinetask {
|
|
179
|
+
padding: 10px;
|
|
180
|
+
border: 2px solid gray;
|
|
181
|
+
margin: 10px;
|
|
182
|
+
background: #ffffcc;
|
|
183
|
+
}
|
|
184
|
+
#org-div-home-and-up
|
|
185
|
+
{ text-align: right; font-size: 70%; white-space: nowrap; }
|
|
186
|
+
textarea { overflow-x: auto; }
|
|
187
|
+
.linenr { font-size: smaller }
|
|
188
|
+
.code-highlighted { background-color: #ffff00; }
|
|
189
|
+
.org-info-js_info-navigation { border-style: none; }
|
|
190
|
+
#org-info-js_console-label
|
|
191
|
+
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
|
|
192
|
+
.org-info-js_search-highlight
|
|
193
|
+
{ background-color: #ffff00; color: #000000; font-weight: bold; }
|
|
194
|
+
.org-svg { }
|
|
195
|
+
</style>
|
|
196
|
+
<link rel="stylesheet" type="text/css" href="style.css" />
|
|
197
|
+
</head>
|
|
198
|
+
<body>
|
|
199
|
+
<div id="content" class="content">
|
|
200
|
+
<h1 class="title">template for hyper card stack</h1>
|
|
201
|
+
<div id="table-of-contents" role="doc-toc">
|
|
202
|
+
<h2>Table of Contents</h2>
|
|
203
|
+
<div id="text-table-of-contents" role="doc-toc">
|
|
204
|
+
<ul>
|
|
205
|
+
<li><a href="#org6d770ba">1. head1</a>
|
|
206
|
+
<ul>
|
|
207
|
+
<li><a href="#org962c4c7">1.1. head2</a></li>
|
|
208
|
+
</ul>
|
|
209
|
+
</li>
|
|
210
|
+
<li><a href="#org938fd7f">2. .</a></li>
|
|
211
|
+
</ul>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
<p>
|
|
215
|
+
<a href="#">prev_button</a>
|
|
216
|
+
<a href="#">up_button</a>
|
|
217
|
+
<a href="#">next_button</a>
|
|
218
|
+
</p>
|
|
219
|
+
<div id="outline-container-org6d770ba" class="outline-2">
|
|
220
|
+
<h2 id="org6d770ba"><span class="section-number-2">1.</span> head1</h2>
|
|
221
|
+
<div class="outline-text-2" id="text-1">
|
|
222
|
+
</div>
|
|
223
|
+
<div id="outline-container-org962c4c7" class="outline-3">
|
|
224
|
+
<h3 id="org962c4c7"><span class="section-number-3">1.1.</span> head2</h3>
|
|
225
|
+
<div class="outline-text-3" id="text-1-1">
|
|
226
|
+
<ul class="org-ul">
|
|
227
|
+
<li>list</li>
|
|
228
|
+
</ul>
|
|
229
|
+
|
|
230
|
+
<div class="org-src-container">
|
|
231
|
+
<pre class="src src-ruby">name = <span style="color: #005f5f;">ARGV</span>[0] || <span style="color: #3548cf;">'Rudy'</span>
|
|
232
|
+
<span style="color: #8f0075;">puts</span> <span style="color: #3548cf;">"Hello </span><span style="color: #005e8b;">#{name}</span><span style="color: #3548cf;">."</span>
|
|
233
|
+
</pre>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
<div id="outline-container-org938fd7f" class="outline-2">
|
|
239
|
+
<h2 id="org938fd7f"><span class="section-number-2">2.</span> .</h2>
|
|
240
|
+
<div class="outline-text-2" id="text-2">
|
|
241
|
+
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
<colgroup>
|
|
245
|
+
<col class="org-left" />
|
|
246
|
+
|
|
247
|
+
<col class="org-left" />
|
|
248
|
+
|
|
249
|
+
<col class="org-left" />
|
|
250
|
+
</colgroup>
|
|
251
|
+
<tbody>
|
|
252
|
+
<tr>
|
|
253
|
+
<td class="org-left"><img src="./math_ex_ala_26s.005.png" alt="math_ex_ala_26s.005.png" /></td>
|
|
254
|
+
<td class="org-left"><img src="./math_ex_ala_26s.006.png" alt="math_ex_ala_26s.006.png" /></td>
|
|
255
|
+
<td class="org-left"><img src="./math_ex_ala_26s.007.png" alt="math_ex_ala_26s.007.png" /></td>
|
|
256
|
+
</tr>
|
|
257
|
+
</tbody>
|
|
258
|
+
</table>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
<div id="postamble" class="status">
|
|
263
|
+
<p class="author">Author: Shigeto R. Nishitani</p>
|
|
264
|
+
<p class="date">Created: 2026-04-14 Tue 18:23</p>
|
|
265
|
+
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
|
|
266
|
+
</div>
|
|
267
|
+
</body>
|
|
268
|
+
</html>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#+OPTIONS: ^:{}
|
|
2
|
+
#+STARTUP: indent nolineimages overview num
|
|
3
|
+
#+TITLE: template for hyper card stack
|
|
4
|
+
#+AUTHOR: Shigeto R. Nishitani
|
|
5
|
+
#+EMAIL: (concat "shigeto_nishitani@mac.com")
|
|
6
|
+
#+LANGUAGE: jp
|
|
7
|
+
#+OPTIONS: H:4 toc:t num:2
|
|
8
|
+
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style.css" />
|
|
9
|
+
#+MACRO: dummy_link @@html:<a href="#">$1</a>@@
|
|
10
|
+
|
|
11
|
+
# for style.css, never move from here
|
|
12
|
+
{{{dummy_link(prev_button)}}}
|
|
13
|
+
{{{dummy_link(up_button)}}}
|
|
14
|
+
{{{dummy_link(next_button)}}}
|
|
15
|
+
# for a real link rewrite usual [[\url][]]
|
|
16
|
+
|
|
17
|
+
* head1
|
|
18
|
+
** head2
|
|
19
|
+
- list
|
|
20
|
+
|
|
21
|
+
#+begin_src ruby
|
|
22
|
+
name = ARGV[0] || 'Rudy'
|
|
23
|
+
puts "Hello #{name}."
|
|
24
|
+
#+end_src
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
* .
|
|
31
|
+
| [[file:./math_ex_ala_26s.005.png]] | [[file:./math_ex_ala_26s.006.png]] | [[file:./math_ex_ala_26s.007.png]]
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
require "colorize"
|
|
3
|
+
require 'yaml'
|
|
4
|
+
require 'fileutils'
|
|
5
|
+
require 'optparse'
|
|
6
|
+
|
|
7
|
+
class MkLightTable
|
|
8
|
+
def initialize(argv)
|
|
9
|
+
@options = {}
|
|
10
|
+
@opts = OptionParser.new do |opts|
|
|
11
|
+
opts.banner = "Usage: #{File.basename($0)} [options]"
|
|
12
|
+
opts.on('-d [DIR]', '--dir [DIR]', 'Target directory for mk_yaml (default: .)') do |dir|
|
|
13
|
+
@options[:dir] = dir || '.'
|
|
14
|
+
@options[:action] = :dir
|
|
15
|
+
end
|
|
16
|
+
opts.on('-y', '--yaml', 'Output sample YAML') do
|
|
17
|
+
@options[:action] = :sample
|
|
18
|
+
end
|
|
19
|
+
opts.on('-o[FILE]', '--generate-org=[FILE]', 'Generate Org file') do |file|
|
|
20
|
+
@options[:yaml_file] = file
|
|
21
|
+
@options[:action] = :generate_org
|
|
22
|
+
end
|
|
23
|
+
opts.on('-g FILE', '--generate-html=FILE', 'Generate HTML') do |file|
|
|
24
|
+
@options[:yaml_file] = file
|
|
25
|
+
@options[:action] = :generate_html
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
@opts.parse!(argv)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def run
|
|
32
|
+
case @options[:action]
|
|
33
|
+
when :sample
|
|
34
|
+
puts_sample_yaml
|
|
35
|
+
when :generate_org
|
|
36
|
+
generate_org(@options[:yaml_file])
|
|
37
|
+
when :generate_html
|
|
38
|
+
generate_html(@options[:yaml_file])
|
|
39
|
+
when :dir
|
|
40
|
+
actual_dir = File.expand_path(@options[:dir])
|
|
41
|
+
dir_name = File.basename(actual_dir)
|
|
42
|
+
yaml_file = "#{dir_name}.yaml"
|
|
43
|
+
|
|
44
|
+
if File.exist?(yaml_file)
|
|
45
|
+
puts "Warning: Target file ('#{yaml_file}') already exists."
|
|
46
|
+
puts "Please delete it first before running this command."
|
|
47
|
+
return
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
mk_yaml(@options[:dir], yaml_file)
|
|
51
|
+
puts "Note: To generate an HTML file from this YAML, please run the command with the -g option:"
|
|
52
|
+
puts " hc mk_light_table -g #{yaml_file}"
|
|
53
|
+
else
|
|
54
|
+
puts @opts
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def generate_html(yaml_file = nil)
|
|
59
|
+
output_dir = '.' # or some other configurable directory
|
|
60
|
+
target_yaml = yaml_file || @options[:yaml_file] || "#{File.basename(Dir.pwd)}.yaml"
|
|
61
|
+
base_name = File.basename(target_yaml, '.yaml')
|
|
62
|
+
html_path = File.join(output_dir, "#{base_name}.html")
|
|
63
|
+
|
|
64
|
+
if File.exist?(html_path)
|
|
65
|
+
puts "Error: Target file ('#{html_path}') already exists."
|
|
66
|
+
puts "Please delete it first before running this command."
|
|
67
|
+
return
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
css_path = File.join(output_dir, 'style.css')
|
|
71
|
+
source_css_path = File.join(__dir__, 'style.css')
|
|
72
|
+
|
|
73
|
+
actual_yaml = File.exist?(target_yaml) ? target_yaml : 'light_table.yaml'
|
|
74
|
+
toc = YAML.load_file(actual_yaml)
|
|
75
|
+
html = <<-HTML
|
|
76
|
+
<!DOCTYPE html>
|
|
77
|
+
<html>
|
|
78
|
+
<head>ls
|
|
79
|
+
|
|
80
|
+
<meta charset="utf-8">
|
|
81
|
+
<title>Light Table</title>
|
|
82
|
+
<link rel="stylesheet" href="style.css">
|
|
83
|
+
</head>
|
|
84
|
+
<body>
|
|
85
|
+
<div id="table-of-contents">
|
|
86
|
+
<h2>Table of Contents</h2>
|
|
87
|
+
<ul>
|
|
88
|
+
#{toc.map.with_index { |section, i| "<li><a href=\"#section-#{i}\">#{section[:head]}</a></li>" }.join("\n ")}
|
|
89
|
+
</ul>
|
|
90
|
+
</div>
|
|
91
|
+
<div id="content">
|
|
92
|
+
<h1 class="title">Light Table</h1>
|
|
93
|
+
#{toc.map.with_index do |section, i|
|
|
94
|
+
images_table = "<table class=\"light-table\" style=\"width: 100%; border-collapse: collapse;\">\n"
|
|
95
|
+
section[:files].each_slice(3) do |row|
|
|
96
|
+
images_table << " <tr>\n"
|
|
97
|
+
row.each do |file|
|
|
98
|
+
images_table << " <td style=\"padding: 5px; vertical-align: top; width: 33.33%;\">\n"
|
|
99
|
+
images_table << " <a href=\"#{file}\" target=\"_blank\">\n"
|
|
100
|
+
images_table << " <img src=\"#{file}\" alt=\"#{File.basename(file)}\" loading=\"lazy\" style=\"width: 100%; height: auto; display: block;\">\n"
|
|
101
|
+
images_table << " </a>\n"
|
|
102
|
+
images_table << " </td>\n"
|
|
103
|
+
end
|
|
104
|
+
(3 - row.size).times do
|
|
105
|
+
images_table << " <td style=\"padding: 5px; width: 33.33%;\"></td>\n"
|
|
106
|
+
end
|
|
107
|
+
images_table << " </tr>\n"
|
|
108
|
+
end
|
|
109
|
+
images_table << " </table>"
|
|
110
|
+
|
|
111
|
+
<<-SECTION
|
|
112
|
+
<h2 id="section-#{i}">#{section[:head]}</h2>
|
|
113
|
+
<div class="outline-text-2">
|
|
114
|
+
#{images_table}
|
|
115
|
+
</div>
|
|
116
|
+
SECTION
|
|
117
|
+
end.join("\n")}
|
|
118
|
+
</div>
|
|
119
|
+
</body>
|
|
120
|
+
</html>
|
|
121
|
+
HTML
|
|
122
|
+
File.write(html_path, html)
|
|
123
|
+
puts "HTML written to #{html_path}"
|
|
124
|
+
|
|
125
|
+
if !File.exist?(css_path) && File.exist?(source_css_path)
|
|
126
|
+
FileUtils.cp(source_css_path, css_path)
|
|
127
|
+
puts "Copied style.css to #{output_dir}"
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def generate_org(yaml_file = nil)
|
|
132
|
+
# 引数がない場合はカレントディレクトリ名を使用
|
|
133
|
+
target_yaml = yaml_file || @options[:yaml_file] || "#{File.basename(Dir.pwd)}.yaml"
|
|
134
|
+
base_name = File.basename(target_yaml, '.yaml')
|
|
135
|
+
org_path = "#{base_name}.org"
|
|
136
|
+
|
|
137
|
+
if File.exist?(org_path)
|
|
138
|
+
org_path = "readme.org"
|
|
139
|
+
if File.exist?(org_path)
|
|
140
|
+
puts "Error: Target files ('#{base_name}.org' and 'readme.org') already exist."
|
|
141
|
+
puts "Please delete it first before running this command."
|
|
142
|
+
return
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
local_template = 'template.org'
|
|
147
|
+
source_template = File.join(__dir__, 'template.org')
|
|
148
|
+
|
|
149
|
+
actual_yaml = File.exist?(target_yaml) ? target_yaml : 'light_table.yaml'
|
|
150
|
+
|
|
151
|
+
# YAMLファイルが存在しない場合はテンプレートのコピーのみ行う
|
|
152
|
+
unless File.exist?(actual_yaml)
|
|
153
|
+
if File.exist?(local_template)
|
|
154
|
+
FileUtils.cp(local_template, org_path)
|
|
155
|
+
elsif File.exist?(source_template)
|
|
156
|
+
FileUtils.cp(source_template, org_path)
|
|
157
|
+
else
|
|
158
|
+
File.write(org_path, "#+TITLE: #{base_name}\n\n")
|
|
159
|
+
end
|
|
160
|
+
puts "Copied template to #{org_path} (YAML not found)"
|
|
161
|
+
|
|
162
|
+
css_path = 'style.css'
|
|
163
|
+
source_css_path = File.join(__dir__, 'style.css')
|
|
164
|
+
if !File.exist?(css_path) && File.exist?(source_css_path)
|
|
165
|
+
FileUtils.cp(source_css_path, css_path)
|
|
166
|
+
puts "Copied style.css to ."
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
return
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
toc = YAML.load_file(actual_yaml)
|
|
173
|
+
org_content = []
|
|
174
|
+
|
|
175
|
+
if File.exist?(local_template)
|
|
176
|
+
org_content << File.read(local_template)
|
|
177
|
+
org_content << ""
|
|
178
|
+
elsif File.exist?(source_template)
|
|
179
|
+
org_content << File.read(source_template)
|
|
180
|
+
org_content << ""
|
|
181
|
+
else
|
|
182
|
+
org_content << "#+TITLE: Light Table"
|
|
183
|
+
org_content << ""
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
toc.each do |section|
|
|
187
|
+
org_content << "* #{section[:head]}"
|
|
188
|
+
section[:files].each do |file|
|
|
189
|
+
org_content << " [[file:#{file}]]"
|
|
190
|
+
end
|
|
191
|
+
org_content << ""
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
File.write(org_path, org_content.join("\n"))
|
|
195
|
+
puts "Org written to #{org_path}"
|
|
196
|
+
|
|
197
|
+
css_path = 'style.css'
|
|
198
|
+
source_css_path = File.join(__dir__, 'style.css')
|
|
199
|
+
if !File.exist?(css_path) && File.exist?(source_css_path)
|
|
200
|
+
FileUtils.cp(source_css_path, css_path)
|
|
201
|
+
puts "Copied style.css to ."
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# ディレクトリからyamlを作成
|
|
206
|
+
def mk_yaml(t_dir = nil, out_file = 'light_table.yaml')
|
|
207
|
+
t_dir ||= @options[:dir]
|
|
208
|
+
t_dir = '.' if t_dir.nil? || t_dir.empty?
|
|
209
|
+
puts t_dir
|
|
210
|
+
toc = [{head: File.basename(t_dir), files: []}]
|
|
211
|
+
|
|
212
|
+
valid_exts = %w[.png .jpg .jpeg .gif .svg .webp .mp4 .mov .webm .avi]
|
|
213
|
+
Dir.glob(File.join(t_dir, '*')).each do |file_path|
|
|
214
|
+
next unless valid_exts.include?(File.extname(file_path).downcase)
|
|
215
|
+
toc[0][:files] << file_path
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
File.write(out_file, YAML.dump(toc))
|
|
219
|
+
puts "YAML written to #{out_file}"
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
def puts_sample_yaml(t_file = 'light_table.yaml')
|
|
223
|
+
if File.exist?(t_file)
|
|
224
|
+
t_file = 'light_table_sample.yaml'
|
|
225
|
+
end
|
|
226
|
+
hc_array = [
|
|
227
|
+
{head: "system layer and installers",
|
|
228
|
+
files: ["sample_pngs/c2_install.008.png"]},
|
|
229
|
+
{head: "specific command steps",
|
|
230
|
+
files: ["sample_pngs/c2_install.010.png"]}
|
|
231
|
+
]
|
|
232
|
+
puts YAML.dump(hc_array)
|
|
233
|
+
File.write(t_file, YAML.dump(hc_array))
|
|
234
|
+
puts "Save sample yaml in '#{t_file}'."
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
if __FILE__ == $0
|
|
239
|
+
MkLightTable.new(ARGV).run
|
|
240
|
+
end
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#+OPTIONS: ^:{}
|
|
2
|
+
#+STARTUP: indent nolineimages overview num
|
|
3
|
+
#+TITLE: template for hyper card stack
|
|
4
|
+
#+AUTHOR: Shigeto R. Nishitani
|
|
5
|
+
#+EMAIL: (concat "shigeto_nishitani@mac.com")
|
|
6
|
+
#+LANGUAGE: jp
|
|
7
|
+
#+OPTIONS: H:4 toc:t num:2
|
|
8
|
+
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style.css" />
|
|
9
|
+
#+MACRO: dummy_link @@html:<a href="#">$1</a>@@
|
|
10
|
+
|
|
11
|
+
# for style.css, never move from here
|
|
12
|
+
{{{dummy_link(prev_button)}}}
|
|
13
|
+
{{{dummy_link(up_button)}}}
|
|
14
|
+
{{{dummy_link(next_button)}}}
|
|
15
|
+
# for a real link rewrite usual [[\url][]]
|
|
16
|
+
|
|
17
|
+
* head1
|
|
18
|
+
** head2
|
|
19
|
+
- list
|
|
20
|
+
|
|
21
|
+
#+begin_src ruby
|
|
22
|
+
name = ARGV[0] || 'Rudy'
|
|
23
|
+
puts "Hello #{name}."
|
|
24
|
+
#+end_src
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
* .
|
|
34
|
+
[[file:./math_ex_ala_26s.005.png]]
|
|
35
|
+
[[file:./math_ex_ala_26s.006.png]]
|
|
36
|
+
[[file:./math_ex_ala_26s.007.png]]
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/* 全体レイアウト */
|
|
2
|
+
body {
|
|
3
|
+
font-family: 'Lato', 'Arial', sans-serif;
|
|
4
|
+
background: #fff;
|
|
5
|
+
color: #333;
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* 本文領域(Org-modeのルートコンテナ) */
|
|
11
|
+
#content {
|
|
12
|
+
/* 左側の目次幅を確保(30vw、最大320px、最少200px) */
|
|
13
|
+
margin-left: clamp(200px, 30vw, 320px);
|
|
14
|
+
padding: 1em 2em;
|
|
15
|
+
max-width: none !important; /* Orgのデフォルト指定を解除 */
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* 左ペイン(Table of Contents) */
|
|
19
|
+
#table-of-contents {
|
|
20
|
+
position: fixed;
|
|
21
|
+
top: 0;
|
|
22
|
+
left: 0;
|
|
23
|
+
background: #2d2d2d;
|
|
24
|
+
color: #fff;
|
|
25
|
+
width: clamp(200px, 30vw, 320px);
|
|
26
|
+
height: 100vh;
|
|
27
|
+
padding: 0;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
border-right: 1px solid #ddd;
|
|
30
|
+
overflow-y: auto;
|
|
31
|
+
z-index: 1000;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#table-of-contents h2 {
|
|
35
|
+
background: #4285f4;
|
|
36
|
+
color: #fff;
|
|
37
|
+
font-size: 1.1em;
|
|
38
|
+
font-weight: bold;
|
|
39
|
+
text-align: center;
|
|
40
|
+
padding: 1em 0;
|
|
41
|
+
margin: 0 0 0.5em 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#table-of-contents ul {
|
|
45
|
+
list-style: none;
|
|
46
|
+
padding: 0;
|
|
47
|
+
margin: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#table-of-contents li {
|
|
51
|
+
margin: 0;
|
|
52
|
+
padding: 0.3em 1.2em;
|
|
53
|
+
font-size: 1.1em;
|
|
54
|
+
border-bottom: 1px solid #222;
|
|
55
|
+
line-height: 1.2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#table-of-contents li:last-child {
|
|
59
|
+
border-bottom: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#table-of-contents a {
|
|
63
|
+
font-size: 0.85rem;
|
|
64
|
+
color: #fff;
|
|
65
|
+
text-decoration: none;
|
|
66
|
+
display: block;
|
|
67
|
+
transition: background 0.2s, color 0.2s;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#table-of-contents a:hover {
|
|
71
|
+
color: #4285f4;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* タイトル */
|
|
75
|
+
h1.title {
|
|
76
|
+
font-size: 1.8em;
|
|
77
|
+
font-weight: bold;
|
|
78
|
+
margin-top: 0.5em;
|
|
79
|
+
margin-bottom: 1em;
|
|
80
|
+
letter-spacing: 1px;
|
|
81
|
+
text-align: left;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
h2 {
|
|
85
|
+
font-size: 1.3em;
|
|
86
|
+
font-weight: bold;
|
|
87
|
+
margin-top: 1.5em;
|
|
88
|
+
margin-bottom: 0.7em;
|
|
89
|
+
letter-spacing: 0.5px;
|
|
90
|
+
border-bottom: 1px solid #eee;
|
|
91
|
+
padding-bottom: 0.3em;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
h3 {
|
|
95
|
+
font-size: 1.1em;
|
|
96
|
+
font-weight: bold;
|
|
97
|
+
margin-top: 1em;
|
|
98
|
+
margin-bottom: 0.7em;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* リスト */
|
|
102
|
+
.outline-text-2 ul, .outline-text-3 ul {
|
|
103
|
+
margin: 1em 0 2em 2em;
|
|
104
|
+
padding: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.outline-text-2 li, .outline-text-3 li {
|
|
108
|
+
font-size: 0.9em;
|
|
109
|
+
line-height: 1.7;
|
|
110
|
+
margin-bottom: 0.5em;
|
|
111
|
+
color: #333;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* テーブル自体の幅を画面いっぱいに広げる */
|
|
115
|
+
.outline-text-2 table, .outline-text-3 table {
|
|
116
|
+
width: 100%;
|
|
117
|
+
border-collapse: collapse;
|
|
118
|
+
margin-bottom: 1.5em;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.outline-text-2 td, .outline-text-3 td {
|
|
122
|
+
padding: 5px; /* セル(画像)間の余白 */
|
|
123
|
+
vertical-align: top;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* 画像ギャラリー風の表示(テーブル内の画像にも適用) */
|
|
127
|
+
#content img, .outline-text-2 img, .outline-text-3 img {
|
|
128
|
+
max-width: 100%;
|
|
129
|
+
height: auto;
|
|
130
|
+
display: block;
|
|
131
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
132
|
+
border-radius: 4px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* ナビゲーションボタン (up, prev, next) */
|
|
136
|
+
#content > p > a {
|
|
137
|
+
display: inline-block;
|
|
138
|
+
padding: 5px 15px;
|
|
139
|
+
margin-right: 0.5em;
|
|
140
|
+
margin-bottom: 1em;
|
|
141
|
+
background-color: #FFFFFF;
|
|
142
|
+
color: #000000;
|
|
143
|
+
text-decoration: none;
|
|
144
|
+
border: 2px solid #000000;
|
|
145
|
+
border-radius: 8px; /* 丸みを帯びた長方形ボタン */
|
|
146
|
+
font-size: 14px;
|
|
147
|
+
font-family: 'Chicago', 'Geneva', sans-serif; /* クラシックMac風フォント */
|
|
148
|
+
box-shadow: 1px 1px 0px #000000;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
#content > p > a:active {
|
|
153
|
+
background-color: #000000;
|
|
154
|
+
color: #FFFFFF;
|
|
155
|
+
box-shadow: 0px 0px 0px #000000;
|
|
156
|
+
transform: translate(1px, 1px);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* 本文内の最初の段落にあるリンクの「順番(1番目、2番目、3番目)」で判別する */
|
|
160
|
+
#content > p:first-of-type > a {
|
|
161
|
+
font-size: 0; /* 元の「prev_button」などのテキストを隠す */
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* 1番目: Prev (◀ prev) */
|
|
165
|
+
#content > p:first-of-type > a:nth-child(1)::before {
|
|
166
|
+
content: "◀ prev";
|
|
167
|
+
font-size: 14px; /* フォントサイズを戻す */
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* 2番目: Up (▲ up) */
|
|
171
|
+
#content > p:first-of-type > a:nth-child(2)::before {
|
|
172
|
+
content: "▲ up";
|
|
173
|
+
font-size: 14px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* 3番目: Next (next ▶) */
|
|
177
|
+
#content > p:first-of-type > a:nth-child(3)::before {
|
|
178
|
+
content: "next ▶";
|
|
179
|
+
font-size: 14px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* リンク先URLやアクセスキーに基づいて元テキストを非表示にし、アイコン+テキストを再定義 */
|
|
183
|
+
/* 不要な誤爆を防ぐため index の条件を外し、_button や正確なファイル名で判定します */
|
|
184
|
+
#content > p > a[accesskey],
|
|
185
|
+
#content > p > a[href*="prev"],
|
|
186
|
+
#content > p > a[href*="up"],
|
|
187
|
+
#content > p > a[href*="next"] {
|
|
188
|
+
font-size: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Prev (◀ prev) */
|
|
192
|
+
#content > p > a[accesskey="p"]::before,
|
|
193
|
+
#content > p > a[href*="prev"]::before {
|
|
194
|
+
content: "◀ prev";
|
|
195
|
+
font-size: 14px; /* ここでフォントサイズを戻す */
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Up (▲ up) */
|
|
199
|
+
#content > p > a[accesskey="u"]::before,
|
|
200
|
+
#content > p > a[href*="up_button"]::before,
|
|
201
|
+
#content > p > a[href*="up.html"]::before {
|
|
202
|
+
content: "▲ up";
|
|
203
|
+
font-size: 14px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Next (next ▶) */
|
|
207
|
+
#content > p > a[accesskey="n"]::before,
|
|
208
|
+
#content > p > a[href*="next"]::before {
|
|
209
|
+
content: "next ▶";
|
|
210
|
+
font-size: 14px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* スマホ対応(幅が狭い場合) */
|
|
214
|
+
@media (max-width: 800px) {
|
|
215
|
+
#table-of-contents {
|
|
216
|
+
position: relative;
|
|
217
|
+
width: 100%;
|
|
218
|
+
height: auto;
|
|
219
|
+
}
|
|
220
|
+
#content {
|
|
221
|
+
margin-left: 0;
|
|
222
|
+
padding: 1em;
|
|
223
|
+
}
|
|
224
|
+
/* スマホではテーブルをブロック要素にして縦並びにする */
|
|
225
|
+
.outline-text-2 table, .outline-text-3 table,
|
|
226
|
+
.outline-text-2 tbody, .outline-text-3 tbody,
|
|
227
|
+
.outline-text-2 tr, .outline-text-3 tr,
|
|
228
|
+
.outline-text-2 td, .outline-text-3 td {
|
|
229
|
+
display: block;
|
|
230
|
+
width: 100%;
|
|
231
|
+
}
|
|
232
|
+
.outline-text-2 td, .outline-text-3 td {
|
|
233
|
+
margin-bottom: 1em;
|
|
234
|
+
padding: 0;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#+OPTIONS: ^:{}
|
|
2
|
+
#+STARTUP: indent nolineimages overview num
|
|
3
|
+
#+TITLE: template for hyper card stack
|
|
4
|
+
#+AUTHOR: Shigeto R. Nishitani
|
|
5
|
+
#+EMAIL: (concat "shigeto_nishitani@mac.com")
|
|
6
|
+
#+LANGUAGE: jp
|
|
7
|
+
#+OPTIONS: H:4 toc:t num:2
|
|
8
|
+
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style.css" />
|
|
9
|
+
#+MACRO: dummy_link @@html:<a href="#">$1</a>@@
|
|
10
|
+
|
|
11
|
+
# for style.css, never move from here
|
|
12
|
+
{{{dummy_link(prev_button)}}}
|
|
13
|
+
{{{dummy_link(up_button)}}}
|
|
14
|
+
{{{dummy_link(next_button)}}}
|
|
15
|
+
# for a real link rewrite usual [[\url][]]
|
|
16
|
+
|
|
17
|
+
* head1
|
|
18
|
+
** head2
|
|
19
|
+
- list
|
|
20
|
+
|
|
21
|
+
#+begin_src ruby
|
|
22
|
+
name = ARGV[0] || 'Rudy'
|
|
23
|
+
puts "Hello #{name}."
|
|
24
|
+
#+end_src
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<canvas id="myCanvas" width="600" height="200" style="border:1px solid #ccc; cursor:pointer;"></canvas>
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
const canvas = document.getElementById('myCanvas');
|
|
5
|
+
const ctx = canvas.getContext('2d');
|
|
6
|
+
|
|
7
|
+
// 1. ボタン情報の定義(画像パス、座標、サイズ、リンク先)
|
|
8
|
+
const buttons = [
|
|
9
|
+
{
|
|
10
|
+
src: 'button1.png', // 画像のパス
|
|
11
|
+
x: 50, y: 50, // 配置するX, Y座標
|
|
12
|
+
width: 100, height: 100, // 画像のサイズ
|
|
13
|
+
link: 'https://example.com' // リンク先URL
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
src: 'button2.png',
|
|
17
|
+
x: 200, y: 50,
|
|
18
|
+
width: 100, height: 100,
|
|
19
|
+
link: 'https://example.com'
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
// 2. 画像を描画する関数
|
|
24
|
+
buttons.forEach(btn => {
|
|
25
|
+
const img = new Image();
|
|
26
|
+
img.src = btn.src;
|
|
27
|
+
img.onload = () => {
|
|
28
|
+
ctx.drawImage(img, btn.x, btn.y, btn.width, btn.height);
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// 3. クリックイベントの設定
|
|
33
|
+
canvas.addEventListener('click', (event) => {
|
|
34
|
+
// Canvas上の正確なクリック座標を取得
|
|
35
|
+
const rect = canvas.getBoundingClientRect();
|
|
36
|
+
const clickX = event.clientX - rect.left;
|
|
37
|
+
const clickY = event.clientY - rect.top;
|
|
38
|
+
|
|
39
|
+
// 4. 当たり判定と画面遷移
|
|
40
|
+
buttons.forEach(btn => {
|
|
41
|
+
if (
|
|
42
|
+
clickX >= btn.x &&
|
|
43
|
+
clickX <= btn.x + btn.width &&
|
|
44
|
+
clickY >= btn.y &&
|
|
45
|
+
clickY <= btn.y + btn.height
|
|
46
|
+
) {
|
|
47
|
+
// 範囲内をクリックした場合、指定URLへジャンプ
|
|
48
|
+
window.location.href = btn.link;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
</script>
|
|
53
|
+
|
|
@@ -99,6 +99,30 @@ module ManageYaml
|
|
|
99
99
|
end
|
|
100
100
|
InitEnv::Log.event("exited", parent_dir: parent_dir)
|
|
101
101
|
end
|
|
102
|
+
|
|
103
|
+
def to_semi_lattice
|
|
104
|
+
semi_lattice = SemiLattice.new
|
|
105
|
+
node_map = {}
|
|
106
|
+
|
|
107
|
+
@data['nodes'].each do |node_data|
|
|
108
|
+
id = node_data['id']
|
|
109
|
+
name = node_data['name']
|
|
110
|
+
type = node_data['type']
|
|
111
|
+
file_path = node_data['file_path']
|
|
112
|
+
icon_path = node_data['src'] # :srcを:icon_pathに渡す
|
|
113
|
+
|
|
114
|
+
node = semi_lattice.add_node(name, type, file_path, icon_path)
|
|
115
|
+
node_map[id] = node
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@data['edges'].each do |edge_data|
|
|
119
|
+
from_id = edge_data['from']
|
|
120
|
+
to_id = edge_data['to']
|
|
121
|
+
edge = semi_lattice.add_edge(node_map[from_id], node_map[to_id])
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
semi_lattice
|
|
125
|
+
end
|
|
102
126
|
end
|
|
103
127
|
|
|
104
128
|
class MkDirYaml
|
|
@@ -6,6 +6,7 @@ EDGE_COLOR = 'black' # 標準色に戻す
|
|
|
6
6
|
|
|
7
7
|
module SLComponents
|
|
8
8
|
# 日本語対応フォントの優先順位で選択 for win11, なければ省略
|
|
9
|
+
PROJECT_ROOT = File.expand_path('../..', __dir__)
|
|
9
10
|
|
|
10
11
|
class NodeShape
|
|
11
12
|
attr_accessor :x, :y, :name, :label, :fixed, :linked, :dx, :dy, :type, :file_path
|
|
@@ -47,10 +48,12 @@ module SLComponents
|
|
|
47
48
|
class Icon < NodeShape
|
|
48
49
|
def setup_shape
|
|
49
50
|
p ["setup @icon_path", @icon_path]
|
|
50
|
-
|
|
51
|
+
default_icon_path = '.semi_lattice/icons/file.png'
|
|
52
|
+
icon_path = @icon_path && File.exist?(@icon_path) ? @icon_path : default_icon_path
|
|
53
|
+
p ["icon_path", File.expand_path(icon_path)]
|
|
51
54
|
@image = Image.new(
|
|
52
55
|
icon_path,
|
|
53
|
-
x: @x-
|
|
56
|
+
x: @x-60.48, y: @y-38.88, width: 120.96, height: 77.76, z: @z
|
|
54
57
|
)
|
|
55
58
|
end
|
|
56
59
|
|
|
@@ -59,19 +62,19 @@ module SLComponents
|
|
|
59
62
|
end
|
|
60
63
|
|
|
61
64
|
def x=(x)
|
|
62
|
-
@image.x = x -
|
|
65
|
+
@image.x = x - 60.48
|
|
63
66
|
end
|
|
64
67
|
|
|
65
68
|
def y=(y)
|
|
66
|
-
@image.y = y -
|
|
69
|
+
@image.y = y - 38.88
|
|
67
70
|
end
|
|
68
71
|
end
|
|
69
72
|
|
|
70
73
|
class FolderIcon < NodeShape
|
|
71
74
|
def setup_shape
|
|
72
75
|
@image = Image.new(
|
|
73
|
-
'
|
|
74
|
-
x: @x-
|
|
76
|
+
'.semi_lattice/icons/folder.png',
|
|
77
|
+
x: @x-67.2, y: @y-43.2, width: 134.4, height: 86.4, z: @z
|
|
75
78
|
)
|
|
76
79
|
end
|
|
77
80
|
|
|
@@ -80,19 +83,19 @@ module SLComponents
|
|
|
80
83
|
end
|
|
81
84
|
|
|
82
85
|
def x=(x)
|
|
83
|
-
@image.x = x -
|
|
86
|
+
@image.x = x - 67.2
|
|
84
87
|
end
|
|
85
88
|
|
|
86
89
|
def y=(y)
|
|
87
|
-
@image.y = y -
|
|
90
|
+
@image.y = y - 43.2
|
|
88
91
|
end
|
|
89
92
|
end
|
|
90
93
|
|
|
91
94
|
class Document < NodeShape
|
|
92
95
|
def setup_shape
|
|
93
96
|
@image = Image.new(
|
|
94
|
-
'
|
|
95
|
-
x: @x-
|
|
97
|
+
'.semi_lattice/icons/document.png',
|
|
98
|
+
x: @x-33.6, y: @y-24, width: 45.6, height: 67.2, z: @z
|
|
96
99
|
)
|
|
97
100
|
end
|
|
98
101
|
|
|
@@ -101,11 +104,11 @@ module SLComponents
|
|
|
101
104
|
end
|
|
102
105
|
|
|
103
106
|
def x=(x)
|
|
104
|
-
@image.x = x -
|
|
107
|
+
@image.x = x - 33.6
|
|
105
108
|
end
|
|
106
109
|
|
|
107
110
|
def y=(y)
|
|
108
|
-
@image.y = y -
|
|
111
|
+
@image.y = y - 24
|
|
109
112
|
end
|
|
110
113
|
end
|
|
111
114
|
|
|
@@ -212,9 +215,9 @@ module SLComponents
|
|
|
212
215
|
|
|
213
216
|
# テキスト生成(共通化)
|
|
214
217
|
if font_path && File.exist?(font_path)
|
|
215
|
-
@text = Text.new(label, x: x-28, y: y
|
|
218
|
+
@text = Text.new(label, x: x-28, y: y+35, size: 14, color: 'black', font: font_path, z: 11)
|
|
216
219
|
else
|
|
217
|
-
@text = Text.new(label, x: x-28, y: y
|
|
220
|
+
@text = Text.new(label, x: x-28, y: y+35, size: 14, color: 'black', z: 11)
|
|
218
221
|
end
|
|
219
222
|
|
|
220
223
|
# アイコン生成
|
|
@@ -222,7 +225,7 @@ module SLComponents
|
|
|
222
225
|
when 'dir_icon'
|
|
223
226
|
FolderIcon.new(x: x, y: y, color: NODE_COLOR, z: 10)
|
|
224
227
|
when 'dir'
|
|
225
|
-
|
|
228
|
+
FolderIcon.new(x: x, y: y, color: NODE_COLOR, z: 10)
|
|
226
229
|
when 'document'
|
|
227
230
|
Document.new(x: x, y: y, color: NODE_COLOR, z: 10)
|
|
228
231
|
when 'icon'
|
|
@@ -249,8 +252,8 @@ module SLComponents
|
|
|
249
252
|
@circle.color = c # これ以降でcomponentをupdate
|
|
250
253
|
@circle.x = @x
|
|
251
254
|
@circle.y = @y
|
|
252
|
-
@text.x = @x -
|
|
253
|
-
@text.y = @y
|
|
255
|
+
@text.x = @x - @text.width / 2
|
|
256
|
+
@text.y = @y + 35
|
|
254
257
|
end
|
|
255
258
|
end
|
|
256
259
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mk_semi_lattice
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shigeto R. Nishitani
|
|
@@ -121,8 +121,6 @@ files:
|
|
|
121
121
|
- exe/hc
|
|
122
122
|
- exe/mk_semi_lattice
|
|
123
123
|
- exe/mk_sl
|
|
124
|
-
- lib/.semi_lattice/icons/document.png
|
|
125
|
-
- lib/.semi_lattice/icons/folder.png
|
|
126
124
|
- lib/abbrev_checker/abbrev_check.rb
|
|
127
125
|
- lib/abbrev_checker/abbrev_sample.tgz
|
|
128
126
|
- lib/abbrev_checker/abbrev_yamls/command/dir_tree.yaml
|
|
@@ -144,10 +142,23 @@ files:
|
|
|
144
142
|
- lib/docs/short_intro/short_intro.003.png
|
|
145
143
|
- lib/docs/short_intro/short_intro.004.png
|
|
146
144
|
- lib/hc.rb
|
|
145
|
+
- lib/mk_light_table/math_ex_ala_26s.005.png
|
|
146
|
+
- lib/mk_light_table/math_ex_ala_26s.006.png
|
|
147
|
+
- lib/mk_light_table/math_ex_ala_26s.007.png
|
|
148
|
+
- lib/mk_light_table/mk_light_table.html
|
|
149
|
+
- lib/mk_light_table/mk_light_table.org
|
|
150
|
+
- lib/mk_light_table/mk_light_table.rb
|
|
151
|
+
- lib/mk_light_table/mk_light_table.yaml
|
|
152
|
+
- lib/mk_light_table/mk_light_table_link.key
|
|
153
|
+
- lib/mk_light_table/readme.org
|
|
154
|
+
- lib/mk_light_table/style.css
|
|
155
|
+
- lib/mk_light_table/template.org
|
|
156
|
+
- lib/mk_link_canvas/sample.html
|
|
147
157
|
- lib/mk_semi_lattice.rb
|
|
148
158
|
- lib/mk_semi_lattice/.semi_lattice/dir_node_edge.yaml
|
|
149
159
|
- lib/mk_semi_lattice/.semi_lattice/dir_tree.yaml
|
|
150
160
|
- lib/mk_semi_lattice/.semi_lattice/icons/document.png
|
|
161
|
+
- lib/mk_semi_lattice/.semi_lattice/icons/file.png
|
|
151
162
|
- lib/mk_semi_lattice/.semi_lattice/icons/folder.png
|
|
152
163
|
- lib/mk_semi_lattice/.semi_lattice/semi_lattice.yaml
|
|
153
164
|
- lib/mk_semi_lattice/docs/images/mk_semi_lattice.001.png
|
|
@@ -242,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
242
253
|
- !ruby/object:Gem::Version
|
|
243
254
|
version: '0'
|
|
244
255
|
requirements: []
|
|
245
|
-
rubygems_version:
|
|
256
|
+
rubygems_version: 4.0.17
|
|
246
257
|
specification_version: 4
|
|
247
258
|
summary: make semi lattice graph from directory structure
|
|
248
259
|
test_files: []
|
|
Binary file
|
|
File without changes
|