Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

Added "Figure: " prefix to captions in both HTML and Markdown outputs

Open Xinlu-Y opened this issue 1 year ago • 3 comments

Closes #702

  • HTML Output: Updated the image function to include "Figure: " before the caption text in the
    element.
  • Markdown Output: Modified the image function to prepend "Figure: " to the caption in the generated Markdown content.

Xinlu-Y avatar Aug 07 '24 13:08 Xinlu-Y

The changes to stable look good to me.

smiths avatar Aug 07 '24 14:08 smiths

I've updated the relevant code to ensure that the emptiness of c is checked before calling makeFigure. However, I'm unsure about the potential impact of changing the Caption type to Maybe Caption within the Figure constructor. It appears that two Nothing checks are necessary in printLo: one to handle the validity of Maybe Spec, and another to validate the content within Spec itself.

Xinlu-Y avatar Aug 16 '24 15:08 Xinlu-Y

The change should go even further up: Figure as defined in drasil-lang (i.e. in Language.Drasil.Document.Core) should already have the information in it whether there is a caption or not. Might as well introduce a new data-type (HasCaption) with cases NoCaption and Caption for that. Then propagate this information through.

JacquesCarette avatar Aug 16 '24 20:08 JacquesCarette