madowu 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3caa7db7adf2f71986d61b394cfed755b9e7bf8
4
- data.tar.gz: 3d92c808e7a437ec6e6002c84de71e4eebf205ce
3
+ metadata.gz: 6e83aaa529b422a787293cf3cc842b321c7fe6ec
4
+ data.tar.gz: 3d7f864e87f1da8d1560917ac9bb09d7e7378347
5
5
  SHA512:
6
- metadata.gz: 951ddcc593d512e5494804a424b7fd1c1247d529db51bad07a8f514eb622237dc3985aa4a7efd043b9e7d43bef4a85146a54b04b47acb079e8434b91752ba297
7
- data.tar.gz: 9604056e05272c4fdc943a1cede76b53107604b572265b50a58d2b3dde76b2210b0d0e414916b133f619377e9a41285074ebfd86eedc380827edfed7cbe2dc0c
6
+ metadata.gz: 8a77ff4a46b30976dfc1bb98b9889b651f9c9f2ddad8b64688e64598dfc9e1c4639463d74756133091cb4f5fbf6bcba1aac17fe96decb59d3bf510efc1fd9406
7
+ data.tar.gz: 5ce5c291810593ed8ae942e66d62287d61951b7297af03758740d3735459c2bd4298e11f9cc256e9d563897c1746620ae202a69f353cec61d6b4dbbd8089baf3
data/CHANGES CHANGED
@@ -1,6 +1,12 @@
1
1
  = THIS_GEM changelog
2
2
 
3
- == Master (for 0.0.4)
3
+ == Master (for 0.0.5)
4
+
5
+ == Version 0.0.4 [2016-04-23]
6
+ * bin/urltitle was added
7
+ * bin/isbninfo was added
8
+ * 'madowu --outline' was adjusted to pandoc style md file
9
+ * bin/dirmap changed to find only *.html, ignore else.
4
10
 
5
11
  == Version 0.0.3 [2016-02-26]
6
12
  * bin/
data/Gemfile CHANGED
@@ -11,4 +11,5 @@ group :development do
11
11
  gem "bundler", "~> 1.11"
12
12
  gem "jeweler", "~> 2.0"
13
13
  gem "simplecov", "~> 0.11"
14
+ gem 'amazon-ecs', "~> 2.4"
14
15
  end
data/README.rdoc CHANGED
@@ -1,6 +1,7 @@
1
1
  = madowu
2
2
 
3
- Description goes here.
3
+ Markdown to HTML with table of contents, sidebar to neighboring directories.
4
+ See http://www.q-eng.imat.eng.osaka-cu.ac.jp/~ippei/html/madowu.html
4
5
 
5
6
  == Contributing to madowu
6
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
data/bin/isbninfo ADDED
@@ -0,0 +1,23 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require 'pp'
4
+ require 'nokogiri'
5
+ #require "open-uri"
6
+ require "madowu"
7
+
8
+ ARGF.each do |isbn|
9
+ book = Madowu::Isbn.new(isbn)
10
+
11
+ puts <<HERE
12
+ [ ![#{book.title}](#{book.img_url})
13
+ #{book.title},
14
+ #{book.author},
15
+ ISBN:#{book.isbn},
16
+ #{book.publisher},
17
+ #{book.publication_date}
18
+ ](#{book.url})
19
+ HERE
20
+
21
+
22
+
23
+ end
data/bin/urltitle ADDED
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require 'pp'
4
+ require 'nokogiri'
5
+ require "open-uri"
6
+
7
+ ARGF.each do |url|
8
+ url.chomp!
9
+ html = open(url)
10
+ doc = Nokogiri::HTML.parse(html)
11
+ puts "[#{doc.title}](#{url})"
12
+ end
@@ -0,0 +1 @@
1
+ associate_id_with-22
@@ -0,0 +1,2 @@
1
+ WSAccessKeyId=AK******************
2
+ AWSSecretKey=+Ko*************************************
data/example/isbn.md ADDED
@@ -0,0 +1,25 @@
1
+ # ISBN
2
+
3
+ Type in command line in below
4
+
5
+ echo '479803925X' | isbninfo
6
+
7
+ If using vim,
8
+ select a line of ISBN like
9
+
10
+ 479803925X
11
+
12
+ and command ':' and
13
+
14
+ '<,'>! isbninfo
15
+
16
+ results in
17
+
18
+ [ ![プログラムはこうして作られるプログラマの頭の中をのぞいてみよう](http://ecx.images-amazon.com/images/I/41td-P03xmL._SL75_.jpg)
19
+ プログラムはこうして作られるプログラマの頭の中をのぞいてみよう,
20
+ 平山 尚(株式会社セガ),
21
+ ISBN:479803925X,
22
+ 秀和システム,
23
+ 2013-09-25
24
+ ](http://www.amazon.co.jp/%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%AF%E3%81%93%E3%81%86%E3%81%97%E3%81%A6%E4%BD%9C%E3%82%89%E3%82%8C%E3%82%8B%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9E%E3%81%AE%E9%A0%AD%E3%81%AE%E4%B8%AD%E3%82%92%E3%81%AE%E3%81%9E%E3%81%84%E3%81%A6%E3%81%BF%E3%82%88%E3%81%86-%E5%B9%B3%E5%B1%B1-%E5%B0%9A-%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%82%BB%E3%82%AC/dp/479803925X%3FSubscriptionId%3DAKIAIRDYXYLFLVKUASUQ%26tag%3Dippei94da-22%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D479803925X)
25
+
@@ -0,0 +1 @@
1
+ *.html
File without changes
@@ -0,0 +1,6 @@
1
+ <!-- vim:syntax=markdown
2
+ <u> ■■■■ HERE ■■■■ </u>
3
+ -->
4
+
5
+ #
6
+
File without changes
@@ -0,0 +1,109 @@
1
+ # coding: utf-8
2
+ # Rakefile for Markdown documents.
3
+
4
+ DIRMAP_MD = '.dirmap.md'
5
+ ENCODING = "UTF-8"
6
+ HTML2PDF = "wkhtmltopdf"
7
+ TEX2IMAGE = "tex2image"
8
+ HTML2PDF_OPTIONS = "-B 1cm -L 1.5cm -R 1.5cm -T 1.5cm -s A4 --encoding #{ENCODING} "
9
+ CONVERT_COMMAND = "convert -alpha deactivate -density 150x150"
10
+
11
+ require "pp"
12
+ require "fileutils"
13
+ require "pathname"
14
+
15
+ ## .dirmap.md
16
+ # dirmap コマンドは必ず実行なので task タスク。
17
+ # これを file にすると存在するときに実行されない。
18
+ # 生成物の .dirmap.md から task タスクへの依存を設定すると、
19
+ # .dirmap.md に依存する file タスクに「必ず実行」が伝播して必ず実行になってしまう。
20
+ # DIRMAP_MD というファイルに対する file タスクへの依存として扱うことで、
21
+ # .dirmap.md に依存する file タスクに「必ず実行」が伝播するのを防いでいる。
22
+ desc "update .dirmap.md if directory changed."
23
+ file DIRMAP_MD => :dirmap_command
24
+ task :dirmap_command do
25
+ sh "dirmap"
26
+ end
27
+
28
+ ## *.html
29
+ md_files = FileList["*.md"]
30
+ html_files = md_files.ext("html")
31
+ html_tasks = []
32
+ html_files.each do |html_file|
33
+ md_file = html_file.ext("md")
34
+ md_path = Pathname.new( md_file)
35
+ dirpath = md_path.dirname
36
+ src = FileList[md_file, DIRMAP_MD]
37
+ file html_file => [DIRMAP_MD, md_file] do
38
+ sh "madowu -O -s .dirmap.md -c madowu.css -C UTF-8 #{md_file}"
39
+ end
40
+ html_tasks << html_file
41
+ end
42
+
43
+ desc "make *.html from *.md"
44
+ task :md2html => [DIRMAP_MD, * html_tasks]
45
+
46
+
47
+ desc "make *.pdf from *.html"
48
+ pdf_files = html_files.ext("pdf")
49
+ task :html2pdf => FileList[pdf_files]
50
+ pdf_files.each do |pdf_file|
51
+ html_file = pdf_file.ext("html")
52
+ file pdf_file => html_file do
53
+ sh "#{HTML2PDF} #{HTML2PDF_OPTIONS} #{html_file} #{pdf_file}"
54
+ end
55
+ end
56
+
57
+
58
+ desc "make .png from .eps."
59
+ eps_files = FileList["*.eps"]
60
+ png_files = eps_files.ext("png")
61
+ task :eps2png => FileList[png_files]
62
+ png_files.each do |png_file|
63
+ eps_file = png_file.ext("eps")
64
+ t = [eps_file]
65
+ file png_file => t do
66
+ sh "#{CONVERT_COMMAND} #{eps_file} #{png_file}"
67
+ end
68
+ end
69
+
70
+
71
+ desc "make *.png from *.tex"
72
+ tex_files = FileList["*.tex"]
73
+ png_files = tex_files.ext("png")
74
+ task :tex2png => FileList[png_files]
75
+ png_files.each do |png_file|
76
+ tex_file = png_file.ext("tex")
77
+ file png_file => tex_file do
78
+ #pp png_file, tex_file; exit
79
+ sh "#{TEX2IMAGE} #{tex_file}"
80
+ end
81
+ end
82
+
83
+
84
+ # recursive だと、サブディレクトリの Rakefile も
85
+ # recursive ターゲットを持っているという前提が必要。
86
+ desc "execute 'rake' in all subdirs with Rakefile"
87
+ rakefiles = FileList["**/Rakefile"]
88
+ dirs = rakefiles.map{|path| Pathname.new(path).dirname.to_s}
89
+ dirs.delete_if {|i| i == '.' }
90
+ dirs.map!{|path| File.absolute_path(path)}
91
+ task :subdir do
92
+ dirs.each do |dir|
93
+ Dir.chdir dir
94
+ system "rake"
95
+ end
96
+ end
97
+
98
+ task :all => [:md2html, :subdir]
99
+
100
+ task :pdf => :html2pdf
101
+ #task :default => [:tree, :tex2png, :eps2png]
102
+ task :default => [:md2html, :tex2png, :eps2png]
103
+
104
+ require "rake/clean"
105
+ CLEAN.include( [
106
+ html_files,
107
+ pdf_files,
108
+ ])
109
+
@@ -0,0 +1,2 @@
1
+ # urltitle
2
+