翻译者:Yuyan Jiang
原文链接:https://iiif.io/api/cookbook/recipe/0007-string-formats/

将 HTML 嵌入描述性属性中

专题首页 | 专题列表

用例

您希望通过向选定的文本块添加链接或简单格式化说明在控制元数据的显示方式更有掌控性。例如,科学名称可能需要特殊的格式化,并链接到其他站点并使其受益。遗留系统的输出中还可能包含基本格式。
实施说明
您可以仅在属性和对象中的属性中包含最少的 HTML 标记。不允许使用 HTML 或其他属性。您的 HTML 必须格式良好的XML ,因此必须包裹在一个元素p或span中。
要提醒内容是的消费应用程序, 字符串中的第一个字符必须是”<”,最后一个字符必须是”>”。如果您的内容是纯文本,但恰好以上面所述的角度括号开始和结束,请在值的末尾添加额外的空白字符。
限制
出于安全原因,客户只允许 a, b, br, i, img, p, small, span, sub, 和 sup 标签并可以删除任何或全部的上述标签。有关允许和禁止的标记的更多详细信息, 请参阅说明.
样例
JSON-LD | 在Universal Viewer中查看 | 在Mirador中查看

  1. {
  2. "@context": "http://iiif.io/api/presentation/3/context.json",
  3. "id": "https://iiif.io/api/cookbook/recipe/0007-string-formats/manifest.json",
  4. "type": "Manifest",
  5. "label": {
  6. "en": [
  7. "Picture of Göttingen taken during the 2019 IIIF Conference"
  8. ]
  9. },
  10. "summary": {
  11. "en": [
  12. "<p>Picture taken by the <a href=\"https://github.com/glenrobson\">IIIF Technical Coordinator</a></p>"
  13. ]
  14. },
  15. "metadata": [
  16. {
  17. "label": {
  18. "en": [
  19. "Author"
  20. ]
  21. },
  22. "value": {
  23. "none": [
  24. "<span><a href='https://github.com/glenrobson'>Glen Robson</a></span>"
  25. ]
  26. }
  27. }
  28. ],
  29. "rights": "http://creativecommons.org/licenses/by-sa/3.0/",
  30. "requiredStatement": {
  31. "label": {
  32. "en": [
  33. "Attribution"
  34. ]
  35. },
  36. "value": {
  37. "en": [
  38. "<span>Glen Robson, IIIF Technical Coordinator. <a href=\"https://creativecommons.org/licenses/by-sa/3.0\">CC BY-SA 3.0</a> <img src=\"https://licensebuttons.net/l/by-sa/3.0/88x31.png\"/></span>"
  39. ]
  40. }
  41. },
  42. "items": [
  43. {
  44. "id": "https://iiif.io/api/cookbook/recipe/0007-string-formats/canvas/p1",
  45. "type": "Canvas",
  46. "height": 3024,
  47. "width": 4032,
  48. "items": [
  49. {
  50. "id": "https://iiif.io/api/cookbook/recipe/0007-string-formats/page/p1/1",
  51. "type": "AnnotationPage",
  52. "items": [
  53. {
  54. "id": "https://iiif.io/api/cookbook/recipe/0007-string-formats/annotation/p0001-image",
  55. "type": "Annotation",
  56. "motivation": "painting",
  57. "body": {
  58. "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/full/max/0/default.jpg",
  59. "type": "Image",
  60. "format": "image/jpeg",
  61. "height": 3024,
  62. "width": 4032,
  63. "service": [
  64. {
  65. "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen",
  66. "profile": "level1",
  67. "type": "ImageService3"
  68. }
  69. ]
  70. },
  71. "target": "https://iiif.io/api/cookbook/recipe/0007-string-formats/canvas/p1"
  72. }
  73. ]
  74. }
  75. ]
  76. }
  77. ]
  78. }

相关专题
o 最简单的清单-单个图片文件