projectLEMDO / lemdoIssues

Repository for LEMDO issue tracking and related documents.
MIT License
1 stars 0 forks source link

Add visible rendering for the `<gap>` element #126

Open martindholmes opened 1 year ago

martindholmes commented 1 year ago

We don't really have any rendering for the <gap> element, although it's widely used. In some cases it's used badly:

<gap reason="illegible" extent="1 letter"/>

where I think we should be using:

<gap reason="illegible" unit="em" quantity="1"/>

and I think we should constrain the values of @unit to a subset of valid CSS units. We could easily convert @extent="1 letter" to "@unit="ex" @quantity="1", and then we could render a realistic-sized grey box or similar default, which of course anthologies could override as they wish.

martindholmes commented 1 year ago

I've experimented with this locally, and I think we need a discussion on how to represent gaps: how they should appear initially, whether a switch should be available in the Tools panel to highlight them, and what they should look like when highlighted. Right now they just show up as empty spaces, which is basically puzzling to the reader, I think.

martindholmes commented 1 year ago

After thinking a bit more, this is what I would propose:

  1. Replace @extent with @unit and @quantity, and get rid of @extent from the schema.
  2. Add 'ex' to the allowed values of @unit, since it's closer to what people meant by "letter" in @extent.
  3. Assume that when @unit and @quantity are used, the intention is to describe an inline gap, and process accordingly.
  4. If anyone wants to encode a multiline gap shape, they must do it with @style, in which case we just copy the style to the output and Schematron disallows the use of @unit and @quantity.

How does this sound?

JanelleJenstad commented 1 year ago

That makes good sense.

JanelleJenstad commented 1 year ago

@JanelleJenstad: Record our encoding protocol here. @dim is not allowed on <gap> so it's not possible to indicate that the gap is horizontal or vertical (that's on <space>)

martindholmes commented 1 year ago

Just to clarify: gap and space have entirely different functions:

<gap> (gap) indicates a point where material has been omitted in a transcription, whether for editorial reasons described in the TEI header, as part of sampling practice, or because the material is illegible, invisible, or inaudible.

<space> (space) indicates the location of a significant space in the text.

While <gap> is clearly about content which is or was there in the text, but is now missing because of damage or editorial decision, <space> is much more neutral in definition. I suggest we use <space> only for cases where there is an actual intentional or expected whitespace in the original text, for which we just need to define the size and scale.

For both cases, I believe we should use EITHER:

@unit and @quantity, as follows:

@unit="line", @quantity="2": this is a vertical space/gap of two lines, equivalent to two <lb/> elements.
@unit="ex", @quantity="1": this is a horizontal space/gap, spanning 1ex. It should also be fine to use ems.

OR, for more complex cases, such as a blot-sized space in the middle of a paragraph, we do NOT use @quantity or @unit; instead, we use @style:

@style="display: inline-block; width: 5ex; height: 3em;"

in which case the style is just passed directly through.

In other words, we don't need or use @dim anyway.

What are your thoughts on this?

LEMDO-PM commented 1 year ago

@martindholmes are we still going to use "ex" rather than "em"? If so, can you please add that to the allowed values today? I'll switch the values out so that you can add your rendering.

martindholmes commented 1 year ago

The value 'ex' added to gap/@unit in rev 15569.

JanelleJenstad commented 1 year ago

@LEMDO-PM: Let's add this to documentation now.

JanelleJenstad commented 1 year ago

Reassigning to myself and @LEMDO-PM for documentation.

martindholmes commented 7 months ago

@LEMDO-PM @JanelleJenstad: As far as I can see, all proper usages of <space> and <gap> are rendering correctly, so I think all that's left here is the documentation.