Maven Doxia
  1. Maven Doxia
  2. DOXIA-75

XhtmlSink#figureCaption() writes an "alt" attribute, but a "title" attribute would also be appropriate

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 1.0-alpha-8
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      It's nice to see the figure caption in a tooltip, so maybe both "alt" and "title" should be written.

        Issue Links

          Activity

          Hide
          Vincent Siveton added a comment -

          I think the best way is to add in the Sink API:

              void figureTitle();
          

          WDYT?

          Show
          Vincent Siveton added a comment - I think the best way is to add in the Sink API: void figureTitle(); WDYT?
          Hide
          Lukas Theussl added a comment -

          I think figureCaption() should write neither alt nor title attributes. A caption is a descriptive text that appears below the figure, like a table caption.

          Show
          Lukas Theussl added a comment - I think figureCaption() should write neither alt nor title attributes. A caption is a descriptive text that appears below the figure, like a table caption.
          Hide
          Lukas Theussl added a comment -

          Working on DOXIA-227 I notice that the handling of images in BaseXhtmlSink and Parser is not what I expected. As I noted above, IMO figureCaption() should not write any alt or title attributes to the img tag. I think these sink events:

                  sink.figure();
                  sink.figureGraphics( "image.gif" );
                  sink.figureCaption();
                  sink.text( "Caption");
                  sink.figureCaption_();
                  sink.figure_();
          

          should lead to something like the following HTML output:

          <div class="figure">
            <p><img src="image.gif"/></p>
            <p>Caption</p>
          </div>
          

          while currently it's just

          <img src="image.gif" alt="Caption"/>
          

          IMO the figure() event should start a block-level, floating image with corresponding caption, while figureGraphics() alone can be used to insert in-line images. This change will not break any source document parsing and rendering, but there will be a backward problem for java classes where events are directly emitted into a sink. Eg the LinkcheckReport Mojo in maven-linkcheck-plugin has the following method for error icons (but I'm pretty sure this was copied from somewhere else):

              private void iconError( Locale locale )
              {
                  getSink().figure();
                  getSink().figureCaption();
                  getSink().text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.icon.error" ) );
                  getSink().figureCaption_();
                  getSink().figureGraphics( "images/icon_error_sml.gif" );
                  getSink().figure_();
              }
          

          With DOXIA-204 this would have to be replaced by

              private void iconError( Locale locale )
              {
                  getSink().figureGraphics( AttributeSet );
              }
          

          where AttributeSet contains the src and alt (and other) attributes.

          Show
          Lukas Theussl added a comment - Working on DOXIA-227 I notice that the handling of images in BaseXhtmlSink and Parser is not what I expected. As I noted above, IMO figureCaption() should not write any alt or title attributes to the img tag. I think these sink events: sink.figure(); sink.figureGraphics( "image.gif" ); sink.figureCaption(); sink.text( "Caption" ); sink.figureCaption_(); sink.figure_(); should lead to something like the following HTML output: <div class= "figure" > <p> <img src= "image.gif" /> </p> <p> Caption </p> </div> while currently it's just <img src= "image.gif" alt= "Caption" /> IMO the figure() event should start a block-level, floating image with corresponding caption, while figureGraphics() alone can be used to insert in-line images. This change will not break any source document parsing and rendering, but there will be a backward problem for java classes where events are directly emitted into a sink. Eg the LinkcheckReport Mojo in maven-linkcheck-plugin has the following method for error icons (but I'm pretty sure this was copied from somewhere else): private void iconError( Locale locale ) { getSink().figure(); getSink().figureCaption(); getSink().text( i18n.getString( "linkcheck-report" , locale, "report.linkcheck.icon.error" ) ); getSink().figureCaption_(); getSink().figureGraphics( "images/icon_error_sml.gif" ); getSink().figure_(); } With DOXIA-204 this would have to be replaced by private void iconError( Locale locale ) { getSink().figureGraphics( AttributeSet ); } where AttributeSet contains the src and alt (and other) attributes.
          Hide
          Lukas Theussl added a comment -

          r635336 adjusted the figure handling according to my comments above. Any attributes like 'title' or 'alt' can now be passed in via SinkEventAttributeSets, see DOXIA-204. The old figure methods (without SinkEventAttributeSets) are kept unchanged for backward compatibility.

          Show
          Lukas Theussl added a comment - r635336 adjusted the figure handling according to my comments above. Any attributes like 'title' or 'alt' can now be passed in via SinkEventAttributeSets, see DOXIA-204 . The old figure methods (without SinkEventAttributeSets) are kept unchanged for backward compatibility.

            People

            • Assignee:
              Lukas Theussl
              Reporter:
              Fabrice Bellingard
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: