Comments (7)
@stefanprobst if you don't have time for this, could you please give me some pointers as to how and where in the code one would set this up. many thanks in advance.
from dariah-campus.
To test this, I put showCaptions: ['title', 'alt']
into gatsby-config.js and rebuilt the site.
It works very nicely for:
![Diagram 1. Controlled vocabularies in data architecture](images/cv_and_skos_model_diagram_1.png)
but it doesn't work for remote urls:
![Снимок экрана 2019-07-05 в 16.00.22](https://i.imgur.com/YhTjSk7.png)
In the latter case, no figcaption gets generated. Do you know why? Is this a feature or a bug?
from dariah-campus.
thanks, i'll look into this.
regarding defaulting to alt
as fallback caption -- from an accessibility perspective i'm not sure if this is advisable: alt
should describe what is in the image, which might not be what should be visible as image caption
from dariah-campus.
btw any reason we cannot pull the image from imgur to our repo?
from dariah-campus.
ok, so what's happening is that gatsby-remark-images
will look for image
and imageReference
nodes in the parsed markdown AST, and (i) hooks the image up with gatsby's image processing, and (ii) optionally adds a figcaption. remote urls are of course parsed differently (as link
, see https://github.com/syntax-tree/mdast#link) -- so the easiest is to pull post images into the repo. alternatively we would have to write our own little plugin for remark
(the markdown parser)
from dariah-campus.
regarding defaulting to
alt
as fallback caption -- from an accessibility perspective i'm not sure if this is advisable:alt
should describe what is in the image, which might not be what should be visible as image caption
you're absolutely right. alt is very important for accessibility but we haven't been enforcing proper use of it on D-C. we probably should.
i think the most pragmatic solution then would be to:
- leave the markdown images as they are, i.e. use
[alt-text](link-to-image.png)
— this has been working with local images and with imgur, so it's all good. - auto-wrap markdown images via mdxprovider to use ImageLightbox
the users would then have two options to create images:
- in markdown (preferred solution, if they don't need a caption)
- using ImageLightbox component (the only solution, if they want a caption) — we'll just need to add captions as props (as discussed in #51)
both of the above will, in the end, be displayed as lighboxes, but only those created with the ImageLighbox component, will be able to display a caption.
so, two questions:
- does what I just outlined above sound sensible to you?
- can we use remote images (i.e. imgur) directly in the ImageLighbox component?
from dariah-campus.
in the new DC version, adding captions to images via title
should now work correctly (see custom rehype plugin)
from dariah-campus.
Related Issues (20)
- [new resource]: Corpus Analysis with spaCy HOT 1
- [new resource]: Transcribing Handwritten Text with Python and Microsoft Azure Computer Vision HOT 1
- [new resource]: Creating Interactive Visualizations with Plotly HOT 1
- Introduction to Collections as data HOT 6
- [new resource]: Introduction to Cultural Heritage Data HOT 1
- [new resource]: Introduction to Cultural Heritage Data Modeling — with a focus on EDM HOT 1
- [new resource]: Introduction to Europeana APIs HOT 1
- change css breakpoints for resource pages
- Amend 'Published' in Full Metadata
- Digital Exhibition Design HOT 1
- FAIR Multidimensional Data HOT 2
- Digitisation Methods for Material Culture HOT 1
- Photogrammetry 3D Digitisation HOT 1
- Digitisation with 360 Degrees Photography HOT 1
- Data Ethics in Cultural Heritage HOT 1
- Copyright of 3D Data HOT 1
- Creating Stories with 3D Data on the Web HOT 1
- Evaluation of Digital Heritage Experiences HOT 1
- elexis draft content HOT 1
- [new resource]: ENCODE #dariahTeach course HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dariah-campus.