imgurl

Deplate
2009-01-15
2013-04-17
  • Bernhard Grotz

    Bernhard Grotz - 2009-01-15

    I have another question related to the module  imgurl:

    Trying to run deplate with -m imgurl causes the following error:

    Loading module failed: imgurl, uninitialized constant Deplate::Input::Wiki::AbstractImgUrl

    What am I doing wrong?

    Is it generally also impossible to 'include' svg-grahics in this way?

    Greetings and thanks in advance,

    Bernhard

     
    • Tom Link

      Tom Link - 2009-01-15

      Thanks, some modules aren't covered by my test suite.

      You could fix it by replacing Deplate::Input::Wiki::AbstractImgUrl with Deplate::Input::Wiki::ImgUrl in the file lib/deplate/mod/imgurl.rb.

      > Is it generally also impossible to 'include' svg-grahics in this way?

      imgurl replaces links that point to images with the image -- many wikis work this way and somebody asked if deplate could behave similarly.

      Do you want to include the xml code of the svg graphic in the html output or a reference to the svg file? In the former case, how should the (x)html code of an included svg graphic look like? I have to admit that I'm not up to date in this respect. In the latter case, you'd have to change Deplate::Formatter::HTML#image_suffixes. For the moment, you could put this

      def Deplate::Formatter::HTML.image_suffixes
      ['.png', '.jpeg', '.jpg', '.gif', '.bmp', '.wmf', '.svg']
      end

      into ~/.deplate/config.rb or ~/.deplate/after/fmt/html.rb. I have no idea if that works though.

       
      • Tom Link

        Tom Link - 2009-01-17

        The current version in the CVS should be able to handle SVG files (for xhtml output only). The svg can be either included in the html (with an additional include! argument) or being referenced as object.

        E.g.

        #IMG include!: test.svg
        Foo {img: test.svg} bar.

        Please let me know if this causes problems.

         
    • Bernhard Grotz

      Bernhard Grotz - 2009-01-23

      Thank you very much!

      I was quite buisy the last days, so sorry for the late answer. Already your first response, to change the lib/deplate/mod/imgurl.rb, solved the imgurl-problem.

      The second part of your first answer concerning svg-files still causes following error:

      in `load': /home/waldgeist/.deplate/after/fmt/html.rb:1: syntax error, unexpected tCOLON2, expecting '\n' or ';' (SyntaxError)                                                                                                              
      def Deplate::Formatter::HTML.image_suffixes['.png', '....
                                           ^
      /home/waldgeist/.deplate/after/fmt/html.rb:2: syntax error, unexpected kEND, expecting $end

      As soon as I find more time, I will also try the CVS-version. It seems that Deplate causes me to learn ruby... :)

       
      • Tom Link

        Tom Link - 2009-01-23

        There should be a newline before the [, I guess. But this doesn't work anyway because it would refer to the svg image with an <img> tag.

         

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks