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

表のセル区切り文字(正規表現)の任意指定 #1420

Closed
kmuto opened this issue Nov 29, 2019 · 11 comments
Closed

表のセル区切り文字(正規表現)の任意指定 #1420

kmuto opened this issue Nov 29, 2019 · 11 comments

Comments

@kmuto
Copy link
Owner

kmuto commented Nov 29, 2019

表のセル区切り文字を用途に応じてカスタム化できる(たとえば\s+にする)ようなパラメータを入れるのはどうか、と考えています。

splitのところに入れるRegexp文字列を指定するイメージ。
https://review-knowledge-ja.readthedocs.io/ja/latest/faq/faq-usage.html#02eab96e754cf82ccc15cb2a50e9efa0

@kmuto
Copy link
Owner Author

kmuto commented Dec 16, 2019

@takahashim
こちら入れちゃっていいですかね。

@takahashim
Copy link
Collaborator

どちらかというと正規表現で指定するよりは文字で指定する方が安全な気がしますね…。でも、強い意見はないです。

@kmuto
Copy link
Owner Author

kmuto commented Dec 17, 2019

文字指定だと任意個数とか空白有無無視とかが難しいんですよね…。

@kmuto kmuto closed this as completed in 3e80cff Dec 17, 2019
@takahashim
Copy link
Collaborator

構文要素として自由な正規表現をユーザが与えられるようにすると、parserを書き直すのにハードルがだいぶ上がってしまいそう(少なくともふつうのPEGとかでは記述できなくなる)なのが気になっております。
とはいえparser書き直しがいつになるか分からないのがアレなわけなんですが…その時に考え直す感じでしょうか。

@kmuto
Copy link
Owner Author

kmuto commented Dec 18, 2019

そうですねぇ… 使えなくする可能性があるという前提でのexperimental featureということで。
現状ではescape済み文字列に対しての区切りにしないといけないなど、いろいろ辛いところがあるので、あくまでも「わかった上で使う」ということにしたいと思っています。

@kmuto
Copy link
Owner Author

kmuto commented Dec 18, 2019

実際のところやりたいこととしては \t+ と \s+ を切り替えられるようにしたい(あと本当はできれば\s*|\s*)ということなので、このパターン切り替えを指定できればいいのかな。
できれば表ごとに指定できるといいんですが、それには表オプション指定方法の問題があります。

@kmuto
Copy link
Owner Author

kmuto commented Dec 18, 2019

複数からの選択でもPEGには厳しいでしょうか。それとも有限個に収まってくれればOKでしょうか。

@takahashim
Copy link
Collaborator

'a'とか'abc'とか'ab' | 'ac'みたいなのは大丈夫です。

@kmuto
Copy link
Owner Author

kmuto commented Dec 18, 2019

もともとデフォルトは「\t+」だったみたいなんですが、実は困る…?

@takahashim
Copy link
Collaborator

あらかじめ決め打ちのパターンであれば、それにあった文法を事前に(手で)書けるので、ふつうの正規表現くらいであれば問題なさそうです。
ユーザが与えられるようにすると、そういうこともできないので厳しくなるのでした…。

@kmuto
Copy link
Owner Author

kmuto commented Dec 18, 2019

なるほど、では決めうちパターンから選ぶ、で実装し直してみますね。

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue May 5, 2020
Update ruby-review to 4.1.0.


