From 7c64aa6990227c3459236ae3b09568f22fa15279 Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Fri, 31 May 2024 00:40:44 +1000 Subject: [PATCH 1/3] SVG Map: https://github.com/metanorma/metanorma/issues/160 --- author/topics/blocks/figures.adoc | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/author/topics/blocks/figures.adoc b/author/topics/blocks/figures.adoc index 3ed90c66..62c502db 100644 --- a/author/topics/blocks/figures.adoc +++ b/author/topics/blocks/figures.adoc @@ -415,3 +415,48 @@ image::logo.jpg[] ==== -- ====== + +== Image mapping for SVG + +Metanorma supports SVG as one of its image formats. SVG have the ability to hyperlink parts of the +image to other destinations, expressed as `>; mn://action_schema +* http://www.example.org[]; http://www.example.com +* <>; 3 +==== +---- + +we have SVG file `action_schemaexpg1.svg`, and it contains hyperlinks to three destinations +`mn://action_schema`, `http://www.example.com`, and `3`. The block instructs Metanorma to rewrite +those hyperlink destinations in the SVG, expressed as `>` + + + From b1f9d1c3b3a8458f104a59833bf43384add22988 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Tue, 18 Jun 2024 10:10:14 +0800 Subject: [PATCH 2/3] chore: clean up svg image mapping --- author/topics/blocks/figures.adoc | 79 ++++++++++++++++++++++--------- 1 file changed, 56 insertions(+), 23 deletions(-) diff --git a/author/topics/blocks/figures.adoc b/author/topics/blocks/figures.adoc index 62c502db..5aac5236 100644 --- a/author/topics/blocks/figures.adoc +++ b/author/topics/blocks/figures.adoc @@ -416,24 +416,50 @@ image::logo.jpg[] -- ====== -== Image mapping for SVG -Metanorma supports SVG as one of its image formats. SVG have the ability to hyperlink parts of the -image to other destinations, expressed as ``. +When an SVG image is created independently of the current document, the +hyperlinks may point to arbitrary destinations. + +A document author may want to update these hyperlinks to point to anchors within +the document. Metanorma supports the re-mapping of SVG +hyperlinks to have them point to parts of a Metanorma document. + +The `svgmap` function supports the re-mapping of SVG +hyperlinks [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.8.3]. +To use this, the SVG image is wrapped in a figure block with the role attribute +`[.svgmap]` instead of `[figure]`. + +The syntax of `svgmap` is as follows. + +[source,asciidoc] +---- + [.svgmap] +==== +image::{filename}.svg[] <1> + +* {remapped-link-1}; {original-link-1} <2> <3> +* ... +==== +---- +<1> `{filename}.svg` is the filename of the SVG image with hyperlinks. +<2> `{remapped-link-1}` is the desired destination that replaces +`{original-link-1}`, it could be a hyperlink or a cross-reference. +<3> `{original-link-1}` is an existing hyperlink (content of the `href`) in the SVG +image. The links are separated by a semicolon. + +This allows the author to easily update the hyperlinks within the SVG image to +point to the appropriate locations in the current document. + +.Example of `svgmap` usage +====== +In this block: [source,asciidoc] ---- @@ -447,16 +473,23 @@ image::action_schemaexpg1.svg[] ==== ---- -we have SVG file `action_schemaexpg1.svg`, and it contains hyperlinks to three destinations -`mn://action_schema`, `http://www.example.com`, and `3`. The block instructs Metanorma to rewrite -those hyperlink destinations in the SVG, expressed as `>` +* `mn://action_schema` +* `http://www.example.com` +* `3` +This block instructs Metanorma to rewrite those hyperlink destinations in the +SVG, expressed as ``, to point to the location of the references +on the left side: +* `mn://action_schema` is rewritten to the location in the document of the +`ref1` anchor (or bibliographic reference); the optional cross-reference text, +`Computer`, is inserted in the SVG hyperlink, replacing whatever text is already +there, and can be used as a mouseover tip. +* `http://www.example.com` is rewritten to `http://www.example.org`. + +* `3` is rewritten as the destination of the implicit cross-reference +`<>`. +====== From 19d2760291da8c1641675b3b387bbb1eb13bf5cc Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Tue, 18 Jun 2024 10:10:22 +0800 Subject: [PATCH 3/3] chore: fix broken table --- author/itu/topics/markup.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/author/itu/topics/markup.adoc b/author/itu/topics/markup.adoc index b30a439d..cd1732d9 100644 --- a/author/itu/topics/markup.adoc +++ b/author/itu/topics/markup.adoc @@ -46,9 +46,9 @@ Renders as: ____ |=== h|Editors: |Andreas Reis | E-mail: pujaris@who.int -| |World Health Organization +| |World Health Organization | | |Sameer Pujari | E-mai: pujaris@who.int -| |World Health Organization +| |World Health Organization | |=== ____ @@ -263,7 +263,7 @@ e.g. NOTE: This editorial rule is mandated by the ITU Editorial Team, but is not described in the ITU-T Author's Guide. -Table titles and column titles are automatically +Table titles and column titles are automatically capitalised [added in https://github.com/metanorma/isodoc/releases/tag/v2.4.3]. To prevent this, you will need to set the capitalisation of the initial word to "none", using CSS: