Babel for HTML

Here’s a little philosophical question. (This doesn’t affect the Babel doc, but it’s related.)

I have proactively added meta tags to the Parchment pages on my web site. For example, https://eblong.com/zarf/zweb/shade/ now has the tags:

  <meta prefix="ifiction: http://babel.ifarchive.org/protocol/iFiction/" property="ifiction:ifid" content="ZCODE-3-001127-C86D">
  <meta prefix="ifiction: http://babel.ifarchive.org/protocol/iFiction/" property="ifiction:tuid" content="hsfc7fnl40k4a30q">

I included both the IFID and TUID, because why not, right? The Babel doc now describes both <ifid> and <tuid> tags – that went in last year – so ifiction:tuid is a reasonable property name.

However, I see that IFDB’s XML has its own namespace. When you do an XML query, you get (abbreviated example):

	<story>
		<ifdb xmlns="http://ifdb.org/api/xmlns">
			<tuid>mohwfk47yjzii14w</tuid>
			<link>https://ifdb.org/viewgame?id=mohwfk47yjzii14w</link>
			<coverart>
				<url>https://ifdb.org/viewgame?id=mohwfk47yjzii14w&amp;coverart</url>
			</coverart>
			<averageRating>4.4884</averageRating>
			<starRating>4.5</starRating>
			<ratingCountAvg>432</ratingCountAvg>
			<ratingCountTot>433</ratingCountTot>
		</ifdb>
	</story>

So maybe my website should say

  <meta prefix="ifdb: http://ifdb.org/api/xmlns/" property="ifdb:tuid" content="hsfc7fnl40k4a30q">

instead?

(The RDFa prefix has to end with a slash or hash sign, looks like.)

This is a question with no consequences right now. But maybe someone wants to create a Chrome extension that pops up IFDB info when viewing a web page, or something.

I’m skeptical that a <meta> tag for TUIDs makes sense. Anyone who wants to pop up IFDB info when viewing a web page should ideally use the IFDB API to look up the game by IFID.

https://ifdb.org/search?xml&game&searchfor=ifid:EB12BAF9-37F9-459B-B65B-B32B96DBF254

But, purely philosophically, if we did want to put a TUID in the <head> for some reason, I think it would be best to just link to IFDB. The normal way to include invisible links in the <head> is to use a <link> tag.

<link rel="alternate ifdb"
  href="https://ifdb.org/viewgame?id=ap1651hvjldbuugj">

(Note that we can’t do this for IFIDs, because there’s nowhere in particular to link to.)

Hm, plausible.

What about the notion of the browser extension, though? If it’s going to fetch XML and display a little info box, it would have to look for the alternate-link URL and then pile query options onto it. That would work but it feels hacky?

The IFID is more available (the author knows it at release time!) but I still wonder whether the TUID will turn out to be a more practical piece of info in the long run.

I feel lucky that the IFID is a better long-run ID.

For one thing, I just remembered that you can get iFiction documents from IFDB directly by IFID, like this:

https://ifdb.org/viewgame?ifiction&ifid=EB12BAF9-37F9-459B-B65B-B32B96DBF254

Given the IFID, that’s all you’d need to show an infobox, with no need for redirects or hackery.

Therefore, I can’t imagine a browser extension that would require games to add a TUID to the <head>. (And just think what a hassle it would be! Authors would have to manually copy and paste the TUID or IFDB URL into their dev system. And for literally no benefit?!)

Now, I suppose if the goal is just to display an infobox, then the browser extension presumably just wants an iFiction doc to do it with; the iFiction doc may or may not be hosted on IFDB.

<link rel="alternate ifiction"
  href="https://ifdb.org/viewgame?ifiction&ifid=EB12BAF9-37F9-459B-B65B-B32B96DBF254">

<link rel="alternate ifiction"
  href="./my-hand-rolled-ifiction.xml">

(I believe MJR had proposed something like this on the Babel list back in 2016.)

I wouldn’t object to defining an ifiction type for <link>, but, again, as long as the IFID is available, I can’t see why anyone would write <link rel=ifiction> or consume it.

I’ve updated the Babel doc to rev11, which includes the info about IFIDs in HTML files.

http://babel.ifarchive.org/

Also the babel tool source to 0.6: The Babel Software Suite

2 Likes

You can now use an *ifid command to embed an IFID in ChoiceScript.

Hopefully soon the ChoiceScript IDE will automatically generate one when you create a new project. Automatically include an `*ifid` in new projects · Issue #132 · ChoicescriptIDE/main · GitHub