projectLEMDO / lemdoIssues

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

DRE/NISE/LEMDO: Icons for annotations/collations to appear after punctuation #235

Open JackWilton1594 opened 1 month ago

JackWilton1594 commented 1 month ago

The annotation and collation icons current appear immediately after the anchor. This looks rather ugly when the anchor is followed immediately by punctuation, as in the following examples from 1HW:

Screen Shot 2024-06-06 at 15 55 00

Screen Shot 2024-06-06 at 15 55 13

Is there a way to render the icons after any punctuation that follows an anchor without changing the location of the anchors themselves?

In the above examples, that would mean:

That way, we can remain precise with our apparatus/lemma.

martindholmes commented 1 month ago

Put your anchor where you would like the symbol to appear. If the collation focus relates to what appears before the period but not the period, then the collation symbol should appear before the period, otherwise it's misleading. If the collation focus includes the period (maybe the period is missing in one of the witnesses, for instance), then put the anchor after it. This isn't a question of style; the two positions have different meanings, surely?

JackWilton1594 commented 1 month ago

That's a fair assumption, but not all instances are being treated this way. Janelle and I spotted an example where the lemma was "apples" and the icon was placed after the question mark that followed (i.e., "apples? [icon]").

I agree that we shouldn't tag to suit the platform. Isn't there a programmatic way to render the icons after punctuation? -- Dr Brett Greatley-Hirsch Associate Professor of Renaissance Literature and Textual Studies

School of English, University of Leeds, Woodhouse Lane, Leeds LS2 9JT ... Coordinating Editor, Digital Renaissance Editions

Co-editor, Shakespeare (Routledge) http://www.notwithoutmustard.net

On Fri, 7 Jun 2024, 23:51 Martin Holmes, @.***> wrote:

Put your anchor where you would like the symbol to appear. If the collation focus relates to what appears before the period but not the period, then the collation symbol should appear before the period, otherwise it's misleading. If the collation focus includes the period (maybe the period is missing in one of the witnesses, for instance), then put the anchor after it. This isn't a question of style; the two positions have different meanings, surely?

— Reply to this email directly, view it on GitHub https://github.com/projectLEMDO/lemdoIssues/issues/235#issuecomment-2155667876, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABENUFB7VNMOAFRMBJRT5RTZGI2ODAVCNFSM6AAAAABI5TKS6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJVGY3DOOBXGY . You are receiving this because you authored the thread.Message ID: @.***>

martindholmes commented 4 weeks ago

I think what you saw was bad encoding there. If the question mark wasn't part of the thing being collated or annotated, the anchor should be moved to the right location. I don't believe we should ever second-guess the editor's intention by moving an anchor that they have carefully placed. If you think that all DRE anchors should be placed after punctuation as a matter of anthology style, then that should be in the DRE documentation, surely, but I think it ends up misrepresenting the truth and eliminating a useful nuance.

I actually do have a gnarly procedure for moving anchors like this in the PDF rendering, because that's going to print, and that was a specific request of the original publisher, who is now no longer involved. It's ugly code and prone to issues -- what happens with a nested quotation ending in a question mark, for example?

JackWilton1594 commented 3 weeks ago

Placement of the icon and the thing being annotated are two different things.

I don't want to change how editors mark their anchors, only where the icons are rendered.

There's no loss of nuance and it's not a misrepresentation because the lemma is reproduced in the pop-up header. (It's also no more or less a misrepresentation than adding a footnote to the end of a paraphrased sentence rather than immediately following the quotation.)

Arguably, the current display is impeding nuance, especially when the punctuation is pushed onto the next line. Punctuation can alter the meaning of the line; thus, the icon is delaying the complete and accurate reading :expressionless: ! <-- case in point?

martindholmes commented 3 weeks ago

If the problem is the pushing of punctuation to the next line, then we should address that. But if we have a consensus that all annotation markers should be moved around punctuation, we'll need to create a set of rules for how this is done. It's not trivial, because you can have sequences of several punctuation characters.

JackWilton1594 commented 3 weeks ago

I appreciate that, but I do think it will be worth it.

martindholmes commented 3 weeks ago

It'll also add substantial time to the build process, unfortunately. I think we'll need a clear consensus on this, as well as a detailed specification; before adding to the build time for everyone, we need to determine whether it's only for DRE, and if so, we should do it as a post-process for DRE files only, to keep the time under control.

There's also the question of shared anchors. Let's say an editor inserts an anchor X just before a question mark. They use this anchor as the terminating anchor for one annotation, and as the initial anchor for another annotation, which is commenting directly on the question mark itself. If we move that anchor to after the question mark, then the second annotation is not linked to any text at all because its starting anchor is right next to its ending anchor.

If we do this as a post-process on the XML itself, the net effect will be to separate the annotation or collation symbol from the text that it comments on; so the text leading up to the question mark would be a clickable link, but the question mark wouldn't, and then the icon would appear after the question mark. Would that be confusing?

JackWilton1594 commented 3 weeks ago

I appreciate that. None of this was problematic when we were simply using underlining as there was no effect on the positioning of text/punctuation. However, I can see how the icons are an accessibility issue and should be kept.

If it were less onerous to fix, I'd say we should go ahead. But, at the end of the day, users can always toggle the annotations/collations off if they want a clean and clear reading text, so perhaps it's something we can set aside for more luxurious times.

JanelleJenstad commented 3 weeks ago

@JackWilton1594: Navarra, @martindholmes, and I have just met and we have a plan. It will add time to the build process but we'll give it a go.

We'll do the moving in the post-processing (xHTML) phase so that the XML remains truthful.

Rules:

  1. Move marker to AFTER all punctuation (commas, periods, question marks, exclamation marks, quotation marks) EXCEPT dashes.
  2. Leave marker where editor has placed the terminal anchor in the case of dashes. (Placement will have to be checked in the proofing phase.)
martindholmes commented 2 weeks ago

After thinking about this for a bit, I believe we should put this process into the anthology build, not the main lemdo-dev build. At anthology build time, we do a pass through every HTML document anyway, so it wouldn't involve an additional pass, just slow down that pass a bit. Only plays already included in an anthology build would have to undergo the process, which reduces the scale of it and the time taken. It would also enable specific anthologies to opt out of the change if they want to. Finally, it would allow editors working on texts to see the actual position of their final markers in the lemdo-dev view, rather than seeing a confusing mismatch between the position of the anchor in the XML and the appearance of the marker in the output.

JanelleJenstad commented 2 weeks ago

@martindholmes: That's a brilliant solution!

martindholmes commented 2 weeks ago

Doesn't make the implementation any less tricky, but it does tell me where to write it. :-) And if builds break while I'm working on it, they'll only be anthology builds.

martindholmes commented 4 days ago

First partially-working implementation in rev 18584. I have some edge-cases to handle yet.

martindholmes commented 4 days ago

As of rev 18586, this is mostly working, but I'm aware of two cases in 1HW where text is being reiterated for some reason I can't figure out; I've added XSpec tests using exactly the code in the source page, but those tests are passing running XSpec in Oxygen; it's possible we've hit an obscure bug in the relatively old Saxon that the LEMDO build is using. This needs more investigation. In the meantime, @JackWilton1594 if you take a look at DRE builds as of a few hours from this post, you should see things working in most cases, but please let me know of any oddities you see; look out for repeated text in speeches, especially following commas.