Maven Doxia
  1. Maven Doxia
  2. DOXIA-99

Figures require extension in APT and they should not

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0-alpha-5, 1.0-alpha-6, 1.0-alpha-7, 1.0-alpha-8
    • Fix Version/s: 1.1
    • Component/s: Module - Apt
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Figures require extension in APT and they should not.

      For example, http://ehcache.sourceforge.net/nameandlogo.html shows a broken image. The APT for this page is:

      [images/ehcache_logo]

      Now, if I change it to [images/ehcache_logo.gif] it works. However this breaks aptconvert. The reason is that it is illegal in APT to specify the figure extension. I use aptconvert to create a pdf and single HTML page.

        Issue Links

          Activity

          Hide
          Greg Luck added a comment -

          I checked the source code. The relevant bit is

          XhtmlSink#figureGraphics

          /**

          • @see org.apache.maven.doxia.sink.SinkAdapter#figureGraphics(java.lang.String)
            */
            public void figureGraphics( String name ) { write( " src=\"" + name + "\"" ); }

          I do not see it writing an extension. I think that might be the problem.

          Show
          Greg Luck added a comment - I checked the source code. The relevant bit is XhtmlSink#figureGraphics /** @see org.apache.maven.doxia.sink.SinkAdapter#figureGraphics(java.lang.String) */ public void figureGraphics( String name ) { write( " src=\"" + name + "\"" ); } I do not see it writing an extension. I think that might be the problem.
          Hide
          Dave Syer added a comment -

          What if I want to use PNG figures? How does aptconvert deal with it?

          Show
          Dave Syer added a comment - What if I want to use PNG figures? How does aptconvert deal with it?
          Hide
          Lukas Theussl added a comment -

          The reason why apt doesn't specify the figure extension is that aptconvert can produce output in several formats that do not always support the same figure types (eg latex only supports eps which is not at all supported by html). When a certain format is not found, the apt processor itself tries to convert one of the existing formats. Doxia cannot do that of course. I'd suggest to add something to the Sink API:

          String getFigureExtensions();
          

          or similar, which could return a list of supported graphics formats. The sink then has to check which files exist before writing the result.

          Show
          Lukas Theussl added a comment - The reason why apt doesn't specify the figure extension is that aptconvert can produce output in several formats that do not always support the same figure types (eg latex only supports eps which is not at all supported by html). When a certain format is not found, the apt processor itself tries to convert one of the existing formats. Doxia cannot do that of course. I'd suggest to add something to the Sink API: String getFigureExtensions(); or similar, which could return a list of supported graphics formats. The sink then has to check which files exist before writing the result.
          Hide
          Lukas Theussl added a comment -

          I think it has by now become a de-facto standard in maven land that figures in apt require an extension. Figure sources are just links, and so should be valid and unique as such. Since we have already decided to deviate from the original apt format (see http://docs.codehaus.org/display/DOXIA/Proposed+Changes+to+the+APT+Format), I think it would be the cleanest solution to leave it like that. So a parser should just emit the figure source as is, and any sink can check if it supports the figure format and if not, give a warning, try to convert, look for another source, or whatever.

          One option we could implement for (partial) compatibility with aptconvert is that the AptParser checks if the figure source has an extension, and if not append a default one.

          Show
          Lukas Theussl added a comment - I think it has by now become a de-facto standard in maven land that figures in apt require an extension. Figure sources are just links, and so should be valid and unique as such. Since we have already decided to deviate from the original apt format (see http://docs.codehaus.org/display/DOXIA/Proposed+Changes+to+the+APT+Format ), I think it would be the cleanest solution to leave it like that. So a parser should just emit the figure source as is, and any sink can check if it supports the figure format and if not, give a warning, try to convert, look for another source, or whatever. One option we could implement for (partial) compatibility with aptconvert is that the AptParser checks if the figure source has an extension, and if not append a default one.
          Hide
          Lukas Theussl added a comment -

          Documented on doxia site.

          Show
          Lukas Theussl added a comment - Documented on doxia site.

            People

            • Assignee:
              Lukas Theussl
              Reporter:
              Greg Luck
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: