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

cannot show 3.0.2 rabbit.md #153

Closed
mtasaka opened this issue Jul 1, 2023 · 2 comments
Closed

cannot show 3.0.2 rabbit.md #153

mtasaka opened this issue Jul 1, 2023 · 2 comments

Comments

@mtasaka
Copy link

mtasaka commented Jul 1, 2023

With rubygem-rabbit 3.0.2 with ruby-gnome suite 4.1.8, trying to show rabbit 3.0.2 rabbit.md shows error and only blank window is shown:

[tasaka1@localhost sample]$ rabbit ./rabbit.md 
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/CVE-2023-32700 patched) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(/tmp/rabbit-image-latex20230701-2787884-p2bmem
LaTeX2e <2022-06-01> patch level 5
L3 programming layer <2022-12-17>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/fleqn.clo)
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/latin1.def))
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
No file rabbit-image-latex20230701-2787884-p2bmem.aux.
[1] (/tmp/rabbit-image-latex20230701-2787884-p2bmem.aux) )
Output written on /tmp/rabbit-image-latex20230701-2787884-p2bmem.dvi (1 page, 6
20 bytes).
Transcript written on /tmp/rabbit-image-latex20230701-2787884-p2bmem.log.
./rabbit.dia --> /tmp/rabbit-image-loader-dia20230701-2787884-vp9hd7.svg
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/image/base.rb:65: warning: Rabbit::ImageManipulable::Dia#update_size at /usr/share/ruby/forwardable.rb:159 forwarding to private method Rabbit::ImageManipulable::SVG#update_size
[警告]
./rabbit.xcf: 認識できない画像ファイル形式
[エラー]
NoMethodError: undefined method `_' for #<Rabbit::ImageManipulable::Mermaid:0x00007fbdc973e798 @pdf_file=#<Tempfile:/tmp/rabbit-image-loader-mermaid20230701-2787884-qzwkrx.pdf>>
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/image/mermaid.rb:57:in `block (2 levels) in init_delegated_loader'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/image/base.rb:235:in `cache_processed_data'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/image/mermaid.rb:44:in `block in init_delegated_loader'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/image/mermaid.rb:43:in `open'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/image/mermaid.rb:43:in `init_delegated_loader'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/image/mermaid.rb:36:in `initialize'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/image.rb:46:in `new'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/image.rb:46:in `initialize'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/element/image.rb:33:in `initialize'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/ext/image.rb:33:in `new'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/ext/image.rb:33:in `make_image'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/ext/image.rb:71:in `make_image_from_file'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown/converter.rb:376:in `make_image_from_file'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown/converter.rb:338:in `convert_codeblock_language'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown/converter.rb:311:in `convert_codeblock'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown/converter.rb:46:in `convert'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown/converter.rb:53:in `block in convert_container'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown/converter.rb:52:in `each'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown/converter.rb:52:in `convert_container'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown/converter.rb:67:in `convert_root'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown/converter.rb:46:in `convert'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser/markdown.rb:124:in `parse'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/parser.rb:38:in `parse'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/canvas.rb:360:in `block in parse'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/canvas.rb:795:in `keep_index'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/canvas.rb:357:in `parse'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/frame.rb:62:in `parse'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/command/rabbit.rb:699:in `parse'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/command/rabbit.rb:861:in `do_display'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/command/rabbit.rb:61:in `block (2 levels) in run'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/command/rabbit.rb:59:in `catch'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/command/rabbit.rb:59:in `block in run'
/usr/share/gems/gems/gobject-introspection-4.1.8/lib/gobject-introspection/loader.rb:705:in `invoke'
/usr/share/gems/gems/gobject-introspection-4.1.8/lib/gobject-introspection/loader.rb:705:in `invoke'
/usr/share/gems/gems/gobject-introspection-4.1.8/lib/gobject-introspection/loader.rb:573:in `activate'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/command/rabbit.rb:54:in `block in run'
/usr/share/gems/gems/gobject-introspection-4.1.8/lib/gobject-introspection/loader.rb:705:in `invoke'
/usr/share/gems/gems/gobject-introspection-4.1.8/lib/gobject-introspection/loader.rb:705:in `invoke'
/usr/share/gems/gems/gobject-introspection-4.1.8/lib/gobject-introspection/loader.rb:573:in `run'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/command/rabbit.rb:67:in `run'
/usr/share/gems/gems/rabbit-3.0.2/lib/rabbit/command/rabbit.rb:29:in `run'
/usr/share/gems/gems/rabbit-3.0.2/bin/rabbit:22:in `<top (required)>'
/bin/rabbit:25:in `load'
/bin/rabbit:25:in `<main>'

With rubygem-rabbit 3.0.2, the following diff makes rabbit.md shown, so I guess something is wrong with mermaid support, or rabbit.md is wrong.

tasaka1@localhost sample]$ diff -u rabbit.md.new rabbit.md
--- rabbit.md.new	2023-07-01 16:24:20.324696251 +0900
+++ rabbit.md	2023-07-01 16:43:40.281475040 +0900
@@ -228,19 +228,6 @@
   fonts="/usr/share/fonts/opentype/ipafont/ipag.ttf, /usr/share/fonts/truetype/vlgothic/VL-Gothic-Regular.ttf"
 }
 
-# Mermaid
-
-```mermaid
-graph TD;
-  A-->B;
-  A-->C;
-  B-->D;
-  C-->D;
-```
-{:
-  relative_height="90"
-}
-
 # 折り返し
 
 なーーーーーーーーーーーーーーーーーーーーーーーーーーーーーがーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーい行は?
@mtasaka
Copy link
Author

mtasaka commented Jul 1, 2023

So something like below?

--- rabbit-3.0.2/lib/rabbit/image/mermaid.rb.orig	2023-07-01 16:24:20.184695994 +0900
+++ rabbit-3.0.2/lib/rabbit/image/mermaid.rb	2023-07-01 17:04:51.861639445 +0900
@@ -15,6 +15,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 require "rabbit/image/pdf"
+require "rabbit/gettext"
 
 module Rabbit
   module ImageManipulable
@@ -23,6 +24,7 @@
       unshift_loader(self)
 
       include SystemRunner
+      include GetText
 
       class << self
         def match?(filename)

@kou kou closed this as completed in 0bc45f0 Jul 1, 2023
@kou
Copy link
Member

kou commented Jul 1, 2023

Good catch!
You're right. I've released a new version.

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