1- # SUSE Schemas
1+ # GeekoDoc
22
3- [ ![ Build Status] ( https://travis-ci.org/openSUSE/geekodoc.svg?branch=develop )] ( https://travis-ci.org/openSUSE/geekodoc )
43
4+ [ ![ Validating GeekoDoc] ( https://github.com/openSUSE/geekodoc/actions/workflows/validate.yml/badge.svg )] ( https://github.com/openSUSE/geekodoc/actions/workflows/validate.yml )
55
6- ## GeekoDoc
76
8- GeekoDoc is a RELAX NG schema and a subset of DocBook 5. Currently, it can be
9- used in two variants:
7+ ## What is GeekoDoc?
108
11- 1 . As the file ` geekodoc5.rn{c,g} ` which is based on ` docbookxi.rn{c,g} ` . In
12- other words, the GeekoDoc schema cannot life without the DocBook schema.
13- 2 . As a single` geekodoc5-flat.rn{c,g} ` . This file is independant from the
14- DocBook schema and can be used without having DocBook 5 installed on
15- your system.
9+ GeekoDoc is a RELAX NG schema and a subset of DocBook 5. It restricts the
10+ content model of some elements and attributes to make it easier to
11+ write documents.
1612
17- Both variants contain the same structure, elements, and attributes. They
18- serve different purposes.
13+ Valid GeekoDoc documents are also valid DocBook 5 documents.
14+
15+
16+ ## GeekoDoc Versions
17+
18+ GeekoDoc comes in two versions that are currently very similar.
19+ Their main difference is that GeekoDoc 2 restricts ` xml:id ` attributes
20+ to a more SEO-friendly subset of characters. More changes are to be
21+ expected in the future.
22+
23+ In general, we recommend using GeekoDoc 2 for all new projects.
24+
25+ * GeekoDoc 1: available via the URI ` urn:x-suse:rng:v1:geekodoc-flat `
26+ * GeekoDoc 2: available via the URI ` urn:x-suse:rng:v2:geekodoc-flat `
27+
28+ ## Additional versions of GeekoDoc
29+
30+ * New, versioned URIs:
31+ * Available for GeekoDoc 1 and GeekoDoc 2
32+ * General syntax: ` urn:x-suse:FORMAT:VERSION:SCHEMA `
33+ * FORMAT: can be ` rnc ` or ` rng `
34+ * VERSION: can be ` v1 ` or ` v2 `
35+ * SCHEMA: ` geekodoc-flat `
36+ * Includes the following URIs:
37+
38+ urn:x-suse:rnc:v1:geekodoc-flat
39+ urn:x-suse:rng:v1:geekodoc-flat
40+ urn:x-suse:rnc:v2:geekodoc-flat
41+ urn:x-suse:rng:v2:geekodoc-flat
42+
43+ * Old, unversioned URIs (do not use for new projects):
44+ * Only available for GeekoDoc 1
45+ * General syntax: ` urn:x-suse:rng:FILE `
46+ * Includes the following URIs:
47+
48+ urn:x-suse:rng:geekodoc5.rnc
49+ urn:x-suse:rng:geekodoc5-flat.rnc
50+ urn:x-suse:rng:geekodoc5.rng
51+ urn:x-suse:rng:geekodoc5-flat.rng
52+
53+ ## Using GeekoDoc with DAPS
54+
55+ To use GeekoDoc for validating your XML documents with DAPS, add the
56+ following line in your ` ~/.config/daps/dapsrc ` and replace ` <URI> `
57+ with one of the URIs above:
58+
59+ DOCBOOK5_RNG_URI="<URI>"
60+
61+ It is possible to add the previous line into a DC file.
1962
2063
2164## Creating Flat GeekoDoc
2265
23- Creating the flat GeekoDoc schema requires the ` rnginline ` tool at
24- https://github.com/h4l/rnginline/
66+ Creating the flat GeekoDoc schema requires the ` rnginline ` tool from
67+ https://github.com/h4l/rnginline/ .
2568
2669Use one of the following methods to install ` rnginline ` :
2770
2871* Install from an RPM package
2972* Install it in a Python virtual environment
3073
3174
32- ### Installing rnginline from RPM Package
75+ ### Installing rnginline from RPM Package on openSUSE
3376
3477The following procedure can be used for the latest openSUSE Leap release:
3578
36- 1 . Add the repository:
79+ 1 . Add the ` devel:languages:python ` repository:
3780
38- ```
39- $ sudo zypper ar https://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_Leap_\$releasever/devel:languages:python.repo
40- ```
81+ * for openSUSE Leap:
82+
83+ ```
84+ $ sudo zypper ar https://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_Leap_\$releasever/devel:languages:python.repo
85+ ```
86+
87+ * for openSUSE Tumbleweed:
88+
89+ ```
90+ $ sudo zypper ar https://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_Tumbleweed/devel:languages:python.repo
91+ ```
4192
42- 2 . Install it :
93+ 2. Install the package :
4394
4495 ```
4596 $ sudo zypper in python3-rnginline
@@ -51,6 +102,11 @@ The executable can be found in `/usr/bin/rnginline`.
51102### Installing rnginline using a Python Virtual Environment
52103
531041. Install the RPM packages `python3-devel`, `libxml2-devel`, and `libxslt-devel`.
105+ On openSUSE, run:
106+
107+ ```
108+ $ sudo zypper in python3-devel libxml2-devel libxslt-devel
109+ ```
54110
551112. Create a Python3 virtual environment:
56112
@@ -64,7 +120,7 @@ The executable can be found in `/usr/bin/rnginline`.
64120 $ source .env3/bin/activate
65121 ```
66122
67- => You should see a changed prompt (look for the " (.env3)" part).
123+ You should see a changed prompt (look for the ` (.env3)` part).
68124
691253. Install the `rnginline` library from PyPi:
70126
@@ -80,9 +136,9 @@ The executable can be found in `.env3/bin/rnginline`.
80136
811371. Update your GitHub repository.
82138
83- 2 . Change the directory to ` geekodoc/rng ` .
139+ 2. Run `./build.sh `.
84140
85- 3 . Run ` make ` .
141+ 3. Find the built schema in `dist/geekodoc/rng/ `.
86142
87143
88144### Installing it on Debian/Ubuntu
@@ -119,7 +175,11 @@ To install GeekoDoc on Debian or Ubuntu from scratch, do the following steps:
119175
120176 $ xmlcatalog /etc/xml/catalog \
121177 https://github.com/openSUSE/geekodoc/raw/master/geekodoc/rng/geekodoc5-flat.rnc \
122- urn:x-suse:rng:geekodoc5.rng
178+ urn:x-suse:rng:geekodoc5.rng \
179+ urn:x-suse:rnc:v1:geekodoc-flat \
180+ urn:x-suse:rng:v1:geekodoc-flat \
181+ urn:x-suse:rnc:v2:geekodoc-flat \
182+ urn:x-suse:rng:v2:geekodoc-flat
123183
124184 You should get something like this:
125185
@@ -141,3 +201,18 @@ $ rng2vim geekodoc5-flat.rng geekodoc
141201```
142202
143203The file `geekodoc.vim` can be used with vim.
204+
205+
206+ ## Creating an Archive for Open Build Service
207+
208+ If you develop on GeekoDoc and would like to create an archive file
209+ for OBS, use the following steps:
210+
211+ 1. Configure first the `bzip` command (this has to be done only once):
212+
213+ $ git config tar.tar.bz2.command "bzip2 -c"
214+
215+ 2. Create an archive and save it in your OBS directory (`OBSDIR`):
216+
217+ $ git archive --format=tar.bz2 --prefix=geekodoc-2.0.1/ -o <OBSDIR>/geekodoc-2.0.1.tar.bz2 HEAD
218+
0 commit comments