#microformats 2021-10-07

2021-10-07 UTC
[tw2113_Slack_], edburns[d], ur5us_, ur5us, gRegor, [tantek]1, IWSlackGateway and [snarfed]1 joined the channel
#
@egonwillighagen
↩️ how do you embed linked data in the Markdown files? HTML had stuff like microformats, RDFa... for Markdown I have not seen much yet. Got tips?
(twitter.com/_/status/1445996868350132226)
hendursaga, aranjedeath, hendursa1, [pfefferle], gRegor and gRegorLove_ joined the channel
#
[tantek]1
yeah lol that's not the point of Markdown
#
[tantek]1
despite the name, people keep trying to turn Markdown in Markup
strugee_ and Zegnat joined the channel
#
[KevinMarks]
You can put html in markdown, then all the features of html are available
#
[tantek]1
"can" — I don't believe that's supported enough for interop
#
[fluffy]
There are markdown extensions that let you add arbitrary HTML attributes to things, although they vary a lot based on processor.
#
[KevinMarks]
It's in the specs, some silos censor html
#
[fluffy]
But once you get to the point of adding attributes to Markdown you’re giving up a lot of the safety and simplicity of Markdown and almost reinventing HTML the long way around.
#
[fluffy]
Not to mention all of the “fun” of dealing with 29380280 different incompatible Markdown extension syntaxes.
marksuth1, [schmarty]1, [tw2113_Slack_]1, [snarfed], IWSlackGateway3 and [fluffy] joined the channel
#
[fluffy]
For the specific case of markdown and microformats it’s generally better to put that on your rendering template and provide a mechanism for sidecar metadata, which most SSG-style publishing systems allow.
#
capjamesg[d]
I do actually put HTML w/ microformats in .md files on my blog. But that's only because I read front-matter values for them and Jekyll supports this behavior.
#
capjamesg[d]
But HTML code itself (templates, full pages, etc.) is always in HTML. No need to complicate things by making the files .md.
#
capjamesg[d]
What syntax are you using in the HTML?
#
[fluffy]
But yeah I agree, Markdown is for content, not templating.
#
capjamesg[d]
Ah. I was confused by the -.
#
capjamesg[d]
I just use {% for x in y %}{% endfor %} without the -
#
[fluffy]
Ah yeah that’s Jinja’s whitespace-eating operator.
#
capjamesg[d]
Ah, I see!
#
capjamesg[d]
That is cool! I had no idea that existed.
#
[fluffy]
Yeah, it’s not well-publicized. It’s nice to keep the generated HTML cleaner and also prevents adding extraneous whitespace.
#
capjamesg[d]
Thanks for sharing! I might start using that in my code! I think my whole IndieWeb stack relies on Flask, aside from my main site.
#
capjamesg[d]
To the original point...
#
[fluffy]
Yeah Publ is based on Flask.
#
capjamesg[d]
I wouldn't write HTML in an .md file that I planned to share unless I knew that the consumer would be able to interpret it (i.e. in the case of Jekyll where I can specify front matter that is then substituted into the HTML). HTML is always first for markup.
#
[fluffy]
Yeah, absolutely agree.
#
capjamesg[d]
Admittedly, I haven't looked into Publ that much. I shall have to do so!
#
[fluffy]
I only use .md for content files, and I only use HTML directly if there’s something .md can’t do cleanly, like complex table structure or iframe embeds or whatever.
#
[fluffy]
But anyway this is like… riding the knife’s edge of #microformats chat
#
capjamesg[d]
Yep. I think we're getting off topic. We can continue in an #indieweb chat.
#
[fluffy]
Basic point being that yeah there’s no reason to support microformats in Markdown itself, it should be handled by your rendering templates + frontmatter/metadata mechanism, or by embedding raw HTML for particularly weird cases.
#
capjamesg[d]
And most parsers are written with HTML content in mind, right?
#
[tantek]1
fluffy, this kind of formats talk is certainly good background for microformats
#
[tantek]1
especially since we're talking about embedding HTML semantics
#
[tantek]1
"embedding raw HTML" should always be treated as "embedding a potentially unbounded security hole"
#
[tantek]1
(given JS holes etc.)
#
[tantek]1
this is maybe the biggest reason why I think putting HTML in markdown is a very bad idea
#
[tantek]1
violates lots of expectations of "safety" and general "staticness"
#
[KevinMarks]
I'm sure there are markdown injection attacks
hendursaga joined the channel
#
capjamesg[d]
[tantek] I don’t trust a markdown parser to do a HTML parsers job.
#
capjamesg[d]
[KevinMarks] That does make sense.
#
capjamesg[d]
I think there is an exception in a well made SSG that supports templating and front matter.
#
capjamesg[d]
Because in that case one is using the front matter for config and then the engine is rendering HTML.
#
capjamesg[d]
But that isn’t ideal.
#
capjamesg[d]
Actually, in my case, the semantics are in the file extension,
#
capjamesg[d]
Which I suspect influences how Jekyll parses a file.
#
capjamesg[d]
I think I should be able to safely change to .html. Because I do have microformats and HTML in the .mds for some post types.
#
@dweekly
↩️ (Gestures at @t and microformats) this was all solved a decade+ ago!
(twitter.com/_/status/1446198924734128129)
#
[tantek]1
loool
[Ed_Beck] and ur5us joined the channel
#
@kevinmarks
↩️ sure, which is why we use them for RelMeAuth - https://microformats.org/wiki/RelMeAuth - https://indielogin.com/ shows how this can work even for a static site without an auth implementation.
(twitter.com/_/status/1446208784867774471)
#
[tantek]1
hah KevinMarks I will start collecting cocktail napkins that have URLs on them just for that 😉
voxpelli_, JSharp, phae, willnorris and gRegor joined the channel