latex2hiki 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 72c92a6c5914bc440fdc012b9bbd92047a77834a
4
+ data.tar.gz: 8b44351e5d9da3aecfc1a350efe91b3c9c3f5ab7
5
+ SHA512:
6
+ metadata.gz: 378a587cd3df921564909b01d0c0ca3207089b55cd41d04f24779fc0722c90c3073e8bd56462d892f3c7be30ae15b1bfe64e0d6974a0211fa8abb0a7b7f99478
7
+ data.tar.gz: 9530cdc4152d5006f320d5f3ec782d5f922470798f9aa7c5289df1bf3f6bc9b60fad480b282083a70c2d2b5657c8bf66648ce7863935514df35653675d28c1e4
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,2 @@
1
+ -
2
+ **/*.md
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in latex2hiki.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Shigeto R. Nishitani
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,47 @@
1
+ # Latex2hiki
2
+
3
+ CUI application to convert latex document to hiki structure.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'latex2hiki'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```
22
+ $ gem install latex2hiki
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ |/usr/local/bin|source|description|
28
+ |:----|:----|:----|
29
+ |latex2hiki|lib/maple/latex2hiki.rb|basic conversion from latex to hiki format|
30
+ |mk_maple_hiki|lib/mk_maple_hiki.rb|automatic conversion from latex directory to hiki|
31
+ |rake maple|Rakefile|Sample codes for specific conversions|
32
+
33
+
34
+ ## Development
35
+
36
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec latex2hiki` to use the gem in this directory, ignoring other installed copies of this gem.
37
+
38
+ 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).
39
+
40
+ ## Contributing
41
+
42
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/latex2hiki. 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.
43
+
44
+
45
+ ## License
46
+
47
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,42 @@
1
+ require "bundler/gem_tasks"
2
+ require 'yard'
3
+ require "rake/testtask"
4
+ require 'fileutils'
5
+ p base_path = File.expand_path('..', __FILE__)
6
+ p basename = File.basename(base_path)
7
+
8
+ task :default do
9
+ system 'rake -T'
10
+ end
11
+
12
+ desc "make documents by yard"
13
+ task :yard => [:hiki2md] do
14
+ YARD::Rake::YardocTask.new
15
+ end
16
+
17
+ desc "transfer hikis/*.hiki to wiki"
18
+ task :hiki2md do
19
+ files = Dir.entries('hikis')
20
+ files.each{|file|
21
+ name=file.split('.')
22
+ case name[1]
23
+ when 'hiki'
24
+ p command="hiki2md hikis/#{name[0]}.hiki > #{basename}.wiki/#{name[0]}.md"
25
+ system command
26
+ when 'gif','png','pdf'
27
+ p command="cp hikis/#{file} #{basename}.wiki/#{file}"
28
+ # system command
29
+ FileUtils.cp("hikis/#{file}","#{basename}.wiki/#{file}",:verbose=>true)
30
+ FileUtils.cp("hikis/#{file}","doc/#{file}",:verbose=>true)
31
+ end
32
+ }
33
+ readme_en="#{basename}.wiki/README_en.md"
34
+ readme_ja="#{basename}.wiki/README_ja.md"
35
+ if File.exists?(readme_en)
36
+ FileUtils.cp(readme_en,"./README.md",:verbose=>true)
37
+ elsif File.exists?(readme_ja)
38
+ FileUtils.cp(readme_ja,"./README.md",:verbose=>true)
39
+ FileUtils.cp(readme_ja,"#{basename}.wiki/Home.md",:verbose=>true)
40
+ end
41
+ end
42
+
@@ -0,0 +1,16 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+ require "yard"
4
+
5
+ YARD::Rake::YardocTask.new
6
+
7
+ Rake::TestTask.new(:test) do |t|
8
+ t.libs << "test"
9
+ t.libs << "lib"
10
+ t.test_files = FileList['test/**/*_test.rb']
11
+ end
12
+
13
+ task :default => :test
14
+
15
+
16
+
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "latex2hiki"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "latex2hiki"
4
+
5
+ Latex2hiki::Command.run(ARGV)
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "latex2hiki"
4
+
5
+ Latex2hiki::Command.run(ARGV)
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "mk_maple_hiki"
4
+
5
+ MkMapleHiki::Command.run(ARGV)
@@ -0,0 +1,41 @@
1
+ ! Latex2hiki
2
+
3
+ CUI application to convert latex document to hiki structure.
4
+
5
+ !! Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ <<< ruby
10
+ gem 'latex2hiki'
11
+ >>>
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install latex2hiki
20
+
21
+ !! Usage
22
+ ||/usr/local/bin||source||description
23
+ ||latex2hiki||lib/maple/latex2hiki.rb||basic conversion from latex to hiki format
24
+ ||mk_maple_hiki||lib/mk_maple_hiki.rb||automatic conversion from latex directory to hiki
25
+ ||rake maple||Rakefile||Sample codes for specific conversions
26
+
27
+ !! Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec latex2hiki` to use the gem in this directory, ignoring other installed copies of this gem.
30
+
31
+ 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]].
32
+
33
+ !! Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/latex2hiki. 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.
36
+
37
+
38
+ !! License
39
+
40
+ The gem is available as open source under the terms of the [[MIT License|http://opensource.org/licenses/MIT]].
41
+
@@ -0,0 +1,91 @@
1
+ ! Latex2hiki
2
+
3
+ latex文書をhiki構造に変換するCUI.
4
+
5
+ 単独のファイルを変換するlatex2hikiと,latex文書構成にしたがってhiki構造を作成するmk_maple_hikiとを提供している.
6
+
7
+ !! Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ <<< ruby
12
+ gem 'latex2hiki'
13
+ >>>
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install latex2hiki
22
+
23
+ !! latex2hiki usage
24
+
25
+ latex2hiki sample.tex > sample.hiki
26
+
27
+ !! mk_maple_hiki usage
28
+ mk_maple_hikiは,目次にしたがって構造化されたhikiサイトを自動構築することを目指している.
29
+
30
+ ||options||操作||DIR_NAME/.latex2hiki_rcの初期値
31
+ ||--init [DIR_NAME]|| ベースとなるlatexサイトを構築する,Rakefile, figures, .latex2hiki_rcを作成
32
+ ||--figures [DIR_NAME]|| 下部のdirectoriesから画像ファイルを集め,pngに変換してhiki/cache/attachへ入れる. ||:fig_extension: ".eps"
33
+ ||--scale [VAL]% ||figuresをhikiに変換するときのscale||デフォルトは80%
34
+ ||--level [VAL] ||head(!や!!)をどのlevelから始めるか.|| :level: 0
35
+ ||--hiki|| text, figuresをサイトに構築する || :local_site: "/hoge/hoge"
36
+
37
+ * initで配置されるRakefileに一括変換のサンプルがある
38
+ * 変換errorや,Latex標準でないcommandはrake preで予め変換.
39
+ ** それぞれの変換の内容はRakefileを参照せよ.
40
+
41
+ 以下のように切り分けているが,もっと徹底すべき.
42
+ ||binのコマンド||source||内容
43
+ ||latex2hiki||lib/maple/latex2hiki.rb||latexからの基本変換
44
+ ||mk_maple_hiki||lib/mk_maple_hiki.rb||directoryからhikiへの自動変換
45
+ ||rake maple||Rakefile||固有変換を自動化するサンプル
46
+
47
+ !!具体的な使用例
48
+ !!!一括して作る場合
49
+ <<< tcsh
50
+ bob% cd MapleText/
51
+ bob% mk_maple_hiki --init
52
+ bob% mk_maple_hiki --figures NumMaple
53
+ >>>
54
+ <<< tcsh
55
+ [bob:~/Ruby/latex2hiki/MapleText] bob% mk_maple_hiki --hiki NumMaple/
56
+ [["begin", "document"], ["title", "Mapleで理解する数値計算の基礎"], ["author", "西谷@関西学院大・理工"], ["date", "\\today"], ["chapter", "代数方程式(fsolve)"], ["section", "概要"], ["input", "FSolve/abs.tex"], ["section", "Mapleでの解"], ["input", "FSolve/s
57
+ ...
58
+ ["!!", "高速フーリエ変換アルゴリズムによる高速化"]
59
+ "FFT/TukeyAlgorithm.tex"
60
+ ["!!", "FFT関数を用いた結果"]
61
+ "FFT/FFTFunction.tex"
62
+ chmod 666 /Users/bob/Sites/new_ist_data/maple_hiki_data/text/NumMaple
63
+ >>>
64
+
65
+ !!!sectionを分割して作る場合
66
+ <<< tch
67
+ bob% ls
68
+ Error/ LAEigenvectors/ NonLinearFit/ NumMapleCont.tex figures/
69
+ FFT/ LAFundamentals/ NumMaple.out NumMaple_140130.pdf
70
+ FSolve/ LAMatrixInverse/ NumMaple.tex NumMaple_160802.pdf
71
+ InterpolationIntegral/ LeastSquareFit/ NumMaple.toc Rakefile
72
+ bob% rake maple
73
+ "./Error"
74
+ [["begin", "document"], ["chapter", "誤差(Error)"], ["section", "打ち切り誤差と丸め誤差(Truncation and round off errors)"], ["input", "TruncationRoundoff.tex"], ["s
75
+ >>>
76
+
77
+ !! Development
78
+
79
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec latex2hiki` to use the gem in this directory, ignoring other installed copies of this gem.
80
+
81
+ 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]].
82
+
83
+ !! Contributing
84
+
85
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/latex2hiki. 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.
86
+
87
+
88
+ !! License
89
+
90
+ The gem is available as open source under the terms of the [[MIT License|http://opensource.org/licenses/MIT]].
91
+
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'latex2hiki/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "latex2hiki"
8
+ spec.version = Latex2hiki::VERSION
9
+ spec.authors = ["Shigeto R. Nishitani"]
10
+ spec.email = ["shigeto_nishitani@me.com"]
11
+
12
+ spec.summary = %q{latex to hiki format converter.}
13
+ spec.description = %q{latex2hiki is a format convert from latex to hikidoc.}
14
+ spec.homepage = 'https://github.com/daddygongon/latex2hiki'
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ # if spec.respond_to?(:metadata)
20
+ # spec.metadata['allowed_push_host'] = 'http://nishitani0.kwansei.ac.jp/~bob/nishitani0/gems/'
21
+ # else
22
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ # end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_development_dependency "bundler", "~> 1.10"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency "minitest"
33
+ spec.add_development_dependency "yard"
34
+ spec.add_development_dependency "hiki2md"
35
+ spec.add_development_dependency "mathjax-yard"
36
+ end
@@ -0,0 +1,63 @@
1
+ # Latex2hiki
2
+
3
+ latex文書をhiki構造に変換するCUI.
4
+
5
+ 単独のlatex fileをhiki化するだけでなく,目次にしたがって構造化されたhikiサイトを自動構築することを目指している.
6
+
7
+
8
+ |options|操作|DIR_NAME/.latex2hiki_rcの初期値|
9
+ |:----|:----|:----|
10
+ |--init [DIR_NAME]| ベースとなるlatexサイトを構築する|
11
+ |--figures [DIR_NAME]| 下部のdirectoriesから画像ファイルを集める |fig_extension='.eps'|
12
+ |--contents| text, figuresをサイトに構築する | site = '/hoge/hoge'|
13
+
14
+
15
+ ## Installation
16
+
17
+ Add this line to your application's Gemfile:
18
+
19
+ ```ruby
20
+ gem 'latex2hiki'
21
+ ```
22
+
23
+ And then execute:
24
+
25
+ ```
26
+ $ bundle
27
+ ```
28
+
29
+ Or install it yourself as:
30
+
31
+ ```
32
+ $ gem install latex2hiki
33
+ ```
34
+
35
+ ## Usage
36
+ - 全体を一度に作るか,部分に分けるか
37
+ - initで配置されるRakefileに一括変換のサンプルがある
38
+ - 変換errorや,Latex標準でないcommandはrake preで予め変換.
39
+ - それぞれの変換の内容はRakefileを参照せよ.
40
+
41
+ 以下のように切り分けているが,もっと徹底すべき.
42
+
43
+ |binのコマンド|source|内容|
44
+ |:----|:----|:----|
45
+ |latex2hiki|lib/maple/latex2hiki.rb|latexからの基本変換|
46
+ |mk_maple_hiki|lib/mk_maple_hiki.rb|directoryからhikiへの自動変換|
47
+ |rake maple|Rakefile|固有変換を自動化するサンプル|
48
+
49
+
50
+ ## Development
51
+
52
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec latex2hiki` to use the gem in this directory, ignoring other installed copies of this gem.
53
+
54
+ 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).
55
+
56
+ ## Contributing
57
+
58
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/latex2hiki. 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.
59
+
60
+
61
+ ## License
62
+
63
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).