IUBLibTech / newton_chymistry

New version of 'The Chymistry of Isaac Newton', using XProc pipelines to generate a website based on TEI XML encodings of Newton's alchemical manuscripts, and Apache Solr as a search engine.
2 stars 0 forks source link

Bibliography Font Rendition: blackletter font and red highlights #57

Closed mdalmau closed 3 years ago

mdalmau commented 4 years ago

Creating a new issue based on the following email. @wehooper could you add more context here so we know what this is about exactly:

Hi Con and Michelle,

AT the meeting, we’ve just looked through the entries in the new authoritative bibliography, and we think it looks fine.

We can take over the problem of implementing the blackletter font and red highlights if not completed and any other developments of this component.

Wally and the team

Conal-Tuohy commented 4 years ago

What is the issue with the blackletter font and red highlights?

mdalmau commented 4 years ago

@wehooper could you review and clarify? I am running through the open issues, tagging those that need future work accordingly, but I am not sure about this one.

wehooper commented 4 years ago

The background issue is that title pages in some of Newton's source publications featured blackletter fonts or red-ink highlights, and we are now planning to reproduce those features if we can.

This is a new, post-NF idea, so we thought Takatomo could/should tackle the problem, presumably in the CSS3. We need to know how those bibl pop-ups work now.

Conal-Tuohy commented 4 years ago

Here's how it works:

There's a biblStruct element which contains the detailed bibliographic data, and in the manuscript transcription there's a bibl element which refers to that biblStruct using a corresp attribute.

The bibl element is transformed to an HTML a element, and the biblStruct data is transformed into a snippet of HTML. See https://github.com/IUBLibTech/newton_chymistry/blob/master/xslt/p5-to-html.xsl#L463-L502 for how the biblStruct elements are transformed to HTML.

Note that the snippet of bibliographic HTML is (temporarily) stored in a serialized form inside the title attribute of that a element, and it's only in a later stage of the pipeline that it is extracted from the title attribute and used as the content for an HTML5 details widget (whose summary is a book icon). This two-step process is an implementation detail which is not directly relevant to the issue at hand, but I'll explain it below. See https://github.com/IUBLibTech/newton_chymistry/blob/master/xslt/lift-title-attributes-to-popups.xsl

So I think you will only need to change the XSLT templates (with the citation-popup mode) which are responsible for generating the HTML snippet from the biblStruct, and also the relevant CSS: https://github.com/IUBLibTech/newton_chymistry/blob/master/static/css/tei.css#L1235-L1260

Conal-Tuohy commented 4 years ago

You might well ask "Why do you first stash this bibliographic data in an attribute and then later convert it to a popup? Why not just generate the popup (details) widget directly from the TEI?". This is an implementation detail not directly relevant to the issue at hand, but to avoid confusion, I will explain that the reason is because of how the Solr indexing is plugged into the system:

NB the Solr index is not generated directly from the TEI but from the HTML which was itself generated from the TEI. There is one set of TEI, but two flavours of HTML generated from it, and hence two Solr indices (diplomatic, and normalized). By generating the Solr index from the HTML, we can be sure that the "highlight" snippets which are returned from a Solr query must always match the HTML which is being displayed, and hence the highlights can be inserted back into the page that's displayed to the user. If the TEI-to-HTML stylesheet is ever modified, then the data in Solr will also reflect that modification.

What this means, though, is that snippets which are interpolated into the manuscript texts (like these bibliographic popups) need to be excluded from the index, otherwise it would be impossible to search for a phrase of Newton's which happened to include a bibliographic reference. So this is why I've stored them inside title attributes; the Solr index is only of the HTML text content, and doesn't include any attribute values.

tubesoft commented 4 years ago

I modified and added on bibiography-to-html.xsl and tei.css. In my local environment, it worked. I committed the code on the branch, "rendition_issues".

wehooper commented 3 years ago

This feature is working as it should. We can close this issue.