# Version 4.1.0
## New Features
* add `table_row_separator` to specify a separator that separates table rows. Accceptable value: tabs (means `\t+`, default), `singletab` (means `\t`), spaces (means `\s+`), verticalbar (means `\s*\|\s*`) ([#1420])
* PDFMaker, EPUBMaker, WEBMaker, TEXTMaker, IDGXMLMaker: add `-y` (`--only`) option to specify the files to convert instead of all files ([#1428])
* add `--without-config-comment` option to review-init command to exclude comments from config.yml ([#1453])
* PDFMaker: add `use_original_image_size` in `pdfmaker` section. If this parameter is set to true, images in `//image`, `//indepimage`, and `//imgtable` will be placed in actual size, not textwidth ([#1461])

## Breaking Changes
* PDFMaker: `image_scale2width` parameter has been moved under `pdfmaker` section ([#1462])

## Bug Fixes
* PDFMaker: fix backward compatibility error with Re:VIEW 3 ([#1414])
* PDFMaker: fix an error when compiling review-jlreq with LuaLaTeX ([#1416])
* PDFMaker: fix index not being included in the table of contents ([#1418])
* RSTBuilder: fix conversion failure due to incorrect method argument handling ([#1426])
* IDGXMLBuilder: there was an error in the warning handling for the table ([#1427])
* IDGXMLMaker: there was an error in the processing when an error occurred in the filter program ([#1429])
* PDFMaker: fix a build failure when using inline operators such as `@<code>` or `@<tt>` for heading with `media=ebook` mode ([#1432], [#1465])
* PDFMaker: raise just warning instead of error, when MeCab isn't installed ([#1445])
* IDGXMLBuilder: fix `//imgtable` to work correctly ([#1448])
* PDFMaker: fix an error when makeindex is true but no index is registered ([#1467])
* PDFMaker: fix missing footnotes in a description list ([#1476])
* review-index: fix an error when `@<w>` exists in headlines ([#1484])

## Enhancements
* PDFMaker: add version to .cls/.sty files ([#1163])
* update Dockerfile ([#1412])
* IDGXMLMaker: show the contents of stderr from the filter program ([#1443])
* add *-idgxml folder entry to .gitignore ([#1448])
* `//source` can now omit options in all builders ([#1447])
* add Ruby 2.7 to the test targets ([#1468])
* allow a setting of multiple word\_file ([#1469])
* EPUBMaker: warn when there is no heading in .re file ([#1474])

## Docs
* add the description about `contact` and `colophon_order` to `config.yml.sample` ([#1425])
* update quickstart.ja.md and quickstart.md to Re:VIEW 4 ([#1442])
* update syntax-book sample document ([#1448], [#1449])
* update README.md ([#1455], [#1458])
* update format.ja.md and format.md. add the description about `::` notation which sets builder-specific options to images ([#1421])

## Others
* refactor codes with Rubocop 0.78.0 ([#1424], [#1430])
* run PDF build test more strictly when there is LaTeX runtime environment ([#1433])
* switch the build test suite from Travis CI to GitHub Actions ([#1431], [#1436], [#1437])
* IDGXMLBuilder: refactor code list methods ([#1438], [#1439])
* remove unnecessary review-ext.rb from syntax-book ([#1446])
* add tests for IDGXMLMaker and TextMaker ([#1448])
* refactor around Index ([#1456], [#1457], [#1459])
* update jsclasses to version 2020/02/02 ([#1478])

## Contributors
* [@turky](https://github.com/turky)

[#1163]: kmuto/review#1163
[#1412]: kmuto/review#1412
[#1414]: kmuto/review#1414
[#1416]: kmuto/review#1416
[#1418]: kmuto/review#1418
[#1420]: kmuto/review#1420
[#1421]: kmuto/review#1421
[#1424]: kmuto/review#1424
[#1425]: kmuto/review#1425
[#1426]: kmuto/review#1426
[#1427]: kmuto/review#1427
[#1428]: kmuto/review#1428
[#1429]: kmuto/review#1429
[#1430]: kmuto/review#1430
[#1431]: kmuto/review#1431
[#1432]: kmuto/review#1432
[#1433]: kmuto/review#1433
[#1436]: kmuto/review#1436
[#1437]: kmuto/review#1437
[#1438]: kmuto/review#1438
[#1439]: kmuto/review#1439
[#1442]: kmuto/review#1442
[#1443]: kmuto/review#1443
[#1445]: kmuto/review#1445
[#1446]: kmuto/review#1446
[#1447]: kmuto/review#1447
[#1448]: kmuto/review#1448
[#1449]: kmuto/review#1449
[#1453]: kmuto/review#1453
[#1455]: kmuto/review#1455
[#1456]: kmuto/review#1456
[#1457]: kmuto/review#1457
[#1458]: kmuto/review#1458
[#1459]: kmuto/review#1459
[#1461]: kmuto/review#1461
[#1462]: kmuto/review#1462
[#1465]: kmuto/review#1465
[#1466]: kmuto/review#1466
[#1467]: kmuto/review#1467
[#1468]: kmuto/review#1468
[#1469]: kmuto/review#1469
[#1474]: kmuto/review#1474
[#1476]: kmuto/review#1476
[#1478]: kmuto/review#1478
[#1484]: kmuto/review#1484

# Version 4.0.0
## New Features
* introduce review-idgxmlmaker which generates IDGXML files at once ([#1337])
* review-textmaker converts the math in the document to image files when `imgmath` parameter has `true` ([#1338])
* introduce wizard mode to layout of LaTeX on Web browser. Add `-w` option to review-init. This feature is experimental and may be replaced in the future ([#1403])
* experimental feature: introduce the feature to insert whitespace based on character when combining lines into a paragraph. To enable this, install unicode-eaw gem and add `join_lines_by_lang: true` into config.yml [#1362]

## Breaking Changes
* review-init no longer creates empty `layouts` folder ([#1340])
* PDFMaker: fix a problem that white space characters disappeared in `@<code>`, `@<tt>`, `@<tti>`, and `@<ttb>`. Also the string is automatically wrapped ([#1348])
* `//texequation`¡¢`//embed` and `//graph` that don't allow inline op no longer escape inline op in strings. And don't put extra line break ([#1371], [#1374])
* PDFMaker: change the default table placement from `htp` to `H` for use in columns (`\floatplacement{table}` value in review-style.sty) [#1385]
* PDFMaker: the space between Japanese/Western characters in the code lists is changed to 0 from 1/4 character ([#1401])
* change the default value of `toc` parameter from null (false, don't create a table of contents) to true (create a table of contents) ([#1405])

## Bug Fixes
* fix a typo in review-jlreq ([#1350])
* fix incorrect result when `re` file uses CR for line-feed code ([#1341])
* PDFMaker: fix foreground color of `//cmd` with review-jlreq after page breaking ([#1363])
* PDFMaker: fix duplicate 'column' label for `@<column>` ([#1367])
* PDFMaker: copy gentombow.sty and jsbook.cls only for review-jsbook ([#1381])
* PDFMaker: fix invalid PDFDocumentInformation on review-jlreq with LuaLaTeX ([#1392])
* PDFMaker: fix missing hiddenfolio information at even pages on review-jlreq ([#1395])

## Enhancements
* support `@<em>` and `@<strong>` in IDGXMLBuilder ([#1353])
* PDFMaker: extract `code_line` and `code_line_num` from code blocks for ease handling each line ([#1368])
* PDFMaker: add new compile option `-halt-on-error` to make it easier to find the problem when an error occurs ([#1378])
* PDFMaker: when there is a footnote text (`//footnote`) in the column block, it may cuse problems such as numbering. So warn it if there is. ([#1379])
* Logger: progname should be add in logger, not in message arguments ([#1388])
* improve error checking for yaml files ([#1386])
* PDFMaker: the cover page becomes even number (p.0) and is named "cover" ([#1402])
* PDFMaker: refactor `generate_pdf` method ([#1404])
* create `.gitignore` for new project ([#1407])

## Docs
* update sample-book/README.md ([#1354])
* add descriptions about options of jsbook.cls to review-jsbook/README.md ([#1365])

## Others
* unify styles of a method with arguments ([#1360])
* `Catalog#{chaps,parts,predef,postdef,appendix}` should return Array, not String ([#1372])
* use `safe_load` for loading YAML ([#1375])
* refactor `table` method to simplify each builder ([#1356])
* refactor `XXX_header` and `XXX_body` ([#1359])
* enable `Builder#highlight?` method on each builder ([#1373])
* refactor mkdchap* and mkpart* ([#1383])
* don't update rubygems in Travis CI ([#1389])
* refactor around Index ([#1390])
* add configration for review-jlreq to sample documents ([#1391])
* definition list should start with spaces ([#1398])

## Contributors
* [@m-shibata](https://github.com/m-shibata)
* [@masarakki](https://github.com/masarakki)
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

No branches or pull requests

2 participants