hikiutils 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/abst/#testhiki# +0 -0
- data/abst/.DS_Store +0 -0
- data/abst/out2.pdf +0 -0
- data/abst/out3.aux +15 -0
- data/abst/out3.log +224 -0
- data/abst/out3.pdf +0 -0
- data/abst/out3.synctex.gz +0 -0
- data/abst/out3.tex +106 -0
- data/abst/out4.aux +15 -0
- data/abst/out4.log +187 -0
- data/abst/out4.pdf +0 -0
- data/abst/out4.synctex.gz +0 -0
- data/abst/out4.tex +81 -0
- data/abst/testhiki +26 -0
- data/abst/testhiki2 +106 -0
- data/abst/yamane_abst.pdf +0 -0
- data/abst/yamane_abst.tex +59 -0
- data/abst/yamane_abst_new.pdf +0 -0
- data/abst/yamane_powerpoint.key +0 -0
- data/abst/yamane_powerpoint.pptx/Data/PresetImageFill0-1.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/PresetImageFill1-2.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/PresetImageFill2-3.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/PresetImageFill3-4.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/PresetImageFill4-5.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/PresetImageFill5-6.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/image1-12.png +0 -0
- data/abst/yamane_powerpoint.pptx/Data/image1-9.png +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt0@2x-13.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt10@2x-22.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt1@2x-14.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt2@2x-15.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt3@2x-16.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt4@2x-17.png +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt5@2x-18.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt6@2x-19.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt7@2x-20.png +0 -0
- data/abst/yamane_powerpoint.pptx/Data/mt8@2x-21.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/st0-23.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/st1-24.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/st2-25.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/st3-26.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/st4-276.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Data/st5-279.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/Index.zip +0 -0
- data/abst/yamane_powerpoint.pptx/Metadata/BuildVersionHistory.plist +8 -0
- data/abst/yamane_powerpoint.pptx/Metadata/DocumentIdentifier +1 -0
- data/abst/yamane_powerpoint.pptx/Metadata/Properties.plist +0 -0
- data/abst/yamane_powerpoint.pptx/preview-micro.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/preview-web.jpg +0 -0
- data/abst/yamane_powerpoint.pptx/preview.jpg +0 -0
- data/lib/hikiutils/version.rb +1 -1
- data/lib/hikiutils.rb +38 -2
- data/lib/templates/Rakefile_hiki_sync +61 -0
- data/lib/templates/hik_help.yml +61 -0
- data/lib/templates/hiki_help.yml +29 -0
- metadata +55 -2
data/abst/testhiki
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
!title:hiki編集作業を容易にするツールの開発
|
|
2
|
+
!author:情報科学科 西谷研究室 3554 山根 亮太
|
|
3
|
+
!!1 目的
|
|
4
|
+
本研究を行う目的は,hikiの編集作業をより容易にするためのツールを開発することである.それを達成するために,今回hikiのコマンド名をshell風にすることで瞬時にコマンドの機能を判断し使用することができるようにする.現在hikiでコマンドを入力する際,ユーザーは瞬間的にそのコマンドの機能や意味を判断することが難しく迷いが生じてしまうことがある.その解決策として,hikiのコマンド名をshell風に書き換えることでこの問題を解決したい.
|
|
5
|
+
!!2 手法
|
|
6
|
+
!!!2.1 hikiについて
|
|
7
|
+
hikiとはwikiエンジンの1つとされており,Rubyを用いられることで作られたwikiクローンである.
|
|
8
|
+
主なhikiの特徴として
|
|
9
|
+
*オリジナルwikiに似たシンプルな書式
|
|
10
|
+
*プラグインによる機能拡張
|
|
11
|
+
*出力するHTMLを柔軟に変更可能
|
|
12
|
+
*ページにカテゴリ付けできる
|
|
13
|
+
*CSSを使ったテーマ機能
|
|
14
|
+
*携帯端末可能
|
|
15
|
+
*InterWikiのサポート
|
|
16
|
+
*HikiFarmに対応
|
|
17
|
+
*ページの追加,編集がしやすい
|
|
18
|
+
等がある.[1]
|
|
19
|
+
!!!2.2 hikiutilsについて
|
|
20
|
+
hikiutilsとはhikiの編集作業を行うためのものである.よって,今回の研究はhikiutilsを編集することによりコマンド名の編集を行う.hikiutilsはRubyのライブラリであるgemで提供されている.hikiutilsはCLI(Charactor Line Interface)で提供されているため,プログラミング言語Rubyでコマンドラインのオプション解析を行うoptparseが利用されている.そのため,Rubyにはいくつかのlibraryが用意されている.
|
|
21
|
+
!!3 開発要件
|
|
22
|
+
Todoアプリケーションの構造はlib/todo/command/options.rbにサブコマンド用の定義があり,入力されたコマンドはilb/todo/command.rbで判断されることでlib/todo/command/options.rb内で実行される.hikiutilsの構造はTodoアプリケーションの構造と同じでhikiの編集を容易にするためのツール群のため,この部分の変更を行うことでコマンド名を書き換える.
|
|
23
|
+
!!4 考察
|
|
24
|
+
現在はTodoアプリケーションの作成を行うことでプログラムの構造の理解をしている.しかし,まだhikiutilsのコマンド名の変更までには達していない.今後の課題としては,誰が見てもコマンドの機能が判断できるコマンド名を考え,実際にhikiutils内でそのコマンドを実装する必要がある.
|
|
25
|
+
!!参考文献
|
|
26
|
+
[1]hikiwiki.org/ja/about.html
|
data/abst/testhiki2
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
\documentclass[a4j,twocolumn]{jsarticle}
|
|
2
|
+
\usepackage{subfigure}
|
|
3
|
+
|
|
4
|
+
\def\Vec#1{\mbox{\boldmath $#1$}}
|
|
5
|
+
\usepackage[dvipdfmx]{graphicx}
|
|
6
|
+
\usepackage{url}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
\setlength{\textheight}{275mm}
|
|
10
|
+
\headheight 5mm
|
|
11
|
+
\topmargin -30mm
|
|
12
|
+
\textwidth 185mm
|
|
13
|
+
\oddsidemargin -15mm
|
|
14
|
+
\evensidemargin -15mm
|
|
15
|
+
\pagestyle{empty}
|
|
16
|
+
\begin{document}
|
|
17
|
+
\title{hiki編集作業を容易にするツールの開発}
|
|
18
|
+
\author{情報科学科 西谷研究室 3554 山根 亮太}
|
|
19
|
+
\date{}
|
|
20
|
+
\maketitle
|
|
21
|
+
\section{目的}
|
|
22
|
+
|
|
23
|
+
hikiはwiki cloneとして便利.
|
|
24
|
+
|
|
25
|
+
hikiは,通常web上で編集しているが,なにが不便?
|
|
26
|
+
|
|
27
|
+
GUIとCUIが混在してしまい,操作が不便である.
|
|
28
|
+
そこで,編集操作がCUIで完結するために,hikiutilsが開発された.
|
|
29
|
+
しかしそのユーザインターフェースに問題がある.
|
|
30
|
+
現在hikiでコマンドを入力する際,ユーザーは瞬間的にそのコマンドの機能や意味を判断することが難しく迷いが生じてしまうことがある.
|
|
31
|
+
|
|
32
|
+
具体的な作業は,hikiのコマンド名をshell風にすることで瞬時にコマンドの機能を判断し使用することができるようにすることである.
|
|
33
|
+
|
|
34
|
+
しかし,この開発をすることでユーザーはコマンド入力の際にそのコマンドの機能が分からなくなって入力に迷ったり,コマンド自体を忘れたりすることがなくなりより簡単に入力ができ,時間短縮にも繋がる.そのため,hikiのコマンド名をshell風に書き換えることでこの問題を解決したい.
|
|
35
|
+
|
|
36
|
+
\section{システムについて}
|
|
37
|
+
\subsection{hikiについて}
|
|
38
|
+
hikiとはwikiエンジンの1つとされており,プログラミング言語Rubyを用いられることで作られたwikiクローンである.
|
|
39
|
+
hikiの主な特徴として
|
|
40
|
+
\begin{itemize}
|
|
41
|
+
\item オリジナルwikiに似たシンプルな書式
|
|
42
|
+
\item プラグインによる機能拡張
|
|
43
|
+
\item 出力するHTMLを柔軟に変更可能
|
|
44
|
+
\item ページにカテゴリ付けできる
|
|
45
|
+
\item CSSを使ったテーマ機能
|
|
46
|
+
\item 携帯端末可能
|
|
47
|
+
\item InterWikiのサポート
|
|
48
|
+
\item HikiFarmに対応
|
|
49
|
+
\item ページの追加,編集がしやすい
|
|
50
|
+
\end{itemize}
|
|
51
|
+
等がある\cite{hiki}.
|
|
52
|
+
|
|
53
|
+
\subsection{hikiutilsについて}
|
|
54
|
+
hikiutilsは,hikiの編集作業を容易に行うことができるようにするツール群である.
|
|
55
|
+
よって,今回の研究はhikiutilsのプログラムを編集することで瞬時にコマンドの機能や意味を理解できるコマンド名を考え編集を行う.
|
|
56
|
+
hikiutilsはプログラミング言語Rubyのライブラリであるgemによって提供されている\cite{gem}.
|
|
57
|
+
hikiutilsはCLI(Command Line Interface)で提供されているため,
|
|
58
|
+
プログラミング言語Ruby版のコマンドラインのオプション解析を行いコマンドを標準化にするoptparseが利用されている\cite{opt}.
|
|
59
|
+
そのため,CLIのoptparseを簡単に扱うためにRubyにはいくつかのlibraryが用意されている.
|
|
60
|
+
|
|
61
|
+
\section{手法}
|
|
62
|
+
このようなCLIの階層的なコマンド実装を示したcodeとしてTodoというgemアプリケーションがある\cite{PerfectRuby}.
|
|
63
|
+
このプログラムではlib/todo/command/options.rbにサブコマンド用の定義があり,入力されたコマンドはilb/todo/command.rbで判断されることによりlib/todo/command/options.rb内で実行される.hikiutilsのプログラムの構造はTodoアプリケーションのプログラムの構造と似たものでありhikiの編集を容易にするためのツール群のため,この部分の編集を行うことでコマンド名を書き換える.
|
|
64
|
+
|
|
65
|
+
\section{考察}
|
|
66
|
+
|
|
67
|
+
他の視点から言えない? が見れない?
|
|
68
|
+
|
|
69
|
+
todoのコードを追いかけて.
|
|
70
|
+
|
|
71
|
+
直感的なコマンドname? shell風,git風, help?
|
|
72
|
+
|
|
73
|
+
似たようなソフトに何がある?
|
|
74
|
+
|
|
75
|
+
似たようなアプリに何がある?
|
|
76
|
+
|
|
77
|
+
\begin{verbatim}
|
|
78
|
+
hikiutils: provide utilities for helping hiki editing.
|
|
79
|
+
"open -a mi"
|
|
80
|
+
Usage: hiki [options]
|
|
81
|
+
-v, --version show program Version.
|
|
82
|
+
-s, --show show sources
|
|
83
|
+
-a, --add add sources info
|
|
84
|
+
-t, --target VAL set target id
|
|
85
|
+
-e, --edit FILE open file
|
|
86
|
+
-l, --list [FILE] list files
|
|
87
|
+
-u, --update FILE update file
|
|
88
|
+
-r, --rsync rsync files
|
|
89
|
+
--database FILE read database file
|
|
90
|
+
--display FILE display converted hikifile
|
|
91
|
+
-c, --checkdb check database file
|
|
92
|
+
--remove FILE remove file
|
|
93
|
+
--move FILES move file1,file2
|
|
94
|
+
--euc FILE translate file to euc
|
|
95
|
+
\end{verbatim}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
現在Todoアプリケーションのコードを追いかけて,プログラムの構造を理解している.しかし,hikiのコマンド名の変更や直感的なコマンド名を考えることは現在できていない.今後の課題としては,まず初めにTodoアプリケーションの構造を理解することでhikiutilsの構造を理解する.また,誰が見ても機能が判断できるコマンド名を考え,実際にhikiutils内でそのコマンドの編集を行って実装し,そのコマンドが分かりやすいものであるかどうかを試してもらう必要がある.
|
|
99
|
+
|
|
100
|
+
\begin{thebibliography}{9}
|
|
101
|
+
\bibitem{hiki}「hiki」,hikiwiki.org/ja/about.html,2016/9/2 アクセス.
|
|
102
|
+
\bibitem{gem}「Rubygems-Wikipedia」,\url{ja.wikipedia.org/wiki/RubyGems},2016/9/2 アクセス.
|
|
103
|
+
\bibitem{opt}「optparseの使い方」,\url{dharry.hatenablog.com/entry/20081008/1223490673},2016/9/2 アクセス.
|
|
104
|
+
\bibitem{PerfectRuby}「パーフェクトRuby」,Rubyサポーターズ(技術評論社 2013).
|
|
105
|
+
\end{thebibliography}
|
|
106
|
+
\end{document}
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
\documentclass[a4j,twocolumn]{jsarticle}
|
|
2
|
+
\usepackage{subfigure}
|
|
3
|
+
|
|
4
|
+
\def\Vec#1{\mbox{\boldmath $#1$}}
|
|
5
|
+
\usepackage[dvipdfmx]{graphicx}
|
|
6
|
+
|
|
7
|
+
\setlength{\textheight}{275mm}
|
|
8
|
+
\headheight 5mm
|
|
9
|
+
\topmargin -30mm
|
|
10
|
+
\textwidth 185mm
|
|
11
|
+
\oddsidemargin -15mm
|
|
12
|
+
\evensidemargin -15mm
|
|
13
|
+
\pagestyle{empty}
|
|
14
|
+
\begin{document}
|
|
15
|
+
\title{hiki編集作業を容易にするツールの開発}
|
|
16
|
+
\author{情報科学科 西谷研究室 3554 山根 亮太}
|
|
17
|
+
\date{}
|
|
18
|
+
\maketitle
|
|
19
|
+
\section{目的}
|
|
20
|
+
|
|
21
|
+
もう少し広い範囲の開発目標の中で,具体的な作業として,コマンドの命名規則を見直す.
|
|
22
|
+
|
|
23
|
+
本研究の目的は,hikiのコマンド名をshell風にすることで瞬時にコマンドの機能を判断し使用することができるようにすることである.現在hikiでコマンドを入力する際,ユーザーは瞬間的にそのコマンドの機能や意味を判断することが難しく迷いが生じてしまうことがある.その解決策として,hikiのコマンド名をshell風に書き換えることでこの問題を解決したい.
|
|
24
|
+
|
|
25
|
+
\section{手法}
|
|
26
|
+
\subsection{hikiについて}
|
|
27
|
+
hikiとはwikiエンジンの1つとされており,Rubyを用いられることで作られたwikiクローンである.主なhikiの特徴として
|
|
28
|
+
\begin{itemize}
|
|
29
|
+
\item オリジナルwikiに似たシンプルな書式
|
|
30
|
+
\item プラグインによる機能拡張
|
|
31
|
+
\item 出力するHTMLを柔軟に変更可能
|
|
32
|
+
\item ページにカテゴリ付けできる
|
|
33
|
+
\item CSSを使ったテーマ機能
|
|
34
|
+
\item 携帯端末可能
|
|
35
|
+
\item InterWikiのサポート
|
|
36
|
+
\item HikiFarmに対応
|
|
37
|
+
\item ページの追加,編集がしやすい
|
|
38
|
+
\end{itemize}
|
|
39
|
+
等がある\cite{hiki}.
|
|
40
|
+
|
|
41
|
+
gemについて何を書く?
|
|
42
|
+
|
|
43
|
+
hikiutilsの動作内容を解説.
|
|
44
|
+
hikiutilsはgemで提供されている.CLI(character line interface)で提供されているので,そのコマンドを標準化するライブラリoptparseを利用する.
|
|
45
|
+
|
|
46
|
+
CLIのoptionのparseを簡単に扱うためにRubyにはいくつかのlibraryが用意されている.
|
|
47
|
+
|
|
48
|
+
評価.観点.optparse
|
|
49
|
+
|
|
50
|
+
\section{開発要件}
|
|
51
|
+
Todoアプリケーションの構造はlib/todo/command/options.rbにサブコマンド用の定義があり,入力されたコマンドはlib/todo/command.rbで判断されることでlib/todo/command/options.rb内で実行される.hikiutilsの構造はTodoアプリケーションの構造と同じでhikiの編集を容易にするためのツール群のため,この部分の変更を行うことでコマンド名を書き換える.
|
|
52
|
+
|
|
53
|
+
\section{考察}
|
|
54
|
+
現在はTodoアプリケーションの作成を行うことでプログラムの構造の理解をしている.しかし,まだhikiutilsのコマンド名の変更までには達していない.今後の課題としては,誰が見てもコマンドの機能が判断できるコマンド名を考え,実際にhikiutils内でそのコマンドを実装する必要がある.
|
|
55
|
+
|
|
56
|
+
\begin{thebibliography}{9}
|
|
57
|
+
\bibitem{hiki}hikiサイト.
|
|
58
|
+
\end{thebibliography}
|
|
59
|
+
\end{document}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
120BA139-C23B-4290-8A16-71ECA44979FB
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/hikiutils/version.rb
CHANGED
data/lib/hikiutils.rb
CHANGED
|
@@ -68,6 +68,7 @@ EOS
|
|
|
68
68
|
opt.on('--remove FILE','remove file') {|file| remove_file(file)}
|
|
69
69
|
opt.on('--move FILES','move file1,file2',Array) {|files| move_file(files)}
|
|
70
70
|
opt.on('--euc FILE','translate file to euc') {|file| euc_file(file) }
|
|
71
|
+
opt.on('--initialize','initialize source directory') {dir_init() }
|
|
71
72
|
end
|
|
72
73
|
begin
|
|
73
74
|
command_parser.parse!(@argv)
|
|
@@ -78,6 +79,37 @@ EOS
|
|
|
78
79
|
exit
|
|
79
80
|
end
|
|
80
81
|
|
|
82
|
+
def dir_init()
|
|
83
|
+
begin
|
|
84
|
+
p target_dir = File.readlines('./.hikirc')[0]
|
|
85
|
+
rescue
|
|
86
|
+
p target_dir=@src[:srcs][@target][:local_dir]
|
|
87
|
+
File.open('./.hikirc','w'){|file| file.print "#{target_dir}\n"}
|
|
88
|
+
end
|
|
89
|
+
cp_files=[['Rakefile_hiki_sync','Rakefile'],
|
|
90
|
+
['hiki_help.yml','hiki_help.yml']]
|
|
91
|
+
cp_files.each{|files|
|
|
92
|
+
p source = File.join(File.expand_path('..', __FILE__),'templates',files[0])
|
|
93
|
+
p target = File.join(Dir.pwd,files[1])
|
|
94
|
+
FileUtils.cp(source,target,:verbose=>true)
|
|
95
|
+
}
|
|
96
|
+
['figs','data'].each{|dir|
|
|
97
|
+
begin
|
|
98
|
+
Dir.mkdir(dir)
|
|
99
|
+
rescue => e
|
|
100
|
+
print e
|
|
101
|
+
end
|
|
102
|
+
}
|
|
103
|
+
begin
|
|
104
|
+
p cont=File.read('./.gitignore')
|
|
105
|
+
unless cont.include?('.hikirc')
|
|
106
|
+
File.open('./.gitignore','w'){|file| file.print(".hikirc\n")}
|
|
107
|
+
end
|
|
108
|
+
rescue
|
|
109
|
+
File.open('./.gitignore','w'){|file| file.print(".hikirc\n")}
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
81
113
|
def display(file)
|
|
82
114
|
body = HikiDoc.to_html(File.read(file))
|
|
83
115
|
source = HTML_TEMPLATE
|
|
@@ -202,12 +234,16 @@ EOS
|
|
|
202
234
|
file = (file0==nil) ? 'FrontPage' : file0
|
|
203
235
|
#rm cache file
|
|
204
236
|
t_file=File.join(@l_dir,'cache/parser',file)
|
|
205
|
-
|
|
206
|
-
|
|
237
|
+
begin
|
|
238
|
+
FileUtils.rm(t_file,:verbose=>true)
|
|
207
239
|
#update info file
|
|
208
240
|
info=InfoDB.new(@l_dir)
|
|
209
241
|
info.update(file0)
|
|
210
242
|
|
|
243
|
+
rescue
|
|
244
|
+
print "some errors on touch, but dont mind...\n"
|
|
245
|
+
end
|
|
246
|
+
|
|
211
247
|
#open file on browser
|
|
212
248
|
l_path = @src[:srcs][@target][:local_uri]
|
|
213
249
|
# p command="open -a #{@browser} \'#{l_path}/?c=edit;p=#{file}\'"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
begin
|
|
2
|
+
target_dir = File.readlines('./.hikirc')[0].chomp
|
|
3
|
+
rescue => e
|
|
4
|
+
puts e
|
|
5
|
+
exit
|
|
6
|
+
end
|
|
7
|
+
p target_dir
|
|
8
|
+
|
|
9
|
+
task :default do
|
|
10
|
+
system 'rake -T'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "convert fig size"
|
|
14
|
+
task :convert do
|
|
15
|
+
source = ARGV[2]
|
|
16
|
+
scale = ARGV[1]
|
|
17
|
+
target = File.join('figs',source)
|
|
18
|
+
p command = "convert #{source} -resize #{scale}\% #{target}"
|
|
19
|
+
system command
|
|
20
|
+
exit
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "sync hikis and figs to hiki directory"
|
|
24
|
+
task :sync do
|
|
25
|
+
p dirnames=Dir.pwd.split('/')
|
|
26
|
+
p basename = (dirnames[-1]=='hikis')? dirnames[-2] : dirnames[-1]
|
|
27
|
+
p entries=Dir.entries('.')
|
|
28
|
+
entries[2..-1].each{|source| #cp *.hiki
|
|
29
|
+
next unless source.include?('.hiki')
|
|
30
|
+
next if source.include?('.hikirc')
|
|
31
|
+
p base = source.split('.')[0]
|
|
32
|
+
name = (base==basename)? base : basename+'_'+base
|
|
33
|
+
p target = File.join(target_dir,'text',name)
|
|
34
|
+
FileUtils.cp(source,target,:verbose=>true)
|
|
35
|
+
}
|
|
36
|
+
p entries=Dir.entries('./figs') #cp files in figs
|
|
37
|
+
entries[2..-1].each{|file|
|
|
38
|
+
p source = File.join('./figs',file)
|
|
39
|
+
p target = File.join(target_dir,'cache','attach',basename)
|
|
40
|
+
FileUtils.cp(source,target,:verbose=>true)
|
|
41
|
+
}
|
|
42
|
+
exit
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
desc "For hiki Errno::ENOENT, Errno::EACCES"
|
|
46
|
+
task :chenv do
|
|
47
|
+
p user = ENV['USER']
|
|
48
|
+
system("sudo chmod -R a+w #{target_dir}")
|
|
49
|
+
system("sudo chown -R #{user} #{target_dir}")
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
desc "self copy to hikiutils template directory"
|
|
53
|
+
task :self_copy do
|
|
54
|
+
p cp_files=[['Rakefile','Rakefile_hiki_sync'],
|
|
55
|
+
[File.join(ENV['HOME'],'.my_help','hiki_help.yml'),'hik_help.yml']]
|
|
56
|
+
cp_files.each{|files|
|
|
57
|
+
p source = File.join(Dir.pwd,'Rakefile')
|
|
58
|
+
p target = File.join('/Users/bob/Github/hikiutils/lib/templates/',files[1])
|
|
59
|
+
FileUtils.cp(source,target,:verbose=>true)
|
|
60
|
+
}
|
|
61
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
begin
|
|
2
|
+
target_dir = File.readlines('./.hikirc')[0].chomp
|
|
3
|
+
rescue => e
|
|
4
|
+
puts e
|
|
5
|
+
exit
|
|
6
|
+
end
|
|
7
|
+
p target_dir
|
|
8
|
+
|
|
9
|
+
task :default do
|
|
10
|
+
system 'rake -T'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "convert fig size"
|
|
14
|
+
task :convert do
|
|
15
|
+
source = ARGV[2]
|
|
16
|
+
scale = ARGV[1]
|
|
17
|
+
target = File.join('figs',source)
|
|
18
|
+
p command = "convert #{source} -resize #{scale}\% #{target}"
|
|
19
|
+
system command
|
|
20
|
+
exit
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "sync hikis and figs to hiki directory"
|
|
24
|
+
task :sync do
|
|
25
|
+
p dirnames=Dir.pwd.split('/')
|
|
26
|
+
p basename = (dirnames[-1]=='hikis')? dirnames[-2] : dirnames[-1]
|
|
27
|
+
p entries=Dir.entries('.')
|
|
28
|
+
entries[2..-1].each{|source| #cp *.hiki
|
|
29
|
+
next unless source.include?('.hiki')
|
|
30
|
+
next if source.include?('.hikirc')
|
|
31
|
+
p base = source.split('.')[0]
|
|
32
|
+
name = (base==basename)? base : basename+'_'+base
|
|
33
|
+
p target = File.join(target_dir,'text',name)
|
|
34
|
+
FileUtils.cp(source,target,:verbose=>true)
|
|
35
|
+
}
|
|
36
|
+
p entries=Dir.entries('./figs') #cp files in figs
|
|
37
|
+
entries[2..-1].each{|file|
|
|
38
|
+
p source = File.join('./figs',file)
|
|
39
|
+
p target = File.join(target_dir,'cache','attach',basename)
|
|
40
|
+
FileUtils.cp(source,target,:verbose=>true)
|
|
41
|
+
}
|
|
42
|
+
exit
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
desc "For hiki Errno::ENOENT, Errno::EACCES"
|
|
46
|
+
task :chenv do
|
|
47
|
+
p user = ENV['USER']
|
|
48
|
+
system("sudo chmod -R a+w #{target_dir}")
|
|
49
|
+
system("sudo chown -R #{user} #{target_dir}")
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
desc "self copy to hikiutils template directory"
|
|
53
|
+
task :self_copy do
|
|
54
|
+
p cp_files=[['Rakefile','Rakefile_hiki_sync'],
|
|
55
|
+
[File.join(ENV['HOME'],'.my_help','hiki_help.yml'),'hik_help.yml']]
|
|
56
|
+
cp_files.each{|files|
|
|
57
|
+
p source = File.join(Dir.pwd,'Rakefile')
|
|
58
|
+
p target = File.join('/Users/bob/Github/hikiutils/lib/templates/',files[1])
|
|
59
|
+
FileUtils.cp(source,target,:verbose=>true)
|
|
60
|
+
}
|
|
61
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
:head:
|
|
3
|
+
- hikiutil関連のヘルプ
|
|
4
|
+
:initialize:
|
|
5
|
+
:opts:
|
|
6
|
+
:short: "-i"
|
|
7
|
+
:long: "--initialize"
|
|
8
|
+
:desc: localでの同期directoryの初期化
|
|
9
|
+
:title: localでの同期directoryの初期化
|
|
10
|
+
:cont:
|
|
11
|
+
- hiki --initializeで必要なファイル(Rakefile, ./.hikirc)がcopyされる
|
|
12
|
+
- rake syncによってhikiディレクトリーと同期が取られる
|
|
13
|
+
- rake convert 20 TARGET.pngによって,figs/TAERGET.pngに20%縮小して保存される
|
|
14
|
+
- hiki -u TARGETによってブラウザー表示される
|
|
15
|
+
- テキストの拡張子は'.hiki'
|
|
16
|
+
- hikiでのurlはテキスト前とディレクトリーから自動生成される
|
|
17
|
+
- 例えば,hiki2latex_saki/introduciton.hikiとするとhiki2latex_saki_introducitonと変換される
|
|
18
|
+
- |
|
|
19
|
+
attach_anchorでは
|
|
20
|
+
'{{attach_anchor(test.png, hiki2latex_saki)}}'
|
|
21
|
+
と,directory指定しなければならない.
|
|
22
|
+
:syncpwd:
|
|
23
|
+
:opts:
|
|
24
|
+
:short: "-s"
|
|
25
|
+
:long: "--syncpwd"
|
|
26
|
+
:desc: syncpwd
|
|
27
|
+
:title: syncpwd
|
|
28
|
+
:cont:
|
|
29
|
+
- syncpwd
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hikiutils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shigeto R. Nishitani
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-01-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -167,6 +167,56 @@ files:
|
|
|
167
167
|
- README.md
|
|
168
168
|
- Rakefile
|
|
169
169
|
- Rakefile.orig
|
|
170
|
+
- abst/#testhiki#
|
|
171
|
+
- abst/.DS_Store
|
|
172
|
+
- abst/out2.pdf
|
|
173
|
+
- abst/out3.aux
|
|
174
|
+
- abst/out3.log
|
|
175
|
+
- abst/out3.pdf
|
|
176
|
+
- abst/out3.synctex.gz
|
|
177
|
+
- abst/out3.tex
|
|
178
|
+
- abst/out4.aux
|
|
179
|
+
- abst/out4.log
|
|
180
|
+
- abst/out4.pdf
|
|
181
|
+
- abst/out4.synctex.gz
|
|
182
|
+
- abst/out4.tex
|
|
183
|
+
- abst/testhiki
|
|
184
|
+
- abst/testhiki2
|
|
185
|
+
- abst/yamane_abst.pdf
|
|
186
|
+
- abst/yamane_abst.tex
|
|
187
|
+
- abst/yamane_abst_new.pdf
|
|
188
|
+
- abst/yamane_powerpoint.key
|
|
189
|
+
- abst/yamane_powerpoint.pptx/Data/PresetImageFill0-1.jpg
|
|
190
|
+
- abst/yamane_powerpoint.pptx/Data/PresetImageFill1-2.jpg
|
|
191
|
+
- abst/yamane_powerpoint.pptx/Data/PresetImageFill2-3.jpg
|
|
192
|
+
- abst/yamane_powerpoint.pptx/Data/PresetImageFill3-4.jpg
|
|
193
|
+
- abst/yamane_powerpoint.pptx/Data/PresetImageFill4-5.jpg
|
|
194
|
+
- abst/yamane_powerpoint.pptx/Data/PresetImageFill5-6.jpg
|
|
195
|
+
- abst/yamane_powerpoint.pptx/Data/image1-12.png
|
|
196
|
+
- abst/yamane_powerpoint.pptx/Data/image1-9.png
|
|
197
|
+
- abst/yamane_powerpoint.pptx/Data/mt0@2x-13.jpg
|
|
198
|
+
- abst/yamane_powerpoint.pptx/Data/mt10@2x-22.jpg
|
|
199
|
+
- abst/yamane_powerpoint.pptx/Data/mt1@2x-14.jpg
|
|
200
|
+
- abst/yamane_powerpoint.pptx/Data/mt2@2x-15.jpg
|
|
201
|
+
- abst/yamane_powerpoint.pptx/Data/mt3@2x-16.jpg
|
|
202
|
+
- abst/yamane_powerpoint.pptx/Data/mt4@2x-17.png
|
|
203
|
+
- abst/yamane_powerpoint.pptx/Data/mt5@2x-18.jpg
|
|
204
|
+
- abst/yamane_powerpoint.pptx/Data/mt6@2x-19.jpg
|
|
205
|
+
- abst/yamane_powerpoint.pptx/Data/mt7@2x-20.png
|
|
206
|
+
- abst/yamane_powerpoint.pptx/Data/mt8@2x-21.jpg
|
|
207
|
+
- abst/yamane_powerpoint.pptx/Data/st0-23.jpg
|
|
208
|
+
- abst/yamane_powerpoint.pptx/Data/st1-24.jpg
|
|
209
|
+
- abst/yamane_powerpoint.pptx/Data/st2-25.jpg
|
|
210
|
+
- abst/yamane_powerpoint.pptx/Data/st3-26.jpg
|
|
211
|
+
- abst/yamane_powerpoint.pptx/Data/st4-276.jpg
|
|
212
|
+
- abst/yamane_powerpoint.pptx/Data/st5-279.jpg
|
|
213
|
+
- abst/yamane_powerpoint.pptx/Index.zip
|
|
214
|
+
- abst/yamane_powerpoint.pptx/Metadata/BuildVersionHistory.plist
|
|
215
|
+
- abst/yamane_powerpoint.pptx/Metadata/DocumentIdentifier
|
|
216
|
+
- abst/yamane_powerpoint.pptx/Metadata/Properties.plist
|
|
217
|
+
- abst/yamane_powerpoint.pptx/preview-micro.jpg
|
|
218
|
+
- abst/yamane_powerpoint.pptx/preview-web.jpg
|
|
219
|
+
- abst/yamane_powerpoint.pptx/preview.jpg
|
|
170
220
|
- bin/console
|
|
171
221
|
- bin/setup
|
|
172
222
|
- exe/hiki
|
|
@@ -184,6 +234,9 @@ files:
|
|
|
184
234
|
- lib/hikiutils/infodb.rb
|
|
185
235
|
- lib/hikiutils/tmarshal.rb
|
|
186
236
|
- lib/hikiutils/version.rb
|
|
237
|
+
- lib/templates/Rakefile_hiki_sync
|
|
238
|
+
- lib/templates/hik_help.yml
|
|
239
|
+
- lib/templates/hiki_help.yml
|
|
187
240
|
homepage: http://github.org/daddygongon/hikiutils
|
|
188
241
|
licenses:
|
|
189
242
|
- MIT
|