You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
markdown resources cannot be identified because CSS cloaks them as HTML #1021
CSS renders markdown files as HTML, which is very convenient when shown in web browsers, but currently makes it impossible for generic data browsers to know that a given resource is actually markdown canonically.
NSS (besides not doing the conversion) adds a triple like that to the container resource:
<file.md>
a <http://www.w3.org/ns/iana/media-types/text/markdown#> .
But CSS does not. There should be a way for clients to know, that a given HTML resource has a canonical markdown representation. Perhaps CSS can include it as a Link header or HTML meta information and into the container as NSS does.
Practical consequences today are e.g. that the markdown-pane will not show up on CSS, because the data browser only receives HTML content.
but currently makes it impossible for generic data browsers to know that a given resource is actually markdown canonically.
Yes, just send a request to it with an Accept: */*.
adds a triple like that to the container resource:
There is an ongoing discussion about that here: solid/specification#227
but basically, we cannot say for all resources X what their content type is, because they can be represented in multiple content types. For example, if the backend is a SPARQL endpoint, then is an RDF document Turtle? All we know is that we can represent it as triples.
but basically, we cannot say for all resources X what their content type is, because they can be represented in multiple content types. For example, if the backend is a SPARQL endpoint, then is an RDF document Turtle? All we know is that we can represent it as triples.
That's true of course. The question remains how can people actually manage markdown resources on their pod? Even if apps like a markdown editor just requests markdown representation, how could it know, whether it is ok to PUT it back as markdown? Users might need more control which representation format they want to use to read and write. Currently, from a users perspective, CSS just "messes up" the markdown files I put there.
Activity
RubenVerborgh commentedon Oct 22, 2021
Yes, just send a request to it with an
Accept: */*.There is an ongoing discussion about that here: solid/specification#227
but basically, we cannot say for all resources X what their content type is, because they can be represented in multiple content types. For example, if the backend is a SPARQL endpoint, then is an RDF document Turtle? All we know is that we can represent it as triples.
angelo-v commentedon Oct 22, 2021
hmm, not really:
Being explicit works:
Even heavily preferring markdown over html does not work 😱
That's true of course. The question remains how can people actually manage markdown resources on their pod? Even if apps like a markdown editor just requests markdown representation, how could it know, whether it is ok to PUT it back as markdown? Users might need more control which representation format they want to use to read and write. Currently, from a users perspective, CSS just "messes up" the markdown files I put there.
RubenVerborgh commentedon Oct 22, 2021
I was just testing it and saw the same; I think that's a bug.
When this bug is fixed 🙂 Lemme look into it.
RubenVerborgh commentedon Oct 22, 2021
Following up in #1023
The reason I expected it to work, is because the same conversion is not forced for errors:
curl http://localhost:3000/404 -i -s | grep -i Content-Typeand we are using the same mechanism for both.
fix: Do not force Markdown conversion.
RubenVerborgh commentedon Oct 22, 2021
Apparently this was a known bug: #834
fix: Only convert Markdown when needed.
fix: Only convert Markdown when needed.
RubenVerborgh commentedon Oct 22, 2021
@angelo-v Testing for all of your cases now: https://github.com/solid/community-server/pull/1024/files#diff-1dcee3c46714f0c0dd32236a1e9cf4c7657413b2e6e9bb9d45a614b7837dec42
fix: Only convert Markdown when needed.
jvherweg commentedon Nov 8, 2021
Done in #1030. Will be part of v3.0.0 release.