author | František Kučera <franta-hg@frantovo.cz> |
Wed, 25 Sep 2019 00:01:56 +0200 | |
branch | v_0 |
changeset 34 | b4f38381c89f |
parent 33 | d6cb9fe26aed |
child 36 | 9e5c3383ba50 |
permissions | -rw-r--r-- |
15
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
1 |
# Sane Software Manifesto helper tools |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
2 |
# Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
3 |
# |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
4 |
# This program is free software: you can redistribute it and/or modify |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
5 |
# it under the terms of the GNU General Public License as published by |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
6 |
# the Free Software Foundation, version 3. |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
7 |
# |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
8 |
# This program is distributed in the hope that it will be useful, |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
11 |
# GNU General Public License for more details. |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
12 |
# |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
13 |
# You should have received a copy of the GNU General Public License |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
14 |
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
15 |
|
25
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
16 |
all: validate xhtml txt |
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
17 |
|
15
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
18 |
validate: |
25
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
19 |
xmllint --noout --schema schema/ssm.xsd text/ssm.en.xml |
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
20 |
|
15
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
21 |
xhtml: |
25
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
22 |
mkdir -p build |
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
23 |
xsltproc --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml |
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
24 |
cp templates/*.css build |
30
841bec790da8
add Sawasdee.woff web font
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
25 |
cp templates/*.woff build |
25
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
26 |
|
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
27 |
# TODO: better line wrapping |
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
28 |
txt: |
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
29 |
mkdir -p build |
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
30 |
xsltproc --nonet templates/ssm.txt.xsl text/ssm.en.xml | fmt -w 74 -s | sed -E 's/( +)([^- ])/\1 \2/g' > build/ssm.en.txt |
15
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
31 |
|
33
d6cb9fe26aed
logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents:
30
diff
changeset
|
32 |
logo-png: |
d6cb9fe26aed
logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents:
30
diff
changeset
|
33 |
mkdir -p build |
d6cb9fe26aed
logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents:
30
diff
changeset
|
34 |
inkscape -z -e build/sane-software-logo-circle.png logo/sane-software-logo-circle.svg |
d6cb9fe26aed
logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents:
30
diff
changeset
|
35 |
inkscape -z -e build/sane-software-logo-rectangle.png logo/sane-software-logo-rectangle.svg |
d6cb9fe26aed
logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents:
30
diff
changeset
|
36 |
|
15
96fc2f42b1e1
conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
37 |
clean: |
25
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
38 |
rm -rf build |
18 | 39 |
|
40 |
publish: |
|
25
8da11cce2c98
add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
20
diff
changeset
|
41 |
scp build/* globalcode.info:/var/www/sane-software.globalcode.info/v_0/ |
20
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
42 |
|
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
43 |
|
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
44 |
# Prints a table with number of items in particular chapters: |
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
45 |
statistics: |
27
413a00a9cde7
merge two sections into Semantic versioning and upgrades
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
46 |
cat text/ssm.en.xml \ |
20
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
47 |
| relpipe-in-xmltable \ |
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
48 |
--namespace "m" "tag:globalcode.info,2019:sane-software/manifesto" \ |
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
49 |
--relation "chapter" \ |
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
50 |
--records "//m:chapter" \ |
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
51 |
--attribute "name" string "m:name" \ |
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
52 |
--attribute "item_count" integer "count(descendant::m:item)" \ |
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
53 |
| relpipe-out-tabular |
fb939d9baaf4
make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
54 |
# try also relpipe-out-gui to get the chart |