hikiutils 0.2.3.17 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Rakefile +76 -8
- data/exe/hiki +2 -3
- data/hikiutils.gemspec +1 -1
- data/lib/hikiutils.rb +9 -9
- data/lib/hikiutils/version.rb +1 -1
- data/lib/hikiutils_thor.rb +73 -61
- data/lib/templates/Rakefile_hiki_sync +96 -56
- data/{hikiutils_yamane/Rakefile → lib/templates/Rakefile_hiki_sync_new} +97 -57
- data/lib/templates/hiki_help.yml +48 -8
- metadata +6 -248
- data/abst/#testhiki# +0 -0
- data/abst/.DS_Store +0 -0
- data/abst/out2.pdf +0 -0
- data/abst/out3.aux +0 -15
- data/abst/out3.log +0 -193
- data/abst/out3.pdf +0 -0
- data/abst/out3.synctex.gz +0 -0
- data/abst/out3.tex +0 -106
- data/abst/out4.aux +0 -13
- data/abst/out4.log +0 -190
- data/abst/out4.pdf +0 -0
- data/abst/out4.synctex.gz +0 -0
- data/abst/out4.tex +0 -75
- data/abst/speed.png +0 -0
- data/abst/testhiki +0 -26
- data/abst/testhiki2 +0 -106
- data/abst/tmp.hiki +0 -14
- data/abst/tmp.html +0 -16
- data/abst/work.png +0 -0
- data/abst/yamane_abst.pdf +0 -0
- data/abst/yamane_abst.tex +0 -59
- data/abst/yamane_abst_new.pdf +0 -0
- data/abst/yamane_powerpoint.key +0 -0
- data/abst/yamane_powerpoint.pptx/.DS_Store +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 +0 -8
- data/abst/yamane_powerpoint.pptx/Metadata/DocumentIdentifier +0 -1
- 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/abst/yamane_powerpoint_new.key/Data/PresetImageFill0-1.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/PresetImageFill1-2.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/PresetImageFill2-3.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/PresetImageFill3-4.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/PresetImageFill4-5.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/PresetImageFill5-6.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/image1-12.png +0 -0
- data/abst/yamane_powerpoint_new.key/Data/image1-9.png +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt0@2x-13.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt10@2x-22.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt1@2x-14.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt2@2x-15.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt3@2x-16.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt4@2x-17.png +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt5@2x-18.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt6@2x-19.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt7@2x-20.png +0 -0
- data/abst/yamane_powerpoint_new.key/Data/mt8@2x-21.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/st0-381.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/st1-493.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/st2-495.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/st3-481.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/st4-485.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Data/st5-372.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/Index.zip +0 -0
- data/abst/yamane_powerpoint_new.key/Metadata/BuildVersionHistory.plist +0 -8
- data/abst/yamane_powerpoint_new.key/Metadata/DocumentIdentifier +0 -1
- data/abst/yamane_powerpoint_new.key/Metadata/Properties.plist +0 -0
- data/abst/yamane_powerpoint_new.key/preview-micro.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/preview-web.jpg +0 -0
- data/abst/yamane_powerpoint_new.key/preview.jpg +0 -0
- data/exe/hiki_thor +0 -5
- data/exe/hiki_thor~ +0 -8
- data/exe/hiki~ +0 -8
- data/hikis/README.hiki +0 -64
- data/hikis/README.hiki.html +0 -55
- data/hikis/README_ja.hiki +0 -67
- data/hikis/README_ja.hiki.html +0 -59
- data/hikis/yamane.hiki +0 -36
- data/hikiutils.wiki/Home.md +0 -68
- data/hikiutils.wiki/README.md +0 -65
- data/hikiutils.wiki/README_ja.md +0 -68
- data/hikiutils.wiki/yamane.md +0 -42
- data/hikiutils_bob/.gitignore +0 -1
- data/hikiutils_bob/Rakefile +0 -488
- data/hikiutils_bob/code.hiki +0 -31
- data/hikiutils_bob/figs/calphad_bob.pdf +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.001.bb +0 -5
- data/hikiutils_bob/figs/hikiutils_bob.001.jpeg +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.002.bb +0 -5
- data/hikiutils_bob/figs/hikiutils_bob.002.jpeg +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.003.jpeg +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.004.jpeg +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.005.jpeg +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.006.jpeg +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.007.jpeg +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.pdf +0 -0
- data/hikiutils_bob/figs/sync.pdf +0 -0
- data/hikiutils_bob/hiki_help.yml +0 -53
- data/hikiutils_bob/hikiutils_bob.graffle +0 -1195
- data/hikiutils_bob/hikiutils_bob.hiki +0 -6
- data/hikiutils_bob/hikiutils_bob.key +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.001.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.002.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.003.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.004.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.005.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.006.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.007.jpeg +0 -0
- data/hikiutils_bob/latex_all.hiki +0 -230
- data/hikiutils_bob/latex_dir/code.aux +0 -26
- data/hikiutils_bob/latex_dir/code.log +0 -28
- data/hikiutils_bob/latex_dir/code.tex +0 -39
- data/hikiutils_bob/latex_dir/head.tex +0 -10
- data/hikiutils_bob/latex_dir/hikiutils_bob.aux +0 -4
- data/hikiutils_bob/latex_dir/hikiutils_bob.log +0 -345
- data/hikiutils_bob/latex_dir/hikiutils_bob.pdf +0 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.synctex.gz +0 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.tex +0 -55
- data/hikiutils_bob/latex_dir/hikiutils_bob.toc +0 -41
- data/hikiutils_bob/latex_dir/jlisting.sty +0 -216
- data/hikiutils_bob/latex_dir/jlisting.tex +0 -216
- data/hikiutils_bob/latex_dir/latex2hiki.aux +0 -28
- data/hikiutils_bob/latex_dir/latex2hiki.tex +0 -43
- data/hikiutils_bob/latex_dir/latex_all.aux +0 -37
- data/hikiutils_bob/latex_dir/latex_all.log +0 -28
- data/hikiutils_bob/latex_dir/latex_all.tex +0 -249
- data/hikiutils_bob/latex_dir/pre.tex +0 -36
- data/hikiutils_bob/latex_dir/references.tex +0 -4
- data/hikiutils_bob/latex_dir/sync.aux +0 -54
- data/hikiutils_bob/latex_dir/sync.tex +0 -262
- data/hikiutils_bob/references.hiki +0 -3
- data/hikiutils_bob/sync.hiki +0 -220
- data/hikiutils_bob/tmp1.txt +0 -32
- data/hikiutils_bob/toc.hiki +0 -32
- data/hikiutils_yamane/.gitignore +0 -1
- data/hikiutils_yamane/abstract.hiki +0 -8
- data/hikiutils_yamane/backup/hikiutils%28optparse%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%29 +0 -309
- data/hikiutils_yamane/backup/hikiutils%28thor%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%29 +0 -1
- data/hikiutils_yamane/backup/hikiutils_yamane +0 -703
- data/hikiutils_yamane/backup/hikiutils_yamane.hiki +0 -0
- data/hikiutils_yamane/backup/hikiutils_yamane_#hikiutils_yamane +0 -1
- data/hikiutils_yamane/backup/hikiutils_yamane_command_table +0 -19
- data/hikiutils_yamane/backup/hikiutils_yamane_introduction +0 -7
- data/hikiutils_yamane/discussion.hiki +0 -9
- data/hikiutils_yamane/figs/hikiutils_yamane.001.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane.002.bb +0 -5
- data/hikiutils_yamane/figs/hikiutils_yamane.002.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane.003.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane.004.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane.005.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane.006.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane.007.jpg +0 -0
- data/hikiutils_yamane/hiki_help.yml +0 -53
- data/hikiutils_yamane/hikiutils_yamane.hiki +0 -23
- data/hikiutils_yamane/hikiutils_yamane.key/Data/110809_FamilyChineseOahu_EN_00317_2040x1360-small-12.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/110809_FamilyChineseOahu_EN_02016_981x654-small-14.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/110809_familychineseoahu_en_00317_2040x1360-96.jpeg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/110809_familychineseoahu_en_02016_981x654-97.jpeg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/110809_familychineseoahu_en_02390_2880x1921-94.jpeg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/110809_familychineseoahu_en_02390_2880x1921-small-95.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt0@2x-102.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt10@2x-112.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt1@2x-103.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt2@2x-104.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt3@2x-105.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt4@2x-106.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt5@2x-107.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt6@2x-108.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt7@2x-109.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt8@2x-110.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/mt9@2x-111.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/pasted-image-100.tiff +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/pasted-image-98.tiff +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/pasted-image-small-101.png +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/pasted-image-small-99.png +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/st0-113.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/st1-114.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/st2-115.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/st3-116.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/st4-117.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/st5-118.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/st6-119.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Data/tile_paper_medgray-93.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Index.zip +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/Metadata/BuildVersionHistory.plist +0 -8
- data/hikiutils_yamane/hikiutils_yamane.key/Metadata/DocumentIdentifier +0 -1
- data/hikiutils_yamane/hikiutils_yamane.key/Metadata/Properties.plist +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/preview-micro.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/preview-web.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.key/preview.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane/hikiutils_yamane.001.jpeg +0 -0
- data/hikiutils_yamane/hikiutils_yamane/hikiutils_yamane.002.jpeg +0 -0
- data/hikiutils_yamane/hikiutils_yamane/hikiutils_yamane.003.jpeg +0 -0
- data/hikiutils_yamane/hikiutils_yamane/hikiutils_yamane.004.jpeg +0 -0
- data/hikiutils_yamane/hikiutils_yamane/hikiutils_yamane.005.jpeg +0 -0
- data/hikiutils_yamane/hikiutils_yamane/hikiutils_yamane.006.jpeg +0 -0
- data/hikiutils_yamane/hikiutils_yamane/hikiutils_yamane.007.jpeg +0 -0
- data/hikiutils_yamane/introduction.hiki +0 -10
- data/hikiutils_yamane/latex_dir/abstract.aux +0 -22
- data/hikiutils_yamane/latex_dir/abstract.tex +0 -9
- data/hikiutils_yamane/latex_dir/discussion.aux +0 -22
- data/hikiutils_yamane/latex_dir/discussion.tex +0 -9
- data/hikiutils_yamane/latex_dir/head.tex +0 -10
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.aux +0 -10
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.log +0 -344
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.pdf +0 -0
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.synctex.gz +0 -0
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.tex +0 -62
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.toc +0 -31
- data/hikiutils_yamane/latex_dir/introduction.aux +0 -26
- data/hikiutils_yamane/latex_dir/introduction.tex +0 -12
- data/hikiutils_yamane/latex_dir/jlisting.sty +0 -216
- data/hikiutils_yamane/latex_dir/method.aux +0 -46
- data/hikiutils_yamane/latex_dir/method.tex +0 -253
- data/hikiutils_yamane/latex_dir/pre.tex +0 -36
- data/hikiutils_yamane/latex_dir/results.aux +0 -50
- data/hikiutils_yamane/latex_dir/results.tex +0 -257
- data/hikiutils_yamane/method.hiki +0 -238
- data/hikiutils_yamane/results.hiki +0 -228
- data/hikiutils_yamane/test.rb +0 -10
- data/hikiutils_yamane/toc.hiki +0 -19
- data/lib/hikiutils.rb~ +0 -389
- data/lib/hikiutils_thor.rb~ +0 -323
data/hikis/README_ja.hiki.html
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
<!DOCTYPE html
|
2
|
-
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
3
|
-
"http://www.w3.org/TR/html4/loose.dtd">
|
4
|
-
<html lang="ja">
|
5
|
-
<html>
|
6
|
-
<head>
|
7
|
-
<meta http-equiv="Content-Language" content="ja">
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
9
|
-
<title>README_ja.hiki</title>
|
10
|
-
</head>
|
11
|
-
<body>
|
12
|
-
<h1>hikiutils</h1>
|
13
|
-
<p>CMSソフトhikiのtextを直接編集するのを助けるutilitiesデス.</p>
|
14
|
-
<h1>Features</h1>
|
15
|
-
<p>hikiでlocalとglobalのサイトを管理している場合の,text, cache, rsyncなどでfilesを直接編集,操作するためのutilityデス.</p>
|
16
|
-
<h1>Operation</h1>
|
17
|
-
<p>"hiki" をコマンド名としています.</p>
|
18
|
-
<pre>Usage: hiki [options]
|
19
|
-
-v, --version show program Version.
|
20
|
-
-s, --show show sources
|
21
|
-
-a, --add add sources info
|
22
|
-
-t, --target VAL set target id
|
23
|
-
-e, --edit FILE open file
|
24
|
-
-l, --list [FILE] list files
|
25
|
-
-u, --update FILE update file
|
26
|
-
-r, --rsync rsync files
|
27
|
-
--database FILE read database file
|
28
|
-
--display FILE display converted hikifile
|
29
|
-
-c, --checkdb check database file
|
30
|
-
--remove FILE remove file
|
31
|
-
--move FILES move file1,file2
|
32
|
-
--euc FILE translate file to euc</pre>
|
33
|
-
<h2>Installation</h2>
|
34
|
-
<p>Installed by</p>
|
35
|
-
<pre>$ gem install hikimode</pre>
|
36
|
-
<p>At the first time of hiki operation, hikirc file is created at home dir.</p>
|
37
|
-
<pre>bob% cat ~/.hikirc
|
38
|
-
---
|
39
|
-
:target: 1
|
40
|
-
:editor_command: open -a mi
|
41
|
-
:browser: firefox
|
42
|
-
:srcs:
|
43
|
-
- :nick_name: hoge
|
44
|
-
:local_dir: hogehoge
|
45
|
-
:local_uri: http://localhost/~hoge
|
46
|
-
:global_dir: hoge@global_host:/hoge
|
47
|
-
:global_uri: http://hoge</pre>
|
48
|
-
<p>The directly editing of hikirc file is much easier than using -a option.
|
49
|
-
Each hiki utility option runs, assuming the editing files lacating locally.</p>
|
50
|
-
<p>Enjoy hiki world!!</p>
|
51
|
-
<h2>Development</h2>
|
52
|
-
<p>To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](<a href="https://rubygems.org).">https://rubygems.org).</a></p>
|
53
|
-
<h2>Contributing</h2>
|
54
|
-
<p>Bug reports and pull requests are welcome on <a href="GitHub">GitHub</a> at <a href="https://github.com/daddygongon/shunkuntype.">https://github.com/daddygongon/shunkuntype.</a> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.</p>
|
55
|
-
<h2>License</h2>
|
56
|
-
<p>The gem is available as open source under the terms of the [MIT License](<a href="http://opensource.org/licenses/MIT).">http://opensource.org/licenses/MIT).</a></p>
|
57
|
-
|
58
|
-
</body>
|
59
|
-
</html>
|
data/hikis/yamane.hiki
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
!目的
|
2
|
-
|
3
|
-
hikiutilsを直感的なオプションに替える
|
4
|
-
|
5
|
-
!背景
|
6
|
-
|
7
|
-
hikiutilsはhikiの編集を効率的に行うためのutilitiesを提供している.
|
8
|
-
しかし,そこで使われているoptionsは,あまり直感的でない.
|
9
|
-
そこで,optionsをshellで使われているコマンドを元に,より直感的なものに変更する.
|
10
|
-
|
11
|
-
!具体例
|
12
|
-
|
13
|
-
hiki --update FILE
|
14
|
-
は変更したファイルをhikiに反映させるコマンドです.この操作を
|
15
|
-
hiki touch FILE
|
16
|
-
とすると,FILEを最新の状態に変更するという意味で通じると思います.
|
17
|
-
|
18
|
-
!使用法
|
19
|
-
|
20
|
-
"hiki" をコマンド名としています.
|
21
|
-
|
22
|
-
Usage: hiki [options]
|
23
|
-
-v, --version show program Version.
|
24
|
-
-s, --show show sources
|
25
|
-
-a, --add add sources info
|
26
|
-
-t, --target VAL set target id
|
27
|
-
-e, --edit FILE open file
|
28
|
-
-l, --list [FILE] list files
|
29
|
-
-u, --update FILE update file
|
30
|
-
-r, --rsync rsync files
|
31
|
-
--database FILE read database file
|
32
|
-
--display FILE display converted hikifile
|
33
|
-
-c, --checkdb check database file
|
34
|
-
--remove FILE remove file
|
35
|
-
--move FILES move file1,file2
|
36
|
-
--euc FILE translate file to euc
|
data/hikiutils.wiki/Home.md
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
# hikiutils
|
2
|
-
CMSソフトhikiのtextを直接編集するのを助けるutilitiesデス.
|
3
|
-
|
4
|
-
# Features
|
5
|
-
hikiでlocalとglobalのサイトを管理している場合の,text, cache, rsyncなどでfilesを直接編集,操作するためのutilityデス.
|
6
|
-
|
7
|
-
# Operation
|
8
|
-
|
9
|
-
"hiki" をコマンド名としています.
|
10
|
-
|
11
|
-
```tcsh
|
12
|
-
Usage: hiki [options]
|
13
|
-
-v, --version show program Version.
|
14
|
-
-s, --show show sources
|
15
|
-
-a, --add add sources info
|
16
|
-
-t, --target VAL set target id
|
17
|
-
-e, --edit FILE open file
|
18
|
-
-l, --list [FILE] list files
|
19
|
-
-u, --update FILE update file
|
20
|
-
-r, --rsync rsync files
|
21
|
-
--database FILE read database file
|
22
|
-
--display FILE display converted hikifile
|
23
|
-
-c, --checkdb check database file
|
24
|
-
--remove FILE remove file
|
25
|
-
--move FILES move file1,file2
|
26
|
-
--euc FILE translate file to euc
|
27
|
-
```
|
28
|
-
|
29
|
-
## Installation
|
30
|
-
Installed by
|
31
|
-
|
32
|
-
```
|
33
|
-
$ gem install hikimode
|
34
|
-
```
|
35
|
-
|
36
|
-
At the first time of hiki operation, hikirc file is created at home dir.
|
37
|
-
|
38
|
-
```
|
39
|
-
bob% cat ~/.hikirc
|
40
|
-
---
|
41
|
-
:target: 1
|
42
|
-
:editor_command: open -a mi
|
43
|
-
:browser: firefox
|
44
|
-
:srcs:
|
45
|
-
- :nick_name: hoge
|
46
|
-
:local_dir: hogehoge
|
47
|
-
:local_uri: http://localhost/~hoge
|
48
|
-
:global_dir: hoge@global_host:/hoge
|
49
|
-
:global_uri: http://hoge
|
50
|
-
```
|
51
|
-
|
52
|
-
The directly editing of hikirc file is much easier than using -a option.
|
53
|
-
Each hiki utility option runs, assuming the editing files lacating locally.
|
54
|
-
|
55
|
-
Enjoy hiki world!!
|
56
|
-
|
57
|
-
## Development
|
58
|
-
|
59
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
60
|
-
|
61
|
-
## Contributing
|
62
|
-
|
63
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/daddygongon/shunkuntype. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
64
|
-
|
65
|
-
|
66
|
-
## License
|
67
|
-
|
68
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/hikiutils.wiki/README.md
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
# hikiutils
|
2
|
-
Utilities for helping hiki editing.
|
3
|
-
|
4
|
-
# Discriptions
|
5
|
-
Direct file handling utility for hiki text and cache,
|
6
|
-
and rsync between local and global hiki sites.
|
7
|
-
|
8
|
-
|
9
|
-
# Operation
|
10
|
-
"hiki" is the command name.
|
11
|
-
|
12
|
-
```tcsh
|
13
|
-
bob% hiki
|
14
|
-
hiki says 'Hello world'.
|
15
|
-
Usage: hiki [options]
|
16
|
-
-v, --version show program Version.
|
17
|
-
-s, --show show sources
|
18
|
-
-a, --add add sources info
|
19
|
-
-t, --target [VAL] set target number
|
20
|
-
-o, --open [FILE] open file
|
21
|
-
-l, --list [FILE] list files
|
22
|
-
-u, --update [FILE] update file
|
23
|
-
-r, --rsync rsync files
|
24
|
-
```
|
25
|
-
|
26
|
-
## Installation
|
27
|
-
|
28
|
-
Installed by
|
29
|
-
|
30
|
-
```
|
31
|
-
$ gem install hikimode
|
32
|
-
```
|
33
|
-
|
34
|
-
At the first time of hiki operation, hikirc file is created at home dir.
|
35
|
-
|
36
|
-
```
|
37
|
-
bob% cat ~/.hikirc
|
38
|
-
---
|
39
|
-
:target: 0
|
40
|
-
:editor_command: emacs
|
41
|
-
:srcs:
|
42
|
-
- :nick_name: hoge
|
43
|
-
:local_dir: hogehoge
|
44
|
-
:local_uri: http://localhost/~hoge
|
45
|
-
:global_dir: hoge@global_host:/hoge
|
46
|
-
:global_uri: http://hoge
|
47
|
-
```
|
48
|
-
|
49
|
-
The directly editing of hikirc file is much easier than using -a option.
|
50
|
-
Each hiki utility option runs, assuming the editing files lacating locally.
|
51
|
-
|
52
|
-
Enjoy hiki world!!
|
53
|
-
|
54
|
-
## Development
|
55
|
-
|
56
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
57
|
-
|
58
|
-
## Contributing
|
59
|
-
|
60
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/daddygongon/shunkuntype. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
61
|
-
|
62
|
-
|
63
|
-
## License
|
64
|
-
|
65
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/hikiutils.wiki/README_ja.md
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
# hikiutils
|
2
|
-
CMSソフトhikiのtextを直接編集するのを助けるutilitiesデス.
|
3
|
-
|
4
|
-
# Features
|
5
|
-
hikiでlocalとglobalのサイトを管理している場合の,text, cache, rsyncなどでfilesを直接編集,操作するためのutilityデス.
|
6
|
-
|
7
|
-
# Operation
|
8
|
-
|
9
|
-
"hiki" をコマンド名としています.
|
10
|
-
|
11
|
-
```tcsh
|
12
|
-
Usage: hiki [options]
|
13
|
-
-v, --version show program Version.
|
14
|
-
-s, --show show sources
|
15
|
-
-a, --add add sources info
|
16
|
-
-t, --target VAL set target id
|
17
|
-
-e, --edit FILE open file
|
18
|
-
-l, --list [FILE] list files
|
19
|
-
-u, --update FILE update file
|
20
|
-
-r, --rsync rsync files
|
21
|
-
--database FILE read database file
|
22
|
-
--display FILE display converted hikifile
|
23
|
-
-c, --checkdb check database file
|
24
|
-
--remove FILE remove file
|
25
|
-
--move FILES move file1,file2
|
26
|
-
--euc FILE translate file to euc
|
27
|
-
```
|
28
|
-
|
29
|
-
## Installation
|
30
|
-
Installed by
|
31
|
-
|
32
|
-
```
|
33
|
-
$ gem install hikimode
|
34
|
-
```
|
35
|
-
|
36
|
-
At the first time of hiki operation, hikirc file is created at home dir.
|
37
|
-
|
38
|
-
```
|
39
|
-
bob% cat ~/.hikirc
|
40
|
-
---
|
41
|
-
:target: 1
|
42
|
-
:editor_command: open -a mi
|
43
|
-
:browser: firefox
|
44
|
-
:srcs:
|
45
|
-
- :nick_name: hoge
|
46
|
-
:local_dir: hogehoge
|
47
|
-
:local_uri: http://localhost/~hoge
|
48
|
-
:global_dir: hoge@global_host:/hoge
|
49
|
-
:global_uri: http://hoge
|
50
|
-
```
|
51
|
-
|
52
|
-
The directly editing of hikirc file is much easier than using -a option.
|
53
|
-
Each hiki utility option runs, assuming the editing files lacating locally.
|
54
|
-
|
55
|
-
Enjoy hiki world!!
|
56
|
-
|
57
|
-
## Development
|
58
|
-
|
59
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
60
|
-
|
61
|
-
## Contributing
|
62
|
-
|
63
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/daddygongon/shunkuntype. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
64
|
-
|
65
|
-
|
66
|
-
## License
|
67
|
-
|
68
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/hikiutils.wiki/yamane.md
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
# 目的
|
2
|
-
|
3
|
-
hikiutilsを直感的なオプションに替える
|
4
|
-
|
5
|
-
# 背景
|
6
|
-
|
7
|
-
hikiutilsはhikiの編集を効率的に行うためのutilitiesを提供している.
|
8
|
-
しかし,そこで使われているoptionsは,あまり直感的でない.
|
9
|
-
そこで,optionsをshellで使われているコマンドを元に,より直感的なものに変更する.
|
10
|
-
|
11
|
-
# 具体例
|
12
|
-
|
13
|
-
```
|
14
|
-
hiki --update FILE
|
15
|
-
```
|
16
|
-
は変更したファイルをhikiに反映させるコマンドです.この操作を
|
17
|
-
```
|
18
|
-
hiki touch FILE
|
19
|
-
```
|
20
|
-
とすると,FILEを最新の状態に変更するという意味で通じると思います.
|
21
|
-
|
22
|
-
# 使用法
|
23
|
-
|
24
|
-
"hiki" をコマンド名としています.
|
25
|
-
|
26
|
-
Usage: hiki [options]
|
27
|
-
```
|
28
|
-
-v, --version show program Version.
|
29
|
-
-s, --show show sources
|
30
|
-
-a, --add add sources info
|
31
|
-
-t, --target VAL set target id
|
32
|
-
-e, --edit FILE open file
|
33
|
-
-l, --list [FILE] list files
|
34
|
-
-u, --update FILE update file
|
35
|
-
-r, --rsync rsync files
|
36
|
-
--database FILE read database file
|
37
|
-
--display FILE display converted hikifile
|
38
|
-
-c, --checkdb check database file
|
39
|
-
--remove FILE remove file
|
40
|
-
--move FILES move file1,file2
|
41
|
-
--euc FILE translate file to euc
|
42
|
-
```
|
data/hikiutils_bob/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
.hikirc
|
data/hikiutils_bob/Rakefile
DELETED
@@ -1,488 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require 'systemu'
|
3
|
-
require 'tempfile'
|
4
|
-
require 'colorize'
|
5
|
-
require 'coderay'
|
6
|
-
|
7
|
-
# -*- coding: utf-8 -*-
|
8
|
-
begin
|
9
|
-
$hiki_dir = File.readlines('./.hikirc')[0].chomp
|
10
|
-
rescue => e
|
11
|
-
puts e
|
12
|
-
exit
|
13
|
-
end
|
14
|
-
dirnames=Dir.pwd.split('/')
|
15
|
-
$basename = (dirnames[-1]=='hikis')? dirnames[-2] : dirnames[-1]
|
16
|
-
$latex_dir= 'latex_dir'
|
17
|
-
$section_layer = {}
|
18
|
-
|
19
|
-
task :default do
|
20
|
-
system 'rake -T'
|
21
|
-
end
|
22
|
-
|
23
|
-
desc "Githubのdirをsafariでopen"
|
24
|
-
task :github do
|
25
|
-
status, stdout, stderr = systemu %q( git remote -v |grep origin )
|
26
|
-
github_dir=stdout.match(/(.+):(.+) \(push\)/)[2]
|
27
|
-
puts github_dir.blue
|
28
|
-
system "open https://github.com/#{github_dir}"
|
29
|
-
end
|
30
|
-
|
31
|
-
desc "hikiシステムにあるゴミファイルを掃除する"
|
32
|
-
task :reset_hiki do
|
33
|
-
status, stdout, stderr = systemu "hiki -l #{$basename}"
|
34
|
-
print stdout
|
35
|
-
files=[]
|
36
|
-
stdout.split("\n").each{|line|
|
37
|
-
files << line.split(/\s+/)[-1]
|
38
|
-
}
|
39
|
-
r_files = files.reverse[0..-4]
|
40
|
-
r_files.each{|file|
|
41
|
-
print "remove #{file}[ynqlA]? ".red
|
42
|
-
input=STDIN.gets.chomp
|
43
|
-
case input
|
44
|
-
when 'y'
|
45
|
-
p command="hiki --remove #{file}"
|
46
|
-
system command
|
47
|
-
when 'n'
|
48
|
-
when 'l'
|
49
|
-
p command="hiki -l #{$basename}"
|
50
|
-
system command
|
51
|
-
when 'q'
|
52
|
-
exit
|
53
|
-
when 'A'
|
54
|
-
print "\nAre you sure[Yn]? ".magenta
|
55
|
-
input2 = STDIN.gets.chomp
|
56
|
-
case input2
|
57
|
-
when 'Y'
|
58
|
-
r_files.each{|file| system "hiki --remove #{file}"}
|
59
|
-
p target = File.join($hiki_dir,'cache','attach',$basename)
|
60
|
-
exit
|
61
|
-
when 'n'
|
62
|
-
exit
|
63
|
-
end
|
64
|
-
end
|
65
|
-
}
|
66
|
-
end
|
67
|
-
|
68
|
-
desc "latex_dirのゴミを掃除"
|
69
|
-
task :reset_latex_dir do
|
70
|
-
system "mv latex_dir/head.tex ."
|
71
|
-
system "mv latex_dir/jlisting.sty ."
|
72
|
-
system "rm -rf latex_dir"
|
73
|
-
system "mkdir latex_dir"
|
74
|
-
system "mv head.tex latex_dir/"
|
75
|
-
system "mv jlisting.sty latex_dir/"
|
76
|
-
system "rake latex_all"
|
77
|
-
end
|
78
|
-
|
79
|
-
desc "toc.hikiの作成"
|
80
|
-
task :mk_toc do
|
81
|
-
p target = $basename+'.toc'
|
82
|
-
cont=""
|
83
|
-
File.readlines(File.join('latex_dir',target)).each{|line|
|
84
|
-
if m=line.match(/\\contentsline \{(.+)\}\{\\numberline \{([\d|\.]+)\}(.+)\}\{\d+\}/)
|
85
|
-
layer,sec_no,title=m[1],m[2],m[3]
|
86
|
-
d = case m[1]
|
87
|
-
when 'section'; 1
|
88
|
-
when 'subsection'; 2
|
89
|
-
when 'subsubsection'; 3
|
90
|
-
else; 4
|
91
|
-
end
|
92
|
-
layer = "!"*d
|
93
|
-
title.gsub!('\_','_')
|
94
|
-
cont << "#{layer}#{sec_no}:#{title}\n"
|
95
|
-
end
|
96
|
-
}
|
97
|
-
print cont
|
98
|
-
File.open("toc.hiki",'w'){|file| file.print cont}
|
99
|
-
end
|
100
|
-
|
101
|
-
desc "FILE.hikiあるいはhikiファイルすべてを最新状態に更新"
|
102
|
-
task :touch do
|
103
|
-
if file=ARGV[1]
|
104
|
-
file_split=file.split(".")
|
105
|
-
p target = $basename==file_split[0] ? $basename : $basename+"_"+file_split[0]
|
106
|
-
system "hiki -u #{target}"
|
107
|
-
else
|
108
|
-
p target = File.join($hiki_dir,'cache','attach',$basename)
|
109
|
-
system "touch #{target}/*"
|
110
|
-
Dir.entries('.').each{|file|
|
111
|
-
file_split=file.split(".")
|
112
|
-
if file_split[1]=='hiki'
|
113
|
-
p target = $basename==file_split[0] ? $basename : $basename+"_"+file_split[0]
|
114
|
-
system "hiki -u #{target}"
|
115
|
-
end
|
116
|
-
}
|
117
|
-
end
|
118
|
-
exit
|
119
|
-
end
|
120
|
-
|
121
|
-
desc "FILE.hikiあるいはhikiファイルをedtiorで開く"
|
122
|
-
task :open do
|
123
|
-
if file=ARGV[1]
|
124
|
-
system "open -a mi #{file}"
|
125
|
-
else
|
126
|
-
Dir.entries('.').each{|file|
|
127
|
-
file_split=file.split(".")
|
128
|
-
if file_split[1]=='hiki'
|
129
|
-
p target = file_split[0]
|
130
|
-
system "open -a mi #{target}"
|
131
|
-
end
|
132
|
-
}
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
desc "FILE1をlatexに変換"
|
137
|
-
task :latex => [:latex_base] do
|
138
|
-
exit
|
139
|
-
end
|
140
|
-
|
141
|
-
desc "FILE1をwrap formatでlatexに変換"
|
142
|
-
task :latex_wrap => [:latex_base, :change_wrap] do
|
143
|
-
exit
|
144
|
-
end
|
145
|
-
|
146
|
-
def latex_loop(entries,opts={})
|
147
|
-
check_bounding_box
|
148
|
-
main_file=""
|
149
|
-
entries.each{|file|
|
150
|
-
options={:latex_all=>true}
|
151
|
-
next unless file.split('.')[1]=='hiki'
|
152
|
-
next if file=='toc.hiki'
|
153
|
-
next if file.include?('.hikirc')
|
154
|
-
f_name =File.basename(file,'.hiki')
|
155
|
-
if opts[:main]
|
156
|
-
if f_name==$basename
|
157
|
-
options[:latex]="--listings --head latex_dir/head.tex -p "
|
158
|
-
options[:main]=true
|
159
|
-
main_file=f_name
|
160
|
-
convert_to_latex(file, options)
|
161
|
-
end
|
162
|
-
else
|
163
|
-
if f_name!=$basename
|
164
|
-
p level = $section_layer[f_name] || 1
|
165
|
-
options[:latex]="-l #{level} --listings -b "
|
166
|
-
convert_to_latex(file, options)
|
167
|
-
end
|
168
|
-
end
|
169
|
-
}
|
170
|
-
return main_file
|
171
|
-
end
|
172
|
-
|
173
|
-
def check_section_layers(lines)
|
174
|
-
p reg_exp = Regexp.new("#{$basename}_(.+)")
|
175
|
-
lines.each{|line|
|
176
|
-
p line
|
177
|
-
if m=line.match(/(!+)\[\[(.+)\]\]/)
|
178
|
-
p count = m[1].count('!')
|
179
|
-
p file_name=m[2].match(reg_exp)[1]
|
180
|
-
$section_layer[file_name]=count
|
181
|
-
end
|
182
|
-
}
|
183
|
-
p $section_layer
|
184
|
-
end
|
185
|
-
|
186
|
-
def check_bounding_box
|
187
|
-
# $bounding_box="0 0 442 432"
|
188
|
-
$bounding_box=" 0 0 737 553"
|
189
|
-
end
|
190
|
-
|
191
|
-
desc "すべてのhikiファイルをlatex変換"
|
192
|
-
task :latex_all do
|
193
|
-
p entries=Dir.entries('.')
|
194
|
-
main_file = latex_loop(entries,opts={:main=>true})
|
195
|
-
latex_loop(entries)
|
196
|
-
cont=""
|
197
|
-
p reg_exp = Regexp.new("#{$basename}_(.+)")
|
198
|
-
toc = false
|
199
|
-
File.readlines(File.join($latex_dir,"#{main_file}.tex")).each{|line|
|
200
|
-
# line, toc = "", true if line.match(/\\tableofcontents/) and toc == true #only one
|
201
|
-
if line.match(/\\tableofcontents/)
|
202
|
-
if toc == false #only one
|
203
|
-
toc = true
|
204
|
-
else
|
205
|
-
line = ''
|
206
|
-
end
|
207
|
-
end
|
208
|
-
line ="\\usepackage{listings,jlisting}" if line.match(/\\usepackage{listings}/)
|
209
|
-
if line.match(/section{(.+)}/)
|
210
|
-
if m=line.match(/\\verb\|(.+)\((.+)\)\|/)
|
211
|
-
p m
|
212
|
-
p m_t=m[2].match(reg_exp)[1]
|
213
|
-
line = "\\include{#{m_t}}\n"
|
214
|
-
elsif m=line.match(/section{\\verb\|(.+)\|}/)
|
215
|
-
p m
|
216
|
-
p m_t=m[1].match(reg_exp)[1]
|
217
|
-
line = "\\include{#{m_t}}\n"
|
218
|
-
else
|
219
|
-
# line = ""
|
220
|
-
end
|
221
|
-
end
|
222
|
-
cont << line
|
223
|
-
}
|
224
|
-
File.open(File.join($latex_dir,"#{main_file}.tex"),'w'){|file| file.print cont}
|
225
|
-
system "open latex_dir/#{main_file}.tex"
|
226
|
-
exit
|
227
|
-
end
|
228
|
-
|
229
|
-
task :latex_base do
|
230
|
-
check_bounding_box
|
231
|
-
Dir.mkdir($latex_dir) unless Dir.exist?($latex_dir)
|
232
|
-
convert_to_latex(ARGV[1])
|
233
|
-
system("open #{$save_name}")
|
234
|
-
end
|
235
|
-
|
236
|
-
def convert_to_latex(file_name, options={})
|
237
|
-
p file_name = file_name.include?('.hiki')? file_name : file_name+'.hiki'
|
238
|
-
p tex_name = File.basename(file_name,'.hiki')+'.tex'
|
239
|
-
p $save_name = ARGV[2] || File.join($latex_dir,tex_name)
|
240
|
-
pre_name = File.join($latex_dir,'pre.tex')
|
241
|
-
p pre_command = File.exist?(pre_name) ? '--pre '+pre_name : nil
|
242
|
-
lines = File.readlines(file_name)
|
243
|
-
check_section_layers(lines) if options[:main]
|
244
|
-
cont = ""
|
245
|
-
lines.each_with_index{|line,i|
|
246
|
-
if m=line.match(/\{\{attach_view\((.*),(.*)\)\}\}/)
|
247
|
-
p line="\{\{attach_view\(#{m[1]}\)\}\}\n"
|
248
|
-
elsif options[:latex_all] and i<5
|
249
|
-
line="" if line.match(/^!title:|^!author:|^!date:/)
|
250
|
-
end
|
251
|
-
cont << line
|
252
|
-
}
|
253
|
-
tf1,tf2='tmp1.txt','tmp2.txt'
|
254
|
-
File.open(tf1,'w'){|file| file.print cont}
|
255
|
-
system "hiki2latex #{pre_command} #{options[:latex]} #{tf1} > #{tf2}"
|
256
|
-
lines = File.readlines(tf2)
|
257
|
-
system "rm #{tf1} #{tf2}"
|
258
|
-
in_bib,cont=false,""
|
259
|
-
lines.each{|line|
|
260
|
-
line=latex_cite_ref(line)
|
261
|
-
if m=line.match(/\\caption{\s*\((.+?)\)(.+)}/)
|
262
|
-
p m
|
263
|
-
puts line = "\\caption{#{m[2]}}\n\\label{#{m[1]}}\n"
|
264
|
-
end
|
265
|
-
if m=line.match(/\\section{reference:}(.+)/) and in_bib==false
|
266
|
-
in_bib=true
|
267
|
-
line = "\\begin{thebibliography}{99}\n"
|
268
|
-
puts line.blue
|
269
|
-
end
|
270
|
-
if m=line.match(/\\end{description}/) and in_bib==true
|
271
|
-
in_bib=false
|
272
|
-
line = "\\end{thebibliography}\n"
|
273
|
-
end
|
274
|
-
if m=line.match(/\\item\[(.+)\](.+)/) and in_bib==true
|
275
|
-
line ="\\bibitem{#{m[1]}} #{m[2]}"
|
276
|
-
end
|
277
|
-
if m=line.match(/\\includegraphics\[width=6cm\]\{(.+)\}/)
|
278
|
-
p line="\\includegraphics\[width=10cm,bb=#{$bounding_box}\]\{../figs/#{m[1]}\}\n"
|
279
|
-
cont << line
|
280
|
-
else
|
281
|
-
cont << line
|
282
|
-
end
|
283
|
-
}
|
284
|
-
File.open($save_name,'w'){|file| file.print cont }
|
285
|
-
end
|
286
|
-
|
287
|
-
def latex_cite_ref(line)
|
288
|
-
r_pair=[/\\verb\|{{cite\((.+?)\)}}\|/,/\\verb\|{{ref\((.+?)\)}}\|/]
|
289
|
-
while m=line.match(r_pair[0])
|
290
|
-
line.sub!(r_pair[0],"\\cite\{#{m[1]}\}")
|
291
|
-
end
|
292
|
-
while m=line.match(r_pair[1])
|
293
|
-
line.sub!(r_pair[1],"\\ref\{#{m[1]}\}")
|
294
|
-
end
|
295
|
-
# puts line.chomp.blue
|
296
|
-
return line
|
297
|
-
end
|
298
|
-
|
299
|
-
task :change_wrap do
|
300
|
-
lines = File.readlines($save_name)
|
301
|
-
|
302
|
-
cont = ""
|
303
|
-
lines.each{|line|
|
304
|
-
if line.include?('\begin{figure}[htbp]\begin{center}')
|
305
|
-
p line
|
306
|
-
cont << '\begin{wrapfigure}{r}{8cm}'+"\n"
|
307
|
-
cont << '\vspace{-2\baselineskip}'+"\n"
|
308
|
-
cont << '\begin{center}'+"\n"
|
309
|
-
elsif line.include?('\label{default}\end{center}\end{figure}')
|
310
|
-
p line
|
311
|
-
cont << '\end{center}'+"\n"
|
312
|
-
cont << '\vspace{2\baselineskip}'+"\n"
|
313
|
-
cont << '\end{wrapfigure}'+"\n"
|
314
|
-
else
|
315
|
-
cont << line
|
316
|
-
end
|
317
|
-
}
|
318
|
-
File.open($save_name,'w'){|file| file.print cont }
|
319
|
-
|
320
|
-
system("open #{$save_name}")
|
321
|
-
exit
|
322
|
-
end
|
323
|
-
|
324
|
-
|
325
|
-
desc "increment fig NUBERS in FILE"
|
326
|
-
task :increment do
|
327
|
-
number=ARGV[1]
|
328
|
-
file = ARGV[2]
|
329
|
-
dir = ARGV[3] || nil
|
330
|
-
lines = File.readlines(file)
|
331
|
-
cont = ""
|
332
|
-
lines.each{|line|
|
333
|
-
if m=line.match(/\{\{attach_view\((\w+|_).(\d+).jpeg\)\}\}/)
|
334
|
-
new_num=sprintf("%03d",m[2].to_i+number.to_i)
|
335
|
-
line="\{\{attach_view\(#{m[1]}.#{new_num}.jpeg,#{dir}\)\}\}\n"
|
336
|
-
cont << line
|
337
|
-
else
|
338
|
-
cont << line
|
339
|
-
end
|
340
|
-
}
|
341
|
-
print cont
|
342
|
-
exit
|
343
|
-
end
|
344
|
-
|
345
|
-
desc "numbering figs from the NUBER in FILE"
|
346
|
-
task :number do
|
347
|
-
number=ARGV[1].to_i
|
348
|
-
file = ARGV[2]
|
349
|
-
dir = ARGV[3] || nil
|
350
|
-
lines = File.readlines(file)
|
351
|
-
cont = ""
|
352
|
-
lines.each{|line|
|
353
|
-
if m=line.match(/\{\{attach_view\((\w+|_).(\d+).jpeg,(\w+)\)\}\}/)
|
354
|
-
new_num=sprintf("%03d",number)
|
355
|
-
line="\{\{attach_view\(#{m[1]}.#{new_num}.jpeg,#{m[3]}\)\}\}\n"
|
356
|
-
cont << line
|
357
|
-
number += 1
|
358
|
-
else
|
359
|
-
cont << line
|
360
|
-
end
|
361
|
-
}
|
362
|
-
print cont
|
363
|
-
exit
|
364
|
-
end
|
365
|
-
|
366
|
-
desc "convert fig size SCALE TARGET_DIR"
|
367
|
-
task :convert do
|
368
|
-
scale = ARGV[1]
|
369
|
-
target_dir=ARGV[2]
|
370
|
-
Dir.entries(target_dir)[2..-1].each{|file|
|
371
|
-
p file
|
372
|
-
source = File.join(target_dir,file)
|
373
|
-
target = File.join('figs',file)
|
374
|
-
p command = "convert #{source} -resize #{scale}\% #{target}"
|
375
|
-
system command
|
376
|
-
}
|
377
|
-
exit
|
378
|
-
end
|
379
|
-
|
380
|
-
desc "hikiの同期"
|
381
|
-
task :sync => [:check_previous,:sync0]
|
382
|
-
|
383
|
-
|
384
|
-
desc "hikiの強制同期"
|
385
|
-
task :force_sync => [:sync0]
|
386
|
-
|
387
|
-
def hiki_cite_ref(file)
|
388
|
-
tf1 = 'tmp1.txt'
|
389
|
-
lines = File.readlines(file)
|
390
|
-
inside_pre_form,cont = false,""
|
391
|
-
lines.each{|line|
|
392
|
-
inside_pre_form=true if line.match(/^<<</) and !inside_pre_form
|
393
|
-
inside_pre_form=false if line.match(/^>>>/) and inside_pre_form
|
394
|
-
tr_pair=[/\{\{cite\((.+?)\)\}\}/,/\{\{ref\((.+)\)\}\}/]
|
395
|
-
while m=line.match(tr_pair[0]) and !inside_pre_form
|
396
|
-
puts line.sub!(tr_pair[0], "\[[[#{m[1]}|#{$basename}_references]]\]").chomp.green
|
397
|
-
end
|
398
|
-
while m=line.match(tr_pair[1]) and !inside_pre_form
|
399
|
-
puts line.sub!(tr_pair[1],"#{m[1]}").chomp.green
|
400
|
-
end
|
401
|
-
cont << line
|
402
|
-
}
|
403
|
-
File.open(tf1,'w'){|file| file.print cont }
|
404
|
-
return tf1
|
405
|
-
end
|
406
|
-
|
407
|
-
task :sync0 do
|
408
|
-
entries=Dir.entries('.')
|
409
|
-
entries[2..-1].each{|source| #cp *.hiki
|
410
|
-
next unless source.split('.')[1]=='hiki'
|
411
|
-
next if source.include?('.hikirc')
|
412
|
-
p base = source.split('.')[0]
|
413
|
-
name = (base==$basename)? base : $basename+'_'+base
|
414
|
-
p target = File.join($hiki_dir,'text',name)
|
415
|
-
source = hiki_cite_ref(source)
|
416
|
-
FileUtils.cp(source,target,:verbose=>true)
|
417
|
-
}
|
418
|
-
p entries=Dir.entries('./figs') #cp files in figs
|
419
|
-
p target = File.join($hiki_dir,'cache','attach',$basename)
|
420
|
-
FileUtils.mkdir_p(target,:verbose=>true) unless File.exists?(target)
|
421
|
-
entries[2..-1].each{|file|
|
422
|
-
p source = File.join('./figs',file)
|
423
|
-
FileUtils.cp(source,target,:verbose=>true)
|
424
|
-
}
|
425
|
-
|
426
|
-
File.open('./.hikirc','w'){|file|
|
427
|
-
status, stdout, stderr =systemu "hiki -l #{$basename}*"
|
428
|
-
file.print($hiki_dir+"\n")
|
429
|
-
stdout.split("\n")[3..-1].each{|line|
|
430
|
-
file.print line+"\n"
|
431
|
-
}
|
432
|
-
}
|
433
|
-
exit
|
434
|
-
end
|
435
|
-
|
436
|
-
desc "For hiki Errno::ENOENT, Errno::EACCES"
|
437
|
-
task :chenv do
|
438
|
-
p user = ENV['USER']
|
439
|
-
system("sudo chmod -R a+w #{$hiki_dir}")
|
440
|
-
# system("sudo chown -R #{user} #{$hiki_dir}")
|
441
|
-
end
|
442
|
-
|
443
|
-
desc "self copy to hikiutils template directory"
|
444
|
-
task :self_copy do
|
445
|
-
p cp_files=[[File.join(Dir.pwd,'Rakefile'),'Rakefile_hiki_sync'],
|
446
|
-
[File.join(ENV['HOME'],'.my_help','hiki_help.yml'),'hiki_help.yml']]
|
447
|
-
cp_files.each{|files|
|
448
|
-
p source = files[0]
|
449
|
-
p target = File.join('/Users/bob/Github/hikiutils/lib/templates/',files[1])
|
450
|
-
command = "diff #{source} #{target}"
|
451
|
-
status, stdout, stderr=systemu command
|
452
|
-
if stdout!=''
|
453
|
-
puts command.red
|
454
|
-
puts CodeRay.scan(stdout, :Diff).term
|
455
|
-
print " Are you sure to save #{source}? [Yn] ".red
|
456
|
-
FileUtils.cp(source,target,:verbose=>true) if STDIN.gets.chomp=='Y'
|
457
|
-
end
|
458
|
-
}
|
459
|
-
end
|
460
|
-
|
461
|
-
task :check_previous do
|
462
|
-
current={}
|
463
|
-
print "current hiki dir\n"
|
464
|
-
status, stdout, stderr = systemu("hiki -l #{$basename}*")
|
465
|
-
stdout.split("\n")[3..-1].each{|line|
|
466
|
-
p line
|
467
|
-
file= line.split(/\s+/)[-1]
|
468
|
-
current[file]=line
|
469
|
-
}
|
470
|
-
previous={}
|
471
|
-
print "previous sync\n"
|
472
|
-
File.readlines('.hikirc')[1..-1].each{|line|
|
473
|
-
p line.chomp
|
474
|
-
file= line.split(/\s+/)[-1]
|
475
|
-
previous[file]=line.chomp
|
476
|
-
}
|
477
|
-
changed = []
|
478
|
-
current.each_pair{|key,val|
|
479
|
-
if !previous.include?(key) or previous[key]!=val
|
480
|
-
changed << val+"\n"
|
481
|
-
end
|
482
|
-
}
|
483
|
-
if changed.size != 0
|
484
|
-
print("hiki dirで変更が発生しています.\n")
|
485
|
-
changed.each{|line| print line+"\n"}
|
486
|
-
exit
|
487
|
-
end
|
488
|
-
end
|