5 unstable releases

0.3.1 Apr 5, 2021
0.3.0 Apr 5, 2021
0.2.1 Jan 13, 2020
0.2.0 Jan 13, 2020
0.0.1 Dec 22, 2019

#1053 in Text processing

MIT license

1MB
512 lines

Naromat: Narou format converter

Coverage Status

What's Naromat?

Naromat is a library crate that converts text file from specific typesetting format to Shosetsuka ni Naro(https://syosetu.com/) format.

Getting started

As a tool

  1. cargo install naromat
  2. naromat -h

As a library

  1. Add Naromat to your cargo.toml
  2. Use like this:
use naromat::entities::chapter::Chapter;

let chapter = Chapter::new("
我が輩は猫[#犬も検討する]である。名前はまだない。
どこで[生まれた:.]のかとんと[見当:けんとう]がつかぬ。
// コメント行
");

let formatted_string = chapter.get();
assert_eq!(formatted_string, "
 我が輩は猫である。名前はまだない。
 どこで|生まれた《・・・・》のかとんと|見当《けんとう》がつかぬ。");

use naromat::entities::file::TextFile;

let text = TextFile::new("./path/to/source/file").unwrap();
text.format_and_save("./path/to/save.txt");

Contributing

  • If You find any issue, please notice us by open GitHub issue.
  • If You want to change code, please send pull request.

Dependencies

~2.5–3.5MB
~60K SLoC