name: Sane software manifesto (lower case) v_0 v0.7
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 05 Oct 2019 21:04:37 +0200
branchv_0
changeset 51 21dfb69028a0
parent 50 1934fc6e5e7b
child 52 98a4b319bfa3
name: Sane software manifesto (lower case) + move common strings (title, url, author, license) from templates to the XML + fix changed files count + link to own license file
Makefile
schema/ssm.xsd
templates/common.xsl
templates/ssm.odt.xsl
templates/ssm.txt.xsl
templates/ssm.xhtml.xsl
text/ssm.en.xml
--- a/Makefile	Fri Oct 04 19:40:53 2019 +0200
+++ b/Makefile	Sat Oct 05 21:04:37 2019 +0200
@@ -1,4 +1,4 @@
-# Sane Software Manifesto helper tools
+# Sane software manifesto helper tools
 # Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
 #
 # This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
-VERSION_PARAMS := $(shell hg log -r '.' --template '--stringparam versionTag {latesttag} --stringparam versionDistance {latesttagdistance} --stringparam versionHash {node|short}') 
+VERSION_PARAMS := $(shell hg log -r '.' --template '--stringparam versionTag {latesttag} --stringparam versionDistance {latesttagdistance} --stringparam versionHash {node|short}') "--stringparam" "versionChangedFiles" $(shell hg status | wc -l) 
 
 all: validate xhtml txt pdf logo-png statistics
 
@@ -45,7 +45,8 @@
 	rm -rf build
 
 publish:
