[PATCH 1/9] docs: XSL: Add source document name as custom data attribute for <html>

Peter Krempa posted 9 patches 2 years, 11 months ago
[PATCH 1/9] docs: XSL: Add source document name as custom data attribute for <html>
Posted by Peter Krempa 2 years, 11 months ago
The html standard allows custom data attributes on any element in the
format of 'data-*' which are not interpreted. We can use it to embed the
name of the source document used to generate the page so that our
checker tools can use the friendly name.

https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 docs/page.xsl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/page.xsl b/docs/page.xsl
index 548d5a11c4..20b49d1afd 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -80,7 +80,7 @@
     <xsl:param name="timestamp"/>
     <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;
 </xsl:text>
-    <html>
+    <html data-sourcedoc="{$pagesrc}">
       <xsl:comment>
         This file is autogenerated from <xsl:value-of select="$pagesrc"/>
         Do not edit this file. Changes will be lost.
-- 
2.39.1
Re: [PATCH 1/9] docs: XSL: Add source document name as custom data attribute for <html>
Posted by Daniel P. Berrangé 2 years, 11 months ago
On Tue, Feb 14, 2023 at 10:51:09PM +0100, Peter Krempa wrote:
> The html standard allows custom data attributes on any element in the
> format of 'data-*' which are not interpreted. We can use it to embed the
> name of the source document used to generate the page so that our
> checker tools can use the friendly name.
> 
> https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  docs/page.xsl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|