Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

========という行が行頭にあると例外エラーになる #1591

Closed
kmuto opened this issue Oct 30, 2020 · 6 comments · Fixed by #1597
Closed

========という行が行頭にあると例外エラーになる #1591

kmuto opened this issue Oct 30, 2020 · 6 comments · Fixed by #1597

Comments

@kmuto
Copy link
Owner

kmuto commented Oct 30, 2020

見出しかどうかの判定がちょっと難しめですが…
特に=の数が多量の場合、ランタイムエラーになるのはよくなさそうです。

Traceback (most recent call last):
	15: from /home/kmuto/review/bin/review2html:184:in `<main>'
	14: from /home/kmuto/review/bin/review2html:29:in `main'
	13: from /home/kmuto/review/bin/review2html:83:in `_main'
	12: from /home/kmuto/review/bin/review2html:83:in `each'
	11: from /home/kmuto/review/bin/review2html:88:in `block in _main'
	10: from /home/kmuto/review/lib/review/compiler.rb:44:in `compile'
	 9: from /home/kmuto/review/lib/review/compiler.rb:260:in `do_compile'
	 8: from /home/kmuto/review/lib/review/builder.rb:51:in `bind'
	 7: from /home/kmuto/review/lib/review/book/chapter.rb:59:in `generate_indexes'
	 6: from /home/kmuto/review/lib/review/book/book_unit.rb:53:in `generate_indexes'
	 5: from /home/kmuto/review/lib/review/book/book_unit.rb:44:in `execute_indexer'
	 4: from /home/kmuto/review/lib/review/compiler.rb:44:in `compile'
	 3: from /home/kmuto/review/lib/review/compiler.rb:271:in `do_compile'
	 2: from /home/kmuto/review/lib/review/compiler.rb:398:in `compile_headline'
	 1: from /home/kmuto/review/lib/review/index_builder.rb:86:in `headline'
/home/kmuto/review/lib/review/sec_counter.rb:24:in `inc': undefined method `+' for nil:NilClass (NoMethodError)
@takahashim
Copy link
Collaborator

これってどういう文書に対するエラーなんでしょうか?(タイトルだけでは意味が分かりませんでした)

@kmuto
Copy link
Owner Author

kmuto commented Nov 3, 2020

そうですよね、すみません。
届いた草稿をとりあえずRe:VIEW化して作業しようとしたのですが、

以上です。

=========

まとめ

という内容で上記例外になったのでした。=の前後は空白なしです。

ちなみにサポート範囲のレベルにして前後空白なしだと、

以上です。

======

まとめ
  • TeX: \subparagraph*{}
  • text: ■H6
  • HTML: 空行
  • IDGXML: <title aid:pstyle="h6"></title>

になりますね。

@kmuto kmuto changed the title =が行頭から連続している地の文で不明瞭なエラーになる ========という行が行頭にあると例外エラーになる Nov 3, 2020
@kmuto
Copy link
Owner Author

kmuto commented Nov 3, 2020

8文字以上だとどのビルダでも最初のsec_counterの例外。
7文字だとビルダのほうでエラーチェックしているもののIDGXMLがいまいちなので直さないと…

$ cat s.re
= test

=======

$ review2latex s.re
WARN review2latex: s.re:3: headline is empty.
WARN review2latex: s.re:3: headline is empty.
ERROR review2latex: s.re:3: error: unknown level: 7

$ review2top s.re
WARN review2top: s.re:3: headline is empty.
WARN review2top: s.re:3: headline is empty.
■H1■第1章 TEST
■H7■

$ review2html s.re
WARN review2html: s.re:3: headline is empty.
WARN review2html: s.re:3: headline is empty.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
 ...
<h1><a id="h1"></a><span class="secno">第1章 </span>TEST</h1>

</body>
</html>
$ review2idgxml s.re
WARN review2idgxml: s.re:3: headline is empty.
WARN review2idgxml: s.re:3: headline is empty.
Traceback (most recent call last):
	8: from /home/kmuto/review/bin/review2idgxml:184:in `<main>'
	7: from /home/kmuto/review/bin/review2idgxml:29:in `main'
	6: from /home/kmuto/review/bin/review2idgxml:83:in `_main'
	5: from /home/kmuto/review/bin/review2idgxml:83:in `each'
	4: from /home/kmuto/review/bin/review2idgxml:88:in `block in _main'
	3: from /home/kmuto/review/lib/review/compiler.rb:44:in `compile'
	2: from /home/kmuto/review/lib/review/compiler.rb:273:in `do_compile'
	1: from /home/kmuto/review/lib/review/compiler.rb:400:in `compile_headline'
/home/kmuto/review/lib/review/idgxmlbuilder.rb:163:in `headline': caption level too deep or unsupported: 7 (RuntimeError)

@takahashim
Copy link
Collaborator

この件ですが、↓こんな感じのエラーで良いでしょうか?

review-compileを使った場合

$ review-compile --target=html hoge.re 
ERROR review-compile: Invalid header: max headline level is 6

Rakeを使った場合

review-epubmaker  config.yml
WARN review-epubmaker: compile error in hoge.re (ReVIEW::CompileError)
WARN review-epubmaker: Invalid header: max headline level is 6
compile error, No EPUB file output.
rake aborted!

@kmuto
Copy link
Owner Author

kmuto commented Nov 13, 2020

よさそうなかんじがします!

@takahashim
Copy link
Collaborator

マージしておきました

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants