-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Metadata in Content Document (xHTML files) #54
Comments
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
There are many ways to add metadata to HTML files, but as they're not specific to EPUB they are not detailed in the EPUB specification. Have a look at RDFa and microdata, in particular, if you need to annotate content in the body, and there's also JSON-LD that can be embedded in a |
Hi @mattgarrish Thank you for sharing the information. That was very helpful. I have a follow up query which I have stated below. Lets say that I have following tag in my HTML and I want to tag it with a skill "RL.2.1" as defined here: https://casenetwork.imsglobal.org/uri/6b33f0bc-d7cc-11e8-824f-0242ac160002
They key consideration here is that the skill value "RL.2.1" should not be rendered/shown in the browser.
As per Microdata, I believe I need add a child meta element as shown below
As per RDFa, I believe I need add a child meta element as shown below
In case multiple skills are to be tagged to this element, I believe multiple elements can be added as shown below:
Is the above understand correct Or is there any other standard way for acheiving this ? Please advise. As per HTML spec, there is a "data-*" custom attribute which can be used to add custom metadata on any HTML element.
Which way would you recommend to move forward with. |
Which approach you use depends on what you need the metadata for. If you're just adding the information for processing by another script you've written, I probably wouldn't use the formal metadata frameworks like RDFa or microdata. They can be more difficult to process. If you want other applications to be able to harvest the information from the document (e.g., google search), using a standard framework will make that simpler. |
Hi @mattgarrish Thank you for your recommendation. Could you please confirm following 2 points:
|
Hi @mattgarrish Let me know your thoughts on the above comment. |
On a quick glance, you're not saying what the metadata is about. You've only set an itemscope for the microdata, for example. You need either an itemtype or an itemref to say what it is about (the subject of the triples). RDFa doesn't have itemscope. For it, you need to set typeof and/or resource. You can test your markup using Google's tools: https://developers.google.com/search/docs/appearance/structured-data
No, I was only saying that data-* attributes can be simpler to author and process than RDFa and microdata. There is a lot of expressive power in those frameworks and I don't know if you need it all. If you're not interested in creating graphs and triples from the data, it might be simpler to create a slimmed down markup model using data-* attributes that you can parse more easily. Only you can answer which provides the information you to best suit your application. |
I have an an application which runs in Browser and is similar to ePUB Reader. There is a requirement to add metadata tags in the content e.g. a paragraph in the HTML files.
I have reviewed the ePUB specification which talks about adding the metadata in the node of Package file (*.opf file). However it doesn't talk about how to tag the metadata to a specific content element (say
tag) in the content documents i.e. xHTML file.
Is there any specification / standard to add the metadata in the content documents (.xHTML files) ?
The text was updated successfully, but these errors were encountered: