From 970150eb5cef6afad855d28eb9108cfbb7cad588 Mon Sep 17 00:00:00 2001 From: Thomas Schraitle Date: Fri, 25 Nov 2016 17:25:24 +0100 Subject: [PATCH 1/5] First attempt to create a VIM DTD file --- rng2vim.xsl | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 rng2vim.xsl diff --git a/rng2vim.xsl b/rng2vim.xsl new file mode 100644 index 0000000..d508a4a --- /dev/null +++ b/rng2vim.xsl @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + geekodoc + + + + + + + + \ 'vimxmlentities': [''], + + + + + let g:xmldata_ + + = { + + + + + + } " vim:ft=vim:ff=unix + + + + + + + + + + + + Found allowed elements for start. + + + + + + + + , + + + + + + + + + + + + + + + \ 'vimxmlroot': [ + + ], + + + + + + + + + + + + + + + + + WARN: Can't find appropriate node for + + + + + + + + + + + + define + + + \ [ + + + + ], + + + + \ ], + + + + + + + + \ No newline at end of file From 15404034a2f1a99a47ed93d43713a058d4826fac Mon Sep 17 00:00:00 2001 From: Thomas Schraitle Date: Mon, 28 Nov 2016 09:25:37 +0100 Subject: [PATCH 2/5] Creates a VIM XML Omni Datafile requires rng2srng --- rng2vim.xsl | 141 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 21 deletions(-) diff --git a/rng2vim.xsl b/rng2vim.xsl index d508a4a..5c4fe70 100644 --- a/rng2vim.xsl +++ b/rng2vim.xsl @@ -23,28 +23,36 @@ - geekodoc + geekodoc5 + + http://www.w3.org/XML/1998/namespace + http://www.w3.org/1999/xlink - - + + + let g:xmldata_ + + = { + \ 'vimxmlentities': [''], - - \ 'vimxmlentities': [''], + + } + " vim:ft=vim:ff=unix + - let g:xmldata_ - - = { - + + - + + + @@ -52,6 +60,10 @@ + + + + @@ -87,26 +99,113 @@ - - - - + + ref: : + + ' + + ' + + + + + + + + + + + + Found + + \ + + : [ + + + \ [ + + + , + + ], + + + \ { + + + + + + xml: + xlink: + + + + attr: + + [ + + + + , + + + ], + + } + \ ], + + + From d3538a768248a030cd70421c4376ad81b935c7b2 Mon Sep 17 00:00:00 2001 From: Thomas Schraitle Date: Mon, 28 Nov 2016 09:26:24 +0100 Subject: [PATCH 3/5] Add rule for geekodoc5.vim --- geekodoc/rng/Makefile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/geekodoc/rng/Makefile b/geekodoc/rng/Makefile index 3214c0f..2920d7a 100644 --- a/geekodoc/rng/Makefile +++ b/geekodoc/rng/Makefile @@ -6,6 +6,7 @@ # # Requirements: # * trang +# * rng2srng # * docbook_5 # * python3-rnginline (from obs://home:thomas-schraitle/python3-rnginline) @@ -20,13 +21,12 @@ DOCBOOKXI_RNG := $(patsubst .rnc,.rng,$(DOCBOOKXI_RNC)) .PHONY: all clean -all: $(SUSESCHEMA)-flat.rnc +all: $(SUSESCHEMA)-flat.rnc $(SUSESCHEMA)-flat.rng $(SUSESCHEMA).vim clean: - rm $(SUSESCHEMA)-flat.rnc $(DOCBOOKXI_RNC) $(DOCBOOKXI_RNG) 2>/dev/null || true - - -.INTERMEDIATE: $(SUSESCHEMA).rng $(SUSESCHEMA)-flat.rni $(SUSESCHEMA)-flat.rng + rm $(SUSESCHEMA)-flat.rn{c,g} \ + $(SUSESCHEMA).vim \ + $(DOCBOOKXI_RNC) $(DOCBOOKXI_RNG) 2>/dev/null || true $(DOCBOOKXI_RNC): $(DOCBOOKXI_RNC_PATH) @@ -37,6 +37,7 @@ $(SUSESCHEMA).rng: $(SUSESCHEMA).rnc $(DOCBOOKXI_RNC) @echo "* Converting $< -> $@" trang $< $@ +.INTERMEDIATE: $(SUSESCHEMA)-flat.rni $(SUSESCHEMA)-flat.rni: $(SUSESCHEMA).rng @echo "* Flattening $< -> $@" rnginline $< $@ @@ -50,3 +51,11 @@ $(SUSESCHEMA)-flat.rnc: $(SUSESCHEMA)-flat.rng trang $< $@ @sed -i -r 's_\s+$$__' $@ +# .INTERMEDIATE: $(SUSESCHEMA)-flat.srng +$(SUSESCHEMA)-flat.srng: $(SUSESCHEMA)-flat.rng + echo '* Creating Simplified RNG version' + rng2srng $< | xmllint --format - > $@ + +$(SUSESCHEMA).vim: $(SUSESCHEMA)-flat.srng + echo '* Creating VIM XML Omni Datafile...' + xsltproc -o $@ ../../rng2vim.xsl $< From 80ec7f057b5d95a4083cfa0ad7440865f8808e46 Mon Sep 17 00:00:00 2001 From: Thomas Schraitle Date: Mon, 28 Nov 2016 09:36:03 +0100 Subject: [PATCH 4/5] Fix OBS path --- geekodoc/rng/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geekodoc/rng/Makefile b/geekodoc/rng/Makefile index 2920d7a..6b8746a 100644 --- a/geekodoc/rng/Makefile +++ b/geekodoc/rng/Makefile @@ -8,7 +8,7 @@ # * trang # * rng2srng # * docbook_5 -# * python3-rnginline (from obs://home:thomas-schraitle/python3-rnginline) +# * python3-rnginline (from obs://devel:languages:python3/python3-rnginline) .SUFFIXES: .rng rnc From 478a75033ba3e8bd7c2822ce0dd33d322f59bc6a Mon Sep 17 00:00:00 2001 From: Thomas Schraitle Date: Mon, 28 Nov 2016 09:41:31 +0100 Subject: [PATCH 5/5] Improve header with metadata (URL, descript. etc.) --- rng2vim.xsl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rng2vim.xsl b/rng2vim.xsl index 5c4fe70..6ae0ce5 100644 --- a/rng2vim.xsl +++ b/rng2vim.xsl @@ -31,7 +31,14 @@ - let g:xmldata_ + " Vim XML data file +" Language: GeekoDoc5 +" Maintainer: Thomas Schraitle <tom@opensuse.org> +" URL: https://github.com/openSUSE/geekodo +" Last Change: November 2016 +" Description: An XML data file for the GeekoDoc5 markup language. + +let g:xmldata_ = { \ 'vimxmlentities': [''],