Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package suse-xsl-stylesheets for openSUSE:Factory checked in at 2023-08-10 15:33:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/suse-xsl-stylesheets (Old) and /work/SRC/openSUSE:Factory/.suse-xsl-stylesheets.new.11712 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "suse-xsl-stylesheets" Thu Aug 10 15:33:16 2023 rev:69 rq:1103277 version:2.92.3 Changes: -------- --- /work/SRC/openSUSE:Factory/suse-xsl-stylesheets/suse-xsl-stylesheets.changes 2023-08-02 16:47:56.868439324 +0200 +++ /work/SRC/openSUSE:Factory/.suse-xsl-stylesheets.new.11712/suse-xsl-stylesheets.changes 2023-08-10 15:33:32.272028088 +0200 @@ -1,0 +2,31 @@ +Thu Aug 3 07:31:00 UTC 2023 - Thomas Schraitle <thomas.schrai...@suse.com> - 2.92.3 + +- Update 2.92.3 + JSON-LD: + - Remove "role" property for authors + - Introduce json-ld-use-individual-authors parameter + => 0=don't use individual authors, use fallback author + 1=use authors which are in <authorgroup> or <author>s + +------------------------------------------------------------------- +Wed Aug 2 09:20:39 UTC 2023 - Thomas Schraitle <thomas.schrai...@suse.com> - 2.92.2 + +- Update 2.92.2 + - Correct metadata + - Rename "abstract" -> "description" and refactor code + - Introduce "sameAs" property + - Disable json-ld-version and json-ld-keywords + - Use "Corporation" instead of "Organization" for default author and publisher + + - JSON-LD: Rewrite author + authorgroup code + - Simplify code and create a two set approach + If no (author/editor/corpauthor/contributor)s or authorgroup is + found, fallback to a default corporation author + - Add new parameters: + - json-ld-fallback-author-name: The author's name + - json-ld-fallback-author-url: the author's URL + - json-ld-fallback-author-type: "Corporation" by default + (but can also be a "Person") + - json-ld-fallback-author-logo: the URL pointing to the logo + +------------------------------------------------------------------- Old: ---- suse-xsl-2.92.1.tar.bz2 New: ---- suse-xsl-2.92.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ suse-xsl-stylesheets.spec ++++++ --- /var/tmp/diff_new_pack.AIHWoy/_old 2023-08-10 15:33:32.960032379 +0200 +++ /var/tmp/diff_new_pack.AIHWoy/_new 2023-08-10 15:33:32.964032404 +0200 @@ -22,7 +22,7 @@ %define suse_styles_dir %{db_xml_dir}/stylesheet # Name: suse-xsl-stylesheets -Version: 2.92.1 +Version: 2.92.3 Release: 0 Summary: SUSE-Branded Stylesheets for DocBook License: GPL-2.0-only OR GPL-3.0-only ++++++ suse-xsl-2.92.1.tar.bz2 -> suse-xsl-2.92.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-2.92.1/ChangeLog new/suse-xsl-2.92.3/ChangeLog --- old/suse-xsl-2.92.1/ChangeLog 2023-07-31 13:42:35.000000000 +0200 +++ new/suse-xsl-2.92.3/ChangeLog 2023-08-03 09:14:49.000000000 +0200 @@ -1,4 +1,34 @@ ------------------------------------------------------------------- +Thu Aug 03 09:10:00 UTC 2022 - toms...@users.noreply.github.com + +- Update 2.92.3 + - Introduce json-ld-use-individual-authors parameter + => 0=don't use individual authors, use fallback author + 1=use authors which are in <authorgroup> or <author>s + - Remove "role" property for authors + +------------------------------------------------------------------- +Wed Aug 02 11:15:00 UTC 2022 - toms...@users.noreply.github.com + +- Update 2.92.2 + - Correct metadata + - Rename "abstract" -> "description" and refactor code + - Introduce "sameAs" property + - Disable json-ld-version and json-ld-keywords + - Use "Corporation" instead of "Organization" for default author and publisher + + - JSON-LD: Rewrite author + authorgroup code + - Simplify code and create a two set approach + If no (author/editor/corpauthor/contributor)s or authorgroup is + found, fallback to a default corporation author + - Add new parameters: + - json-ld-fallback-author-name: The author's name + - json-ld-fallback-author-url: the author's URL + - json-ld-fallback-author-type: "Corporation" by default + (but can also be a "Person") + - json-ld-fallback-author-logo: the URL pointing to the logo + +------------------------------------------------------------------- Mon Jul 31 13:36:00 UTC 2022 - toms...@users.noreply.github.com - Update 2.92.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-2.92.1/Makefile new/suse-xsl-2.92.3/Makefile --- old/suse-xsl-2.92.1/Makefile 2023-07-31 13:42:35.000000000 +0200 +++ new/suse-xsl-2.92.3/Makefile 2023-08-03 09:14:49.000000000 +0200 @@ -11,7 +11,7 @@ SHELL := /bin/bash PACKAGE := suse-xsl-stylesheets -VERSION := 2.92.1 +VERSION := 2.92.3 CDIR := $(shell pwd) SUSE_XML_PATH := $(PREFIX)/xml/suse DB_XML_PATH := $(PREFIX)/xml/docbook diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-2.92.1/suse2022-ns/xhtml/json-ld.xsl new/suse-xsl-2.92.3/suse2022-ns/xhtml/json-ld.xsl --- old/suse-xsl-2.92.1/suse2022-ns/xhtml/json-ld.xsl 2023-07-31 13:42:35.000000000 +0200 +++ new/suse-xsl-2.92.3/suse2022-ns/xhtml/json-ld.xsl 2023-08-03 09:14:49.000000000 +0200 @@ -19,7 +19,6 @@ "@type": "TechArticle", "name": "Getting Started with ExampleApp", "headline": "ExampleApp Documentation", - "abstract": "A short abstract of ExampleApp", "description": "A comprehensive guide to get started with ExampleApp.", "author": { "@type": "Person", @@ -28,6 +27,12 @@ }, "datePublished": "2023-07-24", "dateModified": "2023-07-25", + "sameAs": [ + "https://www.facebook.com/SUSEWorldwide/about", + "https://www.youtube.com/channel/UCHTfqIzPKz4f_dri36lAQGA", + "https://twitter.com/SUSE", + "https://www.linkedin.com/company/suse" + ], "publisher": { "@type": "Organization", "name": "SUSE", @@ -50,20 +55,6 @@ xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="date exsl d"> - <xsl:template name="json-group"> - <xsl:param name="key"/> - <xsl:param name="type"/> - <xsl:param name="indent"><xsl:text> </xsl:text></xsl:param> - <xsl:param name="body"/> - <xsl:param name="comma" select="true()"/> - - <xsl:value-of select="concat($indent, '"', $key, '": {')"/> - <xsl:value-of select="$body"/> - <xsl:value-of select="concat($indent, '}')"/> - <xsl:if test="$comma">,</xsl:if> - </xsl:template> - - <xsl:template name="generate-json-ld"> <xsl:param name="node"/> <xsl:if test="$generate.json-ld != 0"> @@ -75,13 +66,14 @@ --> <xsl:call-template name="json-ld-headline"/> - <xsl:call-template name="json-ld-abstract"/> - <xsl:call-template name="json-ld-keywords"/> - <xsl:call-template name="json-ld-authors"/> - <xsl:call-template name="json-ld-authorgroup"/> + <xsl:call-template name="json-ld-description"/> +<!-- <xsl:call-template name="json-ld-keywords"/>--> + + <xsl:call-template name="json-ld-license"/><!-- Later --> + <xsl:call-template name="json-ld-authors-and-authorgroups"/> <xsl:call-template name="json-ld-datePublished"/> <xsl:call-template name="json-ld-dateModified"/> - <xsl:call-template name="json-ld-version"/> +<!-- <xsl:call-template name="json-ld-version"/>--> <xsl:call-template name="json-ld-publisher"/> } </script> @@ -95,33 +87,42 @@ "headline": "<xsl:value-of select="normalize-space($headline)"/>", </xsl:template> - <xsl:template name="json-ld-abstract"> + <xsl:template name="json-ld-description"> <xsl:param name="node" select="."/> - <xsl:if test="$node/d:info/d:abstract"> - <xsl:variable name="abstract"> - <xsl:call-template name="ellipsize.text"> - <xsl:with-param name="input"> - <xsl:choose> - <xsl:when test="$node/d:info/d:meta[@name = 'description']"> - <xsl:value-of select="normalize-space($node/d:info/d:meta[@name = 'description'][1])" /> - </xsl:when> - <xsl:when test="$node/d:info/d:abstract or $node/d:info/d:highlights"> - <xsl:for-each select="($node/d:info[1]/d:abstract[1] | $node/d:info[1]/d:highlights[1])[1]/*"> - <xsl:value-of select="normalize-space(.)" /> - <xsl:if test="position() < last()"> - <xsl:text> </xsl:text> - </xsl:if> - </xsl:for-each> - </xsl:when> - </xsl:choose> - </xsl:with-param> - </xsl:call-template> - </xsl:variable> + <xsl:variable name="description"> + <xsl:choose> + <xsl:when test="$node/d:info/d:meta[@name = 'description']"> + <xsl:value-of select="normalize-space($node/d:info/d:meta[@name = 'description'][1])" + /> + </xsl:when> + <xsl:when test="$node/d:info/d:meta[@name = 'social-descr']"> + <xsl:value-of select="normalize-space($node/d:info/d:meta[@name = 'social-descr'][1])" + /> + </xsl:when> + <xsl:when test="$node/d:info/d:meta[@name = 'title']"> + <xsl:value-of select="normalize-space($node/d:info/d:meta[@name = 'title'][1])" + /> + </xsl:when> + <xsl:when test="$node/d:info/d:abstract"> + <xsl:call-template name="ellipsize.text"> + <xsl:with-param name="input" + select="($node/d:info/d:abstract/d:para[1] | + $node/d:info/d:abstract/d:variablelist[1]/d:varlistentry[1]/d:listitem/d:para[1])[last()]"> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <!-- Only for fallback, if all of the above fails --> + <xsl:call-template name="ellipsize.text"> + <xsl:with-param name="input" select="($node/d:info/d:title | $node/d:title)[last()]"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> - <xsl:if test="$abstract != ''"> - "abstract": "<xsl:value-of select="$abstract"/>", + <xsl:if test="$description != ''"> + "description": "<xsl:value-of select="$description"/>", </xsl:if> - </xsl:if> </xsl:template> <xsl:template name="json-ld-keywords"> @@ -138,46 +139,103 @@ </xsl:if> </xsl:template> - <xsl:template name="json-ld-authors"> + <xsl:template name="json-ld-license"> <xsl:param name="node" select="."/> + + <!-- "license": "URL", + "copyrightNotice": "© 2023 ExampleTech Company. All rights reserved.", + "copyrightYear": "2023", + --> + </xsl:template> + + <xsl:template name="json-ld-authors-and-authorgroups"> + <xsl:param name="node" select="."/> + <!-- + Implementation details: + + There are two possible sets: + * Set A consists of separate elements like <author>, <editor>, <othercredit>, and <corpauthor>. + They can appear in any combination or order. + * Set B consists of <authorgroup> elements. + + Theoretically, writers can write any elements of both sets as they like. DocBook doesn't impose + any restrictions. + + - We put everything from set A into a "$author" variable and wrap around an <authorgroup> + - In XSLT 1.0, if we create temporary fragment trees (so called "result tree fragments") we need to + convert them into "real" node trees with the extension function exsl:node-set(). + Yes, it's annoying as fuck. :-( + - Everything else with <authorgroup> are stored in $authorgroup variable + - Both node sets contain <authorgroup> elements. We can create a union node set with "|" + - The <authorgroup> element only deals as a parent element, a wrapper for its content. + - To see how many elements we have, we need the XPath expression "count($candidate-authors/*)" + Keep in mind the "/*" at the end. + - Depending on if we have one element or many, we deal accordingly. If we don't have any element + at all, we fallback to the default author. + --> + <xsl:variable name="authors"> + <xsl:if test="$node/d:info/d:author | $node/d:info/d:corpauthor | $node/d:info/d:othercredit | $node/d:info/d:editor"> + <d:authorgroup> + <xsl:copy-of select="$node/d:info/d:author | + $node/d:info/d:corpauthor | + $node/d:info/d:othercredit | + $node/d:info/d:editor" + /> + </d:authorgroup> + </xsl:if> + </xsl:variable> + <xsl:variable name="rtf-authors" select="exsl:node-set($authors)/*"/> + <xsl:variable name="authorgroup" select="$node/d:info/d:authorgroup"/> + <xsl:variable name="candidate-authors" select="$rtf-authors | $authorgroup"/> + +<!-- <xsl:message>INFO: json-ld-authors-and-authorgroups + authors = <xsl:value-of select="count($authors)"/> + name(author) = <xsl:value-of select="local-name($authors)"/> + rtf-authors = <xsl:value-of select="count($rtf-authors/*)"/> + name(rtf-author) = <xsl:value-of select="local-name($rtf-authors)"/> + authorgroup = <xsl:value-of select="count($authorgroup)"/> + name(authorgroup) = <xsl:value-of select="local-name($authorgroup)"/> + candidate = <xsl:value-of select="count($candidate-authors/*)"/> + name(candidate) = <xsl:value-of select="local-name($candidate-authors)"/> + </xsl:message>--> + <xsl:choose> - <xsl:when test="not($node/d:info/d:author)"/> - <xsl:when test="count($node/d:info/d:author) = 1"> + <xsl:when test="number($json-ld-use-individual-authors) = 1 and count($candidate-authors/*) = 1"> + <xsl:message>INFO: found one author</xsl:message> <xsl:variable name="person"> <xsl:call-template name="person.name"> - <xsl:with-param name="node" select="$node/d:info/d:author"/> + <xsl:with-param name="node" select="$candidate-authors/*"/> </xsl:call-template> </xsl:variable> "author": { "@type": "Person", - "name": "<xsl:value-of select="$person"/>", - "role": "Writer" + "name": "<xsl:value-of select="$person"/>"<!--, + "role": "Writer"--> }, </xsl:when> - <xsl:otherwise> - <xsl:variable name="authors"> - <d:info> - <d:authorgroup> - <xsl:copy-of - select="$node/d:info/d:author | $node/d:info/d:corpauthor | $node/d:info/d:othercredit | $node/d:info/d:editor" - /> - </d:authorgroup> - </d:info> - </xsl:variable> - <xsl:variable name="rtf-authors" select="exsl:node-set($authors)"/> - <xsl:call-template name="json-ld-authorgroup"> - <xsl:with-param name="node" select="$rtf-authors"/> + <xsl:when test="number($json-ld-use-individual-authors) = 1 and count($candidate-authors/*) > 1"> + "author": [<!-- + --><xsl:call-template name="json-ld-person.name.list"> + <xsl:with-param name="node" select="$candidate-authors"/> </xsl:call-template> + ], + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="json-ld-author-fallback"/> </xsl:otherwise> </xsl:choose> </xsl:template> - <xsl:template name="json-ld-authorgroup"> + <xsl:template name="json-ld-author-fallback"> <xsl:param name="node" select="."/> - <xsl:for-each select="$node/d:info/d:authorgroup"> - "author": [<xsl:call-template name="json-ld-person.name.list"/> - ], - </xsl:for-each> + "author": { + "@type": "<xsl:value-of select="$json-ld-fallback-author-type"/>", + "name": "<xsl:value-of select="$json-ld-fallback-author-name"/>", + <xsl:if test="$json-ld-fallback-author-url != ''" + >"url": "<xsl:value-of select="$json-ld-fallback-author-url"/>",</xsl:if> + <xsl:if test="$json-ld-fallback-author-logo != ''"> + "logo": "<xsl:value-of select="$json-ld-fallback-author-logo"/>"</xsl:if> + }, </xsl:template> <xsl:template name="json-ld-version"> @@ -205,13 +263,7 @@ </xsl:variable> { "@type": "Person", - "name": "<xsl:value-of select="string($name)"/>", - "role": "<xsl:choose> -<!-- <xsl:when test="local-name($person.list[position()=$count]) = 'author'">Writer</xsl:when>--> - <xsl:when test="local-name($person.list[position()=$count]) = 'editor'">Editor</xsl:when> - <xsl:when test="local-name($person.list[position()=$count]) = 'othercredit'">Contributor</xsl:when> - <xsl:otherwise>Writer</xsl:otherwise> - </xsl:choose>" + "name": "<xsl:value-of select="string($name)"/>" }<xsl:if test="$count < $person.count">, </xsl:if> <xsl:call-template name="json-ld-person.name.list"> <xsl:with-param name="person.list" select="$person.list"/> @@ -232,30 +284,30 @@ TODO: check format. It must be in ISO format. --> <xsl:when test="$node/d:info/d:meta[@name='published']"> - <xsl:value-of select="string($node/d:info/d:meta[@name='published'])"/> + <xsl:value-of select="normalize-space(string($node/d:info/d:meta[@name='published']))"/> </xsl:when> - <xsl:when test="$node/d:info/d:pubdate"> - <xsl:value-of select="string($node/d:info/d:pubdate)"/> + <xsl:when test="normalize-space($node/d:info/d:pubdate) != ''"> + <xsl:value-of select="normalize-space(string($node/d:info/d:pubdate))"/> </xsl:when> - <xsl:when test="$node/d:info/d:date"> - <xsl:value-of select="string($node/d:info/d:pubdate)"/> + <xsl:when test="normalize-space($node/d:info/d:date) != ''"> + <xsl:value-of select="normalize-space(string($node/d:info/d:pubdate))"/> </xsl:when> <xsl:when test="$node/d:info/d:revhistory/d:revision[1]/d:date"> - <xsl:value-of select="string($node/d:info/d:revhistory/d:revision[1]/d:date)"/> + <xsl:value-of select="normalize-space(string($node/d:info/d:revhistory/d:revision[1]/d:date))"/> </xsl:when> </xsl:choose> </xsl:variable> <xsl:choose> <xsl:when test="$date != ''"> - "datePublished": "<xsl:value-of select="normalize-space($date)"/>", + "datePublished": "<xsl:value-of select="$date"/>", </xsl:when> <xsl:otherwise> <xsl:call-template name="log.message"> <xsl:with-param name="level">warn</xsl:with-param> <xsl:with-param name="context-desc">JSON-LD</xsl:with-param> <xsl:with-param name="message"> - <xsl:text>Could not create "datePublished" entry as no element was appropriate.</xsl:text> + <xsl:text>Could not create "datePublished" property as no element was appropriate.</xsl:text> </xsl:with-param> </xsl:call-template> </xsl:otherwise> @@ -292,9 +344,16 @@ </xsl:template> <xsl:template name="json-ld-publisher"> + "sameAs": [ + "https://www.facebook.com/SUSEWorldwide/about", + "https://www.youtube.com/channel/UCHTfqIzPKz4f_dri36lAQGA", + "https://twitter.com/SUSE", + "https://www.linkedin.com/company/suse" + ], "publisher": { - "@type": "Organization", + "@type": "Corporation", "name": "SUSE", + "url": "https://documentation.suse.com", "logo": { "@type": "ImageObject", "url": "https://www.suse.com/assets/img/suse-white-logo-green.svg" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-2.92.1/suse2022-ns/xhtml/param.xsl new/suse-xsl-2.92.3/suse2022-ns/xhtml/param.xsl --- old/suse-xsl-2.92.1/suse2022-ns/xhtml/param.xsl 2023-07-31 13:42:35.000000000 +0200 +++ new/suse-xsl-2.92.3/suse2022-ns/xhtml/param.xsl 2023-08-03 09:14:49.000000000 +0200 @@ -460,6 +460,13 @@ <!-- Should we generate a JSON-LD structure? 0=no, 1=yes --> <xsl:param name="generate.json-ld" select="0"/> + <!-- Should the individual authors be used? 0=no, 1=yes --> + <xsl:param name="json-ld-use-individual-authors" select="1"/> + <xsl:param name="json-ld-fallback-author-name">SUSE documentation team</xsl:param> + <xsl:param name="json-ld-fallback-author-url">https://documentation.suse.com</xsl:param> + <xsl:param name="json-ld-fallback-author-type">Corporation</xsl:param> + <xsl:param name="json-ld-fallback-author-logo">https://www.suse.com/assets/img/suse-white-logo-green.svg</xsl:param> + <xsl:variable name="placeholder.ssi.language">{{#language#}}</xsl:variable>