-	scp build/* globalcode.info:/var/www/sane-software.globalcode.info/v_0/
+	scp build/*     globalcode.info:/var/www/sane-software.globalcode.info/v_0/
+	scp license/*   globalcode.info:/var/www/sane-software.globalcode.info/license/
 
 
 build/statistics.rp: text/ssm.en.xml
@@ -67,4 +68,4 @@
 	cat build/statistics.rp | relpipe-out-tabular
 	
 statistics-chart: build/statistics.rp
-	cat build/statistics.rp | relpipe-tr-cut ".*" "(name|.*s)" | relpipe-out-gui -title "Sane Software Manifesto – chart of rule types"
+	cat build/statistics.rp | relpipe-tr-cut ".*" "(name|.*s)" | relpipe-out-gui -title "Sane software manifesto – chart of rule types"
--- a/schema/ssm.xsd	Fri Oct 04 19:40:53 2019 +0200
+++ b/schema/ssm.xsd	Sat Oct 05 21:04:37 2019 +0200
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-	Sane Software Manifesto helper tools
+	Sane software manifesto helper tools
 	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
 
     This program is free software: you can redistribute it and/or modify
@@ -27,11 +27,43 @@
 		<xs:sequence>
 			<xs:element name="title" type="xs:string"/>
 			<xs:element name="id" type="ID"/>
+			<xs:element name="url" type="URL"/>
+			<xs:element name="author" type="xs:string"/>
+			<xs:element name="license" type="License"/>
 			<xs:element name="preamble" type="xs:string"/>
 			<xs:element name="chapter" type="Chapter" maxOccurs="unbounded"/>
 		</xs:sequence>
 	</xs:complexType>
 	
+	<xs:complexType name="License">
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"/>
+			<xs:element name="abbreviation" type="xs:string"/>
+			<xs:element name="url" type="URL"/>
+			<xs:element name="year" type="xs:string">
+				<xs:annotation>
+					<xs:documentation>
+						the copyright year
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="prefix" type="xs:string">
+				<xs:annotation>
+					<xs:documentation>
+						used to compose a sentence: prefix+name+suffix
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="suffix" type="xs:string">
+				<xs:annotation>
+					<xs:documentation>
+						used to compose a sentence: prefix+name+suffix
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
 	<xs:simpleType name="ID">
 		<xs:annotation>
 			<xs:documentation>
--- a/templates/common.xsl	Fri Oct 04 19:40:53 2019 +0200
+++ b/templates/common.xsl	Sat Oct 05 21:04:37 2019 +0200
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-	Sane Software Manifesto helper tools
+	Sane software manifesto helper tools
 	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
 
     This program is free software: you can redistribute it and/or modify
@@ -27,13 +27,18 @@
 		<xsl:param name="tag"/>
 		<xsl:param name="distance"/>
 		<xsl:param name="hash"/>
+		<xsl:param name="changedFiles"/>
 		
 		<xsl:value-of select="$tag"/>
-		<xsl:if test="$distance &gt; 1">
+		<xsl:if test="$distance &gt; 1 or $changedFiles &gt; 0">
 			<xsl:text>+</xsl:text>
 			<xsl:value-of select="$distance - 1"/>
 			<xsl:text> (</xsl:text>
 			<xsl:value-of select="$hash"/>
+			<xsl:if test="$changedFiles &gt; 0">
+				<xsl:text>+</xsl:text>
+				<xsl:value-of select="$changedFiles"/>
+			</xsl:if>
 			<xsl:text>)</xsl:text>
 		</xsl:if>
 	</xsl:template>
--- a/templates/ssm.odt.xsl	Fri Oct 04 19:40:53 2019 +0200
+++ b/templates/ssm.odt.xsl	Sat Oct 05 21:04:37 2019 +0200
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-	Sane Software Manifesto helper tools
+	Sane software manifesto helper tools
 	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
 
     This program is free software: you can redistribute it and/or modify
@@ -34,6 +34,7 @@
 	<xsl:param name="versionTag"/>
 	<xsl:param name="versionDistance"/>
 	<xsl:param name="versionHash"/>
+	<xsl:param name="versionChangedFiles"/>
 	
 	<xsl:output 
 		method="xml" 
@@ -53,6 +54,7 @@
 							<xsl:with-param name="tag" select="$versionTag"/>
 							<xsl:with-param name="distance" select="$versionDistance"/>
 							<xsl:with-param name="hash" select="$versionHash"/>
+							<xsl:with-param name="changedFiles" select="$versionChangedFiles"/>
 						</xsl:call-template>
 					</text:p>
 					<text:p text:style-name="Paragraph">
@@ -185,8 +187,17 @@
 		<office:master-styles>
 			<style:master-page style:name="Standard" style:page-layout-name="pm1">
 				<style:footer>
-					<!-- TODO: move license information to XML file -->
-					<text:p text:style-name="Footer">Sane Software Manifesto &lt;https://sane-software.globalcode.info/&gt; Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) CC-BY-ND<text:tab/>
+					<text:p text:style-name="Footer">
+						<xsl:value-of select="/m:manifesto/m:title"/>
+						<xsl:text> &lt;</xsl:text>
+						<xsl:value-of select="/m:manifesto/m:url"/>
+						<xsl:text>&gt; Copyright © </xsl:text>
+						<xsl:value-of select="/m:manifesto/m:license/m:year"/>
+						<xsl:text> </xsl:text>
+						<xsl:value-of select="/m:manifesto/m:author"/>
+						<xsl:text> </xsl:text>
+						<xsl:value-of select="/m:manifesto/m:license/m:abbreviation"/>
+						<text:tab/>
 						<text:page-number text:select-page="current">1</text:page-number> / <text:page-count>1</text:page-count>
 					</text:p>
 				</style:footer>
--- a/templates/ssm.txt.xsl	Fri Oct 04 19:40:53 2019 +0200
+++ b/templates/ssm.txt.xsl	Sat Oct 05 21:04:37 2019 +0200
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-	Sane Software Manifesto helper tools
+	Sane software manifesto helper tools
 	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
 
     This program is free software: you can redistribute it and/or modify
@@ -27,6 +27,7 @@
 	<xsl:param name="versionTag"/>
 	<xsl:param name="versionDistance"/>
 	<xsl:param name="versionHash"/>
+	<xsl:param name="versionChangedFiles"/>
 	
 	<xsl:output 
 		method="text" 
@@ -40,20 +41,31 @@
 		<xsl:text>&#10;&#10;</xsl:text>
 		<xsl:apply-templates select="m:chapter"/>
 		
-		<!-- TODO: move license information to XML file -->
 		<xsl:text></xsl:text>
 		<xsl:text>&#10;&#10;</xsl:text>
 		<xsl:text>----------------------------------------------------------------&#10;</xsl:text>
-		<xsl:text>Sane Software Manifesto &lt;https://sane-software.globalcode.info/&gt;&#10;</xsl:text>
-		<xsl:text>Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)&#10;</xsl:text>
+		<xsl:value-of select="m:title"/>
+		<xsl:text> &lt;</xsl:text>
+		<xsl:value-of select="m:url"/>
+		<xsl:text>&gt;&#10;</xsl:text>
+		<xsl:text>Copyright © 2019 </xsl:text>
+		<xsl:value-of select="m:author"/>
+		<xsl:text>&#10;</xsl:text>
 		<xsl:text>Version: </xsl:text>
 		<xsl:call-template name="version">
 			<xsl:with-param name="tag" select="$versionTag"/>
 			<xsl:with-param name="distance" select="$versionDistance"/>
 			<xsl:with-param name="hash" select="$versionHash"/>
+			<xsl:with-param name="changedFiles" select="$versionChangedFiles"/>
 		</xsl:call-template>
 		<xsl:text>&#10;</xsl:text>
-		<xsl:text>This manifesto is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License &lt;https://creativecommons.org/licenses/by-nd/4.0/&gt;.&#10;</xsl:text>
+		<xsl:value-of select="m:license/m:prefix"/>
+		<xsl:value-of select="m:license/m:name"/>
+		<xsl:text> &lt;</xsl:text>
+		<xsl:value-of select="m:license/m:url"/>
+		<xsl:text>&gt;</xsl:text>
+		<xsl:value-of select="m:license/m:suffix"/>
+		<xsl:text>&#10;</xsl:text>
 		<xsl:text>----------------------------------------------------------------&#10;</xsl:text>
 	</xsl:template>
 	
--- a/templates/ssm.xhtml.xsl	Fri Oct 04 19:40:53 2019 +0200
+++ b/templates/ssm.xhtml.xsl	Sat Oct 05 21:04:37 2019 +0200
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-	Sane Software Manifesto helper tools
+	Sane software manifesto helper tools
 	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
 
     This program is free software: you can redistribute it and/or modify
@@ -31,6 +31,7 @@
 	<xsl:param name="versionTag"/>
 	<xsl:param name="versionDistance"/>
 	<xsl:param name="versionHash"/>
+	<xsl:param name="versionChangedFiles"/>
 	
 	<xsl:output 
 		method="xml" 
@@ -58,6 +59,7 @@
 							<xsl:with-param name="tag" select="$versionTag"/>
 							<xsl:with-param name="distance" select="$versionDistance"/>
 							<xsl:with-param name="hash" select="$versionHash"/>
+							<xsl:with-param name="changedFiles" select="$versionChangedFiles"/>
 						</xsl:call-template>
 					</p>
 				
@@ -67,16 +69,24 @@
 				
 					<xsl:apply-templates select="m:chapter"/>
 				
-				
-					<!-- TODO: move license information to XML file -->
 					<hr/>
 					<p class="footer">
-						<a href="https://sane-software.globalcode.info/">Sane Software Manifesto</a>
+						<a href="{m:url}">
+							<xsl:value-of select="m:title"/>
+						</a>
+						<!-- TODO: move also mailing list to XML file -->
 						(<a href="https://lists.globalcode.info/mailman3/postorius/lists/sane-software.lists.globalcode.info/">mailing list</a>, <a href="https://globalcode.info/mailing-lists.xhtml">rules</a>)
 						other formats: <a href="ssm.en.pdf">PDF</a>, <a href="ssm.en.txt">TXT</a>
 						<br/>
-						Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)<br/>
-						This manifesto is licensed under the <a href="https://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>.
+						Copyright © <xsl:value-of select="m:license/m:year"/>
+						<xsl:text> </xsl:text>
+						<xsl:value-of select="m:author"/>
+						<br/>
+						<xsl:value-of select="m:license/m:prefix"/> 
+						<a href="{m:license/m:url}">
+							<xsl:value-of select="m:license/m:name"/>
+						</a>
+						<xsl:value-of select="m:license/m:suffix"/>
 					</p>
 
 				</div>
--- a/text/ssm.en.xml	Fri Oct 04 19:40:53 2019 +0200
+++ b/text/ssm.en.xml	Sat Oct 05 21:04:37 2019 +0200
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-	Sane Software Manifesto
+	Sane software manifesto
 	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
 
 	This manifesto is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.
     https://creativecommons.org/licenses/by-nd/4.0/
 	
-	If distributed, official website of Sane Software Manifesto must be provided: https://sane-software.globalcode.info/
+	If distributed, official website of Sane software manifesto must be provided: https://sane-software.globalcode.info/
 -->
 <manifesto
 	xmlns="tag:globalcode.info,2019:sane-software/manifesto"
@@ -14,8 +14,19 @@
 	xsi:schemaLocation="tag:globalcode.info,2019:sane-software/manifesto ../schema/ssm.xsd">
 
 	
-	<title>Sane Software Manifesto</title>
+	<title>Sane software manifesto</title>
 	<id>fd466b50-6abd-4294-b11f-a5b8f2f39c2a</id>
+	<url>https://sane-software.globalcode.info/</url>
+	<author>František Kučera (Frantovo.cz, GlobalCode.info)</author>
+	<license>
+		<name>Creative Commons Attribution-NoDerivatives 4.0 International License</name>
+		<abbreviation>CC-BY-ND</abbreviation>
+		<url>https://sane-software.globalcode.info/license/CC-BY-ND-4.0.txt</url>
+		<year>2019</year>
+		<prefix>This manifesto is licensed under the </prefix>
+		<suffix>.</suffix>
+	</license>
+	
 	<preamble>In respect to user freedoms, privacy, liberty and software quality we create software according to the following guidelines. Developing Sane software is not easy, however we believe that this is the right way because this software is written once but used many times and maintained for years or decades.</preamble>
 
 	<chapter>