Open eyeseast opened 3 months ago
Solr is already marking text for us as <em>
tags: https://github.com/MuckRock/documentcloud/blob/master/config/solr/solrconfig.xml#L1331-L1339
Might be nice to switch those to <mark>
since that's more semantic.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark
A big chunk of src/structure/document.js
is concerned with transforming highlights. I wonder if we actually need all of that or if we can rely on what Solr gives us.
Here's what highlights look like: https://api.www.documentcloud.org/api/documents/search/?q=boston&hl=true&expand=user,organization
We currently show page thumbnails (smaller than main document thumbnails) for each text highlight, and we link to the relevant page:
For note highlights, we link to the relevant note:
Need to represent the in-document search results, too:
API response: https://api.www.documentcloud.org/api/documents/24438447/search/?q=%22Los%20Angeles%22
Just saw this screenshot and really liked its approach to providing inline highlights as a list of results. https://ulysses.app/
Current version: https://www.documentcloud.org/app?q=boston
API: https://api.www.documentcloud.org/api/documents/search/?q=boston&hl=true&expand=user,organization
Highlights are both pages and notes.