From b3cbf864c2903f923c0e8934cbab14a45e9928d8 Mon Sep 17 00:00:00 2001 From: Frank Steinberg <steinberg@ibr.cs.tu-bs.de> Date: Sat, 5 Oct 2019 19:29:17 +0200 Subject: [PATCH] README updates. Implemented "make status". --- Makefile | 46 +++++++++++++++++++++++++++++----------------- README.md | 10 ++++++++-- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 4ac0a8f..f528a02 100644 --- a/Makefile +++ b/Makefile @@ -5,37 +5,49 @@ FIXFILES = $(shell ls fix/*.xml) default: bjcp-2015-styleguide-orig.xml bjcp-2015-styleguide-de.xml bjcp-2015-styleguide-orig.html bjcp-2015-styleguide-de.html cache/2015_Guidelines_Beer.docx: - if [ ! -d cache ] ; then mkdir cache ; fi - curl -s https://www.bjcp.org/docs/2015_Guidelines_Beer.docx -o cache/2015_Guidelines_Beer.docx + @if [ ! -d cache ] ; then mkdir cache ; fi + @curl -s https://www.bjcp.org/docs/2015_Guidelines_Beer.docx -o cache/2015_Guidelines_Beer.docx + @echo "downloaded $@" cache/bjcp-2015-styleguide-word.xml: cache/2015_Guidelines_Beer.docx - unzip -p cache/2015_Guidelines_Beer.docx word/document.xml | xmllint --format - > cache/bjcp-2015-styleguide-word.xml + @unzip -p cache/2015_Guidelines_Beer.docx word/document.xml | xmllint --format - > cache/bjcp-2015-styleguide-word.xml + @echo "built $@" bjcp-2015-styleguide-orig.xml: $(FIXFILES) cache/bjcp-2015-styleguide-word.xml xsl/bjcp-2015-styleguide-doc-to-xml.xsl xsl/bjcp-2015-styleguide-split.xsl - -xsltproc --output bjcp-2015-styleguide-orig.xml xsl/bjcp-2015-styleguide-doc-to-xml.xsl cache/bjcp-2015-styleguide-word.xml 2>&1 | grep -v "failed to load external entity" - if [ ! -d orig ] ; then mkdir orig ; fi - xsltproc xsl/bjcp-2015-styleguide-split.xsl bjcp-2015-styleguide-orig.xml + @-xsltproc --output bjcp-2015-styleguide-orig.xml xsl/bjcp-2015-styleguide-doc-to-xml.xsl cache/bjcp-2015-styleguide-word.xml 2>&1 | grep -v "failed to load external entity" + @echo "built $@" + @if [ ! -d orig ] ; then mkdir orig ; fi + @xsltproc xsl/bjcp-2015-styleguide-split.xsl bjcp-2015-styleguide-orig.xml + @echo "built orig/" bjcp-2015-styleguide-de.xml: de bjcp-2015-styleguide-orig.xml $(DEFILES) xsl/bjcp-2015-styleguide-translate.xsl - -xsltproc --stringparam lang de --output bjcp-2015-styleguide-de.xml xsl/bjcp-2015-styleguide-translate.xsl bjcp-2015-styleguide-orig.xml 2>&1 | grep -v "failed to load external entity" + @-xsltproc --stringparam lang de --output bjcp-2015-styleguide-de.xml xsl/bjcp-2015-styleguide-translate.xsl bjcp-2015-styleguide-orig.xml 2>&1 | grep -v "failed to load external entity" + @echo "built $@" bjcp-2015-styleguide-orig.html: xsl/bjcp-2015-styleguide-html.xsl bjcp-2015-styleguide-orig.xml - xsltproc xsl/bjcp-2015-styleguide-html.xsl bjcp-2015-styleguide-orig.xml > bjcp-2015-styleguide-orig.html + @xsltproc xsl/bjcp-2015-styleguide-html.xsl bjcp-2015-styleguide-orig.xml > bjcp-2015-styleguide-orig.html + @echo "built $@" bjcp-2015-styleguide-de.html: xsl/bjcp-2015-styleguide-html.xsl bjcp-2015-styleguide-de.xml - xsltproc xsl/bjcp-2015-styleguide-html.xsl bjcp-2015-styleguide-de.xml > bjcp-2015-styleguide-de.html + @xsltproc xsl/bjcp-2015-styleguide-html.xsl bjcp-2015-styleguide-de.xml > bjcp-2015-styleguide-de.html + @echo "built $@" format: - for f in de/*.xml ; do xmllint --format $$f | sed -e 's/ standalone="yes"//' > cache/tmp.xml ; cmp -s cache/tmp.xml $$f || cat cache/tmp.xml > $$f ; rm cache/tmp.xml ; done + @for f in de/*.xml ; do xmllint --format $$f | sed -e 's/ standalone="yes"//' > cache/tmp.xml ; cmp -s cache/tmp.xml $$f ; if [ $$? -ne 0 ] ; then cat cache/tmp.xml > $$f ; echo "reformatted $$f" ; fi ; rm cache/tmp.xml ; done + +status: bjcp-2015-styleguide-orig.xml + @-xsltproc --stringparam lang de xsl/bjcp-2015-styleguide-status.xsl bjcp-2015-styleguide-orig.xml 2>&1 | grep -v "failed to load external entity" + test: bjcp-2015-styleguide-orig.xml bjcp-2015-styleguide-de.xml - xmllint --noout bjcp-2015-styleguide-orig.xml - xmllint --noout bjcp-2015-styleguide-de.xml + @xmllint --noout bjcp-2015-styleguide-orig.xml + @xmllint --noout bjcp-2015-styleguide-de.xml clean: - rm -rf cache orig - rm -f bjcp-2015-styleguide-orig.xml - rm -f bjcp-2015-styleguide-de.xml - rm -f bjcp-2015-styleguide-orig.html - rm -f bjcp-2015-styleguide-de.html + @rm -rf cache orig + @rm -f bjcp-2015-styleguide-orig.xml + @rm -f bjcp-2015-styleguide-de.xml + @rm -f bjcp-2015-styleguide-orig.html + @rm -f bjcp-2015-styleguide-de.html + @echo "cleanup done" diff --git a/README.md b/README.md index 9b65f06..96db064 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,14 @@ Besides all the contributors to the original BJCP document we would like to than - One further exception: You may add references (links) to other categories or subcategories as `<a idref="1">name</a>` or simply `<a idref="1A"/>`. In the first case you specify the visible link text (here "name"). In the second case the link text will be the `<name>` of the referenced category or subcategory. - All elements within category and subcategory files contain just one text block as a single paragraph. Do not try to add any formatting elements you may know from HTML. - To see the results of your translation work, you can re-run `make` at any time. -- You may call `make format` to reformat the `de` files to consistent XML indentation. This will not change the formatting of resulting human-readable documents. +- If some files in `de` are formatted inconsistently (we prefer two-blank-indents and just few line breaks and white space), you may call the following command. It just reformats the `de` files to consistent XML indentation. It will not change the formatting of resulting human-readable documents: + ``` + make format + ``` +- If you want to see the status of already translated elements, you may run: + ``` + make status + ``` - Note: We aim for a real translation. Even if you are convinced that adding details or rephrasing sections would make sense, please don't do that! (Maybe, we should establish a way to take notes in such cases. Let's discuss this, if you feel a real need.) - Take care for a consistent wording of all subject matter specific terms throughout the whole styleguide. - To supply your work back upstream to the repository, ...[TBD] @@ -88,7 +95,6 @@ See the LICENSE file. Note that this license relates only to the content of this - Add Acknowledgements to futher contributors? - Implement links. - Move to real public repo server und update text above. -- "make status" to display potentially missing translation snippets. - Improved tags handling (links, grouped lists, translated meaning, ...) - Appendices - XML Schema Definition -- GitLab