diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2023-03-22 20:15:54 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2023-03-26 20:09:09 +0200 |
commit | 34e5444986bffa80153887c73cade195806a1cb6 (patch) | |
tree | 0c3b8cce6ad606812c6015269a9eb7827b038816 | |
parent | dec84daa07755426b0aca471112c010aa1b9777e (diff) | |
download | tracker-34e5444986bffa80153887c73cade195806a1cb6.tar.gz |
docs: Make flag icons themeable
Instead of including them as images, inline and theme them like
we do with other SVGs, this makes them look better on dark themes,
other than being a non-descript grey.
8 files changed, 36 insertions, 161 deletions
diff --git a/docs/reference/libtracker-sparql/images/icon-deprecated.svg b/docs/reference/libtracker-sparql/images/icon-deprecated.svg index 23ed33b17..adbe9cb10 100644 --- a/docs/reference/libtracker-sparql/images/icon-deprecated.svg +++ b/docs/reference/libtracker-sparql/images/icon-deprecated.svg @@ -1,71 +1 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - width="16" - viewBox="0 0 16 16" - version="1.1" - id="svg7384" - height="16"> - <metadata - id="metadata90"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <title - id="title9167">Gnome Symbolic Icon Theme</title> - <defs - id="defs7386"> - <linearGradient - osb:paint="solid" - id="linearGradient7212"> - <stop - style="stop-color:#000000;stop-opacity:1;" - offset="0" - id="stop7214" /> - </linearGradient> - </defs> - <g - transform="translate(-39.9997,39.98872)" - style="display:inline" - id="layer1" /> - <g - transform="translate(-280.9999,406.98872)" - style="display:inline" - id="layer9" /> - <g - transform="translate(-280.9999,406.98872)" - style="display:inline" - id="g7628" /> - <g - transform="translate(-39.9997,39.98872)" - style="display:inline" - id="g6387" /> - <g - transform="translate(-39.9997,39.98872)" - style="display:inline" - id="layer10" /> - <g - transform="translate(-39.9997,39.98872)" - id="layer12"> - <path - d="m 47.90615,-39.89497 c -0.5255,-0.0286 -1.03823,0.28305 -1.4375,0.96875 l -6.25,11.59375 c -0.53347,0.96339 0.04822,2.34375 1.09375,2.34375 h 13.15625 c 0.98172,0 1.90311,-1.15939 1.21875,-2.34375 l -6.3125,-11.53125 c -0.39872,-0.64617 -0.94325,-1.00262 -1.46875,-1.03125 z m 0.0625,3.9375 c 0.54448,-0.0172 1.04849,0.48677 1.03125,1.03125 v 3.9375 c 0.007,0.52831 -0.47163,1 -1,1 -0.52836,0 -1.00747,-0.47169 -1,-1 v -3.9375 c -0.008,-0.4666 0.3541,-0.91253 0.8125,-1 0.0511,-0.0145 0.10345,-0.02495 0.15625,-0.03125 z m 0.03125,6.96875 c 0.552285,0 1,0.447715 1,1 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 z" - id="path18112" - style="color:#bebebe;display:inline;overflow:visible;visibility:visible;fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;enable-background:new" /> - </g> - <g - transform="translate(-39.9997,39.98872)" - style="display:inline" - id="layer11" /> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 16 16" version="1.1" height="16"><g id="icon-deprecated" class="icon"><rect width="16" height="16" fill="#00000000"/><g transform="translate(-39.9997,39.98872)"><path d="m 47.90615,-39.89497 c -0.5255,-0.0286 -1.03823,0.28305 -1.4375,0.96875 l -6.25,11.59375 c -0.53347,0.96339 0.04822,2.34375 1.09375,2.34375 h 13.15625 c 0.98172,0 1.90311,-1.15939 1.21875,-2.34375 l -6.3125,-11.53125 c -0.39872,-0.64617 -0.94325,-1.00262 -1.46875,-1.03125 z m 0.0625,3.9375 c 0.54448,-0.0172 1.04849,0.48677 1.03125,1.03125 v 3.9375 c 0.007,0.52831 -0.47163,1 -1,1 -0.52836,0 -1.00747,-0.47169 -1,-1 v -3.9375 c -0.008,-0.4666 0.3541,-0.91253 0.8125,-1 0.0511,-0.0145 0.10345,-0.02495 0.15625,-0.03125 z m 0.03125,6.96875 c 0.552285,0 1,0.447715 1,1 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 z" /></g></g></svg> diff --git a/docs/reference/libtracker-sparql/images/icon-fulltextindexed.svg b/docs/reference/libtracker-sparql/images/icon-fulltextindexed.svg index 912fe3ff0..2554b6ba2 100644 --- a/docs/reference/libtracker-sparql/images/icon-fulltextindexed.svg +++ b/docs/reference/libtracker-sparql/images/icon-fulltextindexed.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g color="#000" font-weight="400" font-family="sans-serif" fill="#474747"><path d="M6.508 1C3.48 1 1.002 3.473 1.002 6.5c0 3.026 2.478 5.5 5.506 5.5s5.504-2.474 5.504-5.5c0-3.027-2.476-5.5-5.504-5.5zm0 2a3.486 3.486 0 013.504 3.5c0 1.944-1.556 3.5-3.504 3.5a3.488 3.488 0 01-3.506-3.5C3.002 4.555 4.56 3 6.508 3z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;marker:none" overflow="visible"/><path d="M10 8.99a1 1 0 00-.695 1.717l4.004 4a1 1 0 101.414-1.414l-4.004-4A1 1 0 0010 8.99z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;marker:none" overflow="visible"/></g></svg>
\ No newline at end of file +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g id="icon-fulltextindexed" class="icon"><rect width="16" height="16" fill="#00000000"/><path d="M6.508 1C3.48 1 1.002 3.473 1.002 6.5c0 3.026 2.478 5.5 5.506 5.5s5.504-2.474 5.504-5.5c0-3.027-2.476-5.5-5.504-5.5zm0 2a3.486 3.486 0 013.504 3.5c0 1.944-1.556 3.5-3.504 3.5a3.488 3.488 0 01-3.506-3.5C3.002 4.555 4.56 3 6.508 3z" overflow="visible"/><path d="M10 8.99a1 1 0 00-.695 1.717l4.004 4a1 1 0 101.414-1.414l-4.004-4A1 1 0 0010 8.99z" overflow="visible"/></g></svg>
\ No newline at end of file diff --git a/docs/reference/libtracker-sparql/images/icon-multivalue.svg b/docs/reference/libtracker-sparql/images/icon-multivalue.svg index 5990d7521..62da56a38 100644 --- a/docs/reference/libtracker-sparql/images/icon-multivalue.svg +++ b/docs/reference/libtracker-sparql/images/icon-multivalue.svg @@ -1,70 +1 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - width="16" - viewBox="0 0 16 16.03899" - version="1.1" - id="svg7384" - height="16.03899"> - <metadata - id="metadata90"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <title - id="title9167">Gnome Symbolic Icon Theme</title> - <defs - id="defs7386"> - <linearGradient - osb:paint="solid" - id="linearGradient7212"> - <stop - style="stop-color:#000000;stop-opacity:1;" - offset="0" - id="stop7214" /> - </linearGradient> - </defs> - <g - transform="translate(-320.98275,227.01492)" - style="display:inline" - id="layer9"> - <path - id="rect3806" - d="m 324.17969,-227.01562 c -1.2016,0 -2.19727,1.00124 -2.19727,2.20117 V -224 h 2 v -0.81445 c 0,-0.1309 0.0735,-0.20117 0.19727,-0.20117 h 9.60742 c 0.12378,0 0.19531,0.0703 0.19531,0.20117 V -224 h 2 v -0.81445 c 0,-1.19993 -0.99372,-2.20117 -2.19531,-2.20117 z" - style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> - <path - id="path3848" - d="m 324.17969,-215.00781 c -1.2016,0 -2.19727,1.00124 -2.19727,2.20117 v 1.83008 h 2 v -1.83008 c 0,-0.13089 0.0735,-0.20117 0.19727,-0.20117 h 9.60742 c 0.12378,0 0.19531,0.0703 0.19531,0.20117 v 1.78711 h 2 v -1.78711 c 0,-1.19993 -0.99372,-2.20117 -2.19531,-2.20117 z" - style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> - <path - id="path3856" - d="m 324.17969,-223.01562 c -1.2016,0 -2.19727,1.00124 -2.19727,2.20117 V -220 h 2 v -0.81445 c 0,-0.1309 0.0735,-0.20117 0.19727,-0.20117 h 9.60742 c 0.12378,0 0.19531,0.0703 0.19531,0.20117 V -220 h 2 v -0.81445 c 0,-1.19993 -0.99372,-2.20117 -2.19531,-2.20117 z" - style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> - <path - id="path3858" - d="m 324.17969,-219.01562 c -1.2016,0 -2.19727,1.00124 -2.19727,2.20117 V -216 h 2 v -0.81445 c 0,-0.1309 0.0735,-0.20117 0.19727,-0.20117 h 9.60742 c 0.12378,0 0.19531,0.0703 0.19531,0.20117 V -216 h 2 v -0.81445 c 0,-1.19993 -0.99372,-2.20117 -2.19531,-2.20117 z" - style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> - </g> - <g - transform="translate(-79.98255,-139.98508)" - id="layer1" /> - <g - transform="translate(-79.98255,-139.98508)" - style="display:inline" - id="layer10" /> - <g - transform="translate(-79.98255,-139.98508)" - id="g6387" /> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 16 16" version="1.1" height="16"> <g id="icon-multivalue" class="icon"><rect width="16" height="16" fill="#00000000"/><g transform="translate(-320.98275,227.01492)"><path d="m 324.17969,-227.01562 c -1.2016,0 -2.19727,1.00124 -2.19727,2.20117 V -224 h 2 v -0.81445 c 0,-0.1309 0.0735,-0.20117 0.19727,-0.20117 h 9.60742 c 0.12378,0 0.19531,0.0703 0.19531,0.20117 V -224 h 2 v -0.81445 c 0,-1.19993 -0.99372,-2.20117 -2.19531,-2.20117 z" /><path d="m 324.17969,-215.00781 c -1.2016,0 -2.19727,1.00124 -2.19727,2.20117 v 1.83008 h 2 v -1.83008 c 0,-0.13089 0.0735,-0.20117 0.19727,-0.20117 h 9.60742 c 0.12378,0 0.19531,0.0703 0.19531,0.20117 v 1.78711 h 2 v -1.78711 c 0,-1.19993 -0.99372,-2.20117 -2.19531,-2.20117 z" /><path d="m 324.17969,-223.01562 c -1.2016,0 -2.19727,1.00124 -2.19727,2.20117 V -220 h 2 v -0.81445 c 0,-0.1309 0.0735,-0.20117 0.19727,-0.20117 h 9.60742 c 0.12378,0 0.19531,0.0703 0.19531,0.20117 V -220 h 2 v -0.81445 c 0,-1.19993 -0.99372,-2.20117 -2.19531,-2.20117 z" /><path d="m 324.17969,-219.01562 c -1.2016,0 -2.19727,1.00124 -2.19727,2.20117 V -216 h 2 v -0.81445 c 0,-0.1309 0.0735,-0.20117 0.19727,-0.20117 h 9.60742 c 0.12378,0 0.19531,0.0703 0.19531,0.20117 V -216 h 2 v -0.81445 c 0,-1.19993 -0.99372,-2.20117 -2.19531,-2.20117 z" /></g></g></svg> diff --git a/docs/reference/libtracker-sparql/images/icon-notify.svg b/docs/reference/libtracker-sparql/images/icon-notify.svg index 4f6971843..0cc5af1aa 100644 --- a/docs/reference/libtracker-sparql/images/icon-notify.svg +++ b/docs/reference/libtracker-sparql/images/icon-notify.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M7.942 1.948c-2.209 0-3.33 1.5-4 4l-1 5c-.108.542-.447 1-1 1v1h12v-1c-.552 0-.891-.458-1-1l-1-5c-.53-2.5-1.79-4-4-4zm.176 12a1.5 1.5 0 001.412 1 1.5 1.5 0 001.412-1z" style="marker:none" fill="#474747"/></svg>
\ No newline at end of file +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g id="icon-notify" class="icon"><rect width="16" height="16" fill="#00000000"/><path d="M7.942 1.948c-2.209 0-3.33 1.5-4 4l-1 5c-.108.542-.447 1-1 1v1h12v-1c-.552 0-.891-.458-1-1l-1-5c-.53-2.5-1.79-4-4-4zm.176 12a1.5 1.5 0 001.412 1 1.5 1.5 0 001.412-1z"/></g></svg>
\ No newline at end of file diff --git a/docs/reference/libtracker-sparql/images/icon-superproperty.svg b/docs/reference/libtracker-sparql/images/icon-superproperty.svg index e07d2b38a..4689c48e6 100644 --- a/docs/reference/libtracker-sparql/images/icon-superproperty.svg +++ b/docs/reference/libtracker-sparql/images/icon-superproperty.svg @@ -1,3 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"> - <path d="M12 9h-1c-.258 0-.53-.13-.72-.313L9 7.407V16H7V7.406L5.717 8.687c-.19.183-.462.313-.719.313H4V8c0-.31.09-.552.281-.75L8 3.594l3.718 3.656c.19.198.281.44.281.75z" style="line-height:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;white-space:normal" color="#000" font-weight="400" font-family="sans-serif" overflow="visible" fill="#2e3436"/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g id="icon-superproperty" class="icon"><rect width="16" height="16" fill="#00000000"/><path d="M12 9h-1c-.258 0-.53-.13-.72-.313L9 7.407V16H7V7.406L5.717 8.687c-.19.183-.462.313-.719.313H4V8c0-.31.09-.552.281-.75L8 3.594l3.718 3.656c.19.198.281.44.281.75z" overflow="visible"/></g></svg>
\ No newline at end of file diff --git a/docs/reference/libtracker-sparql/meson.build b/docs/reference/libtracker-sparql/meson.build index 507555b2c..c0305a295 100644 --- a/docs/reference/libtracker-sparql/meson.build +++ b/docs/reference/libtracker-sparql/meson.build @@ -82,6 +82,7 @@ foreach doc : generated_ontology_files 'embed-files.py', meson.current_build_dir() / doc, meson.current_build_dir() / output_file, + meson.current_source_dir(), ], depends: [base_ontology_docs, nepomuk_ontology_docs, generate_images]) endforeach diff --git a/docs/reference/libtracker-sparql/tracker-sparql.toml.in b/docs/reference/libtracker-sparql/tracker-sparql.toml.in index fef19fe55..ceae430d3 100644 --- a/docs/reference/libtracker-sparql/tracker-sparql.toml.in +++ b/docs/reference/libtracker-sparql/tracker-sparql.toml.in @@ -36,11 +36,6 @@ content_files = [ ] content_images = [ "logo.svg", - "images/icon-deprecated.svg", - "images/icon-fulltextindexed.svg", - "images/icon-multivalue.svg", - "images/icon-notify.svg", - "images/icon-superproperty.svg", ] urlmap_file = "urlmap.js" diff --git a/docs/tools/tracker-docgen-md.c b/docs/tools/tracker-docgen-md.c index 1093f66fc..1a1347984 100644 --- a/docs/tools/tracker-docgen-md.c +++ b/docs/tools/tracker-docgen-md.c @@ -157,8 +157,9 @@ print_flag (FILE *f, const gchar *icon_name, const gchar *flag_description) { - g_fprintf (f, "[![%s](%s \"%s\")](%s)", - flag_description, icon_name, flag_description, flag_property_link); + g_fprintf (f, "<svg width='16' height='16' style='display: inline-block;'>" + "<a xlink:href='%s' xlink:title='%s'><use xlink:href='#%s'/></a></svg>", + flag_property_link, flag_description, icon_name); } static void @@ -204,7 +205,7 @@ print_property_table (FILE *f, g_fprintf (f, "| "); if (prop->deprecated) { - print_flag (f, "nrl-ontology.html#nrl:deprecated", "icon-deprecated.svg", + print_flag (f, "nrl-ontology.html#nrl:deprecated", "icon-deprecated", "This property is deprecated."); } @@ -220,7 +221,7 @@ print_property_table (FILE *f, message = g_strdup_printf ("This property extends %s", shortname); - print_flag (f, link, "icon-superproperty.svg", message); + print_flag (f, link, "icon-superproperty", message); } } @@ -234,12 +235,12 @@ print_property_table (FILE *f, } else { message = g_strdup_printf ("This property can have multiple values."); } - print_flag (f, "nrl-ontology.html#nrl:maxCardinality", "icon-multivalue.svg", message); + print_flag (f, "nrl-ontology.html#nrl:maxCardinality", "icon-multivalue", message); } if (prop->fulltextIndexed) { - print_flag (f, "nrl-ontology.html#nrl:fulltextIndexed", "icon-fulltextindexed.svg", - "This property is full-text-indexed, and can be looked up through `fts:match`"); + print_flag (f, "nrl-ontology.html#nrl:fulltextIndexed", "icon-fulltextindexed", + "This property is full-text-indexed, and can be looked up through fts:match"); } /* Description column */ @@ -275,13 +276,14 @@ print_ontology_class (TrackerOntologyModel *model, if (klass->deprecated) { g_fprintf (f, "**Note:** "); - print_flag (f, "nrl-ontology.html#nrl:deprecated", "icon-deprecated.svg", "Deprecated icon"); + print_flag (f, "nrl-ontology.html#nrl:deprecated", "icon-deprecated", ""); + g_fprintf (f, "This class is deprecated."); g_fprintf (f, "\n\n"); } if (klass->notify) { g_fprintf (f, "**Note:** "); - print_flag (f, "nrl-ontology.html#nrl:notify", "icon-notify.svg", "Notify icon"); + print_flag (f, "nrl-ontology.html#nrl:notify", "icon-notify", ""); g_fprintf (f, "This class emits notifications about changes, and can " "be monitored using [class@Tracker.Notifier]."); g_fprintf (f, "\n\n"); @@ -378,7 +380,7 @@ print_md_header (FILE *f, TrackerOntologyDescription *desc) g_fprintf (f, "%s\n\n", desc->description); g_fprintf (f, "<style>" - "img { display: inline-block } " + "svg .icon { fill: var(--primary) }" "table { border-collapse: collapse; } " "tr { border: none !important; } " "tr:hover { background: var(--box-bg); } " @@ -506,6 +508,23 @@ print_toc_classes (FILE *f, g_fprintf (f, "\n\n"); } +static void +print_stock_icons (FILE *f) +{ + /* In order to keep SVGs themeable, but avoid having + * repeated icons all over the place, inline them once hidden, so + * they can be put in place through <use xlink:href=.../> + */ + g_fprintf (f, + "<div style='display:none'>\n" + "{{ images/icon-deprecated.svg }}\n" + "{{ images/icon-superproperty.svg }}\n" + "{{ images/icon-multivalue.svg }}\n" + "{{ images/icon-fulltextindexed.svg }}\n" + "{{ images/icon-notify.svg }}\n" + "</div>\n"); +} + void generate_devhelp_keywords (TrackerOntologyModel *model, TrackerOntologyDescription *description, @@ -652,6 +671,7 @@ ttl_md_print (TrackerOntologyDescription *description, print_synopsis (f, description); print_toc_classes (f, model, description->localPrefix, classes); + print_stock_icons (f); basename = g_strdup_printf ("%s-introduction.md", description->localPrefix); introduction = g_build_filename (description_dir, basename, NULL); |