Coder Social home page Coder Social logo

whiteleaf7 / narou Goto Github PK

View Code? Open in Web Editor NEW
469.0 44.0 54.0 5.71 MB

Narou.rb - 小説家になろうのダウンローダ&縦書き整形&管理アプリ。Kindle(などの電子書籍端末)でなろうを読む場合に超便利です!

License: Other

Ruby 67.78% JavaScript 18.65% CSS 2.18% HTML 1.28% Haml 7.81% SCSS 2.31%
ruby ruby-gem narou epub mobi kindle

narou's Introduction


🏆GitHub Trophies

narou's People

Contributors

dependabot[bot] avatar diaphragm avatar etg-lt avatar gitter-badger avatar happynow avatar jam7 avatar kenhys avatar koluku avatar kubo avatar laplace22 avatar maa123 avatar migimigi avatar naoh87 avatar rogenobl avatar southly avatar topstone avatar whiteleaf7 avatar y-marui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

narou's Issues

前書き・後書き内のなろう挿絵タグを外へ

AozoraEpub3の仕様として、注記内に挿絵タグがある場合、独立ページとして表示されるべき画像でも注記内のインライン要素として表示されるため、でかい画像ははみ出してしまう。

  • 第1段階:単純に前書き・後書き内の挿絵タグを本文内へ追い出す
  • 第2段階:画像の大きさを見て、大きすぎる場合は挿絵タグを本文内へ追い出す

表示を色つけしたい

表示が殺風景なので文字に色を付けたいが、Windowsのコンソールは腐ってるので面倒くさい。

gem の win32console というものがあるが、コンパイル環境がないと動かない。

License missing from gemspec

Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec,

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Even for projects that already specify a license, including a license in your gemspec is a good practice, since it is easily
discoverable there without having to check the readme or for a license file. For example, it is the field that rubygems.org uses to display a gem's license.

For example, there is a License Finder gem to help companies ensure all gems they use
meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough
issue that even Bundler now generates gems with a default 'MIT' license.

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), github has created a license picker tool.

In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :).

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue and let me know. In either case, I'll follow up. Thanks!

p.s. I've written a blog post about this project
p.p.s. Here's a list of the license names I've found and their frequenceis

短編小説も対応する

現状長編小説のみの対応で短編は未対応。短編のURLを入力したらおかしくなる。

なろうデベロッパーAPIで長編・短編の種別が簡単に習得できるため、それを利用して短編も対応したい。

ルビの振り方が本家に準拠してない

|漢字|(かんじ)

上記記述があった場合、
なろう上では
「漢字|」に対してルビがつくが、Narou.rb だと「|漢字(かんじ)」
となってしまう。

しかしながら、こんな表記はルビの書き方としてありえんので、現状は仕様扱いとする。

narou downloadで適切な終了コードを返して欲しい

narou download が失敗しても終了コードが0なため、コマンドの成功可否がそれからは判断できません。

ダウンロードに成功した数を終了コードとして返すとかしてくれると嬉しいです。

download -f 時の差分用ファイル保存について

download -f 時の差分用ファイル保存は、現在の仕様では全てのデータが差分として保存されてしまう。
これでは差分として必要ない部分まで保存してしまい、diff -l 時にもリストが長くなりすぎてしまう。

差分ファイル保存時に、ダウンロードしたデータと、保存されているデータを照合し、本当に変更されているかを確認する必要がある。

APIで更新情報を取得する

現状目次の更新日(粒度は日単位)で取得しているため、同じ日に2回以上更新されると更新を把握できない。

次の話が投下されるまでの間限定だが、なろうデベロッパーAPIで小説の更新時間を秒単位で取得できるため、これを使用したい。

ただし、latest な更新を全て更新してしまうと、1,2,3話更新→同日に3話最更新された場合、1,2話が無駄な更新をしてしまうため、この場合の対処をどうにかする。

注記タグの中は変換処理を通さない

ダウンロードした小説を変換するときはほぼ問題はないが、テキストファイルを変換するときに注記が使えなくなるので対応したほうが良い(優先度:中)

小説タイトルのアルファベットを全角にしたい

タイトル名は原文を尊重したいが、半角アルファベットは全角にするところはしないと横に倒れて見栄えが良くない。

変換処理をかませるとタイトル自体が変わってしまう可能性が高いので、アルファベット変換処理だけかける?

folderコマンドで存在しない小説を指定した場合にエラー

C:/Users/sasa/Documents/GitHub/narou/lib/helper.rb:56:in `open_directory_by_os_f
iler': undefined method `encode' for nil:NilClass (NoMethodError)
        from C:/Users/sasa/Documents/GitHub/narou/lib/command/folder.rb:30:in `b
lock in execute'
        from C:/Users/sasa/Documents/GitHub/narou/lib/command/folder.rb:28:in `e
ach'
        from C:/Users/sasa/Documents/GitHub/narou/lib/command/folder.rb:28:in `e
xecute'
        from C:/Users/sasa/Documents/GitHub/narou/lib/commandline.rb:32:in `run'

        from C:/Users/sasa/Documents/GitHub/narou/narou.rb:27:in `<top (required
)>'
        from C:/Users/sasa/Documents/GitHub/narou/narou.bat:11:in `require_relat
ive'
        from C:/Users/sasa/Documents/GitHub/narou/narou.bat:11:in `<main>'

sendコマンドでエラー

C:\Users\sasa\Documents\GitHub\narou>narou send 13 musyoku
C:/Users/sasa/Documents/GitHub/narou/lib/command/send.rb:40:in `get_device': pri
vate method `new' called for Device:Class (NoMethodError)
        from C:/Users/sasa/Documents/GitHub/narou/lib/command/send.rb:55:in `exe
cute'
        from C:/Users/sasa/Documents/GitHub/narou/lib/commandline.rb:32:in `run'

        from C:/Users/sasa/Documents/GitHub/narou/narou.rb:27:in `<top (required
)>'
        from C:/Users/sasa/Documents/GitHub/narou/narou.bat:11:in `require_relat
ive'
        from C:/Users/sasa/Documents/GitHub/narou/narou.bat:11:in `<main>

ドキュメント書くリスト

  • converter.rb の書き方
  • template の上書き方法
  • replace.txt のこと
  • 行頭鍵カッコ等の二分下げについて(デフォルトON(対象Kindle)、他の環境でも必要なのがあり)

行頭スペース自動挿入が正しく動かない時がある

  1. 行頭スペースを挿入すべきと判断された小説が合った時
  2. ・・・・・・ と三点リーダーの代わりに中黒が使われていた場合
  3. 2が行頭にきている

上記のすべての条件を満たすと、三点リーダーに変換後の……が行頭のままで、スペースが挿入されていない。

narou listの結果をそのままリダイレクトしたい

narou list -u > list.txtなどとして管理している小説のリストをテキストファイルにリダイレクトして保存しようとしても、実際に保存されるのは IDのリストになっています。

$ narou list > cmd.txt
$ cat cmd.txt
0 1 2 3 4 ....

小説がたまってきたときにリストを一旦ファイルに落として眺めるケースで不便なので、
できればそのままファイルに保存できると嬉しいです。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.