Skip to content

Commit 514f723

Browse files
author
André L F S Bacci
committed
Per extension entity example
1 parent c1dc55d commit 514f723

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

reference/entities.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Per extension entities
2+
3+
For textual entities, related to specific extensions, new or migrated
4+
from `language-snippets.ent`, please use the following conventions.
5+
6+
* Use an `ext.` prefix for all entity names;
7+
* Use model file below, for new entities files;
8+
* Place the entities in file named `doc-en/reference/$extension/entities.ent`;
9+
* Keep the entities sorted by name, one empty line separating each entity.
10+
11+
If the entity is "big" or otherwise difficult to edit in a file
12+
with many others, it is possible to create a individual entity per file,
13+
saved as `doc-en/entities/name.$extension.$entname.xml`, whereas the
14+
content can be any valid [well-balanced
15+
region](https://www.w3.org/TR/xml-fragment/#defn-well-balanced).
16+
DTD entity names are also valid here, but XML declarations are not.
17+
18+
XML namespaces are to be placed in the root `<entities>` element, and
19+
avoided in any `<entity>` child.
20+
21+
To rename existing entities to use the `ext.` prefix, is possible to
22+
create temporary aliases, with the following format:
23+
```xml
24+
<entity name="old.name">&new.name;</entity>
25+
```
26+
27+
Temporary aliases are better placed in
28+
`doc-en/entities/entities-remove.ent`, to avoid duplicated work in
29+
translations, but are acceptable here too.
30+
31+
### Example file
32+
33+
```xml
34+
<?xml version="1.0" encoding="utf-8"?>
35+
<!-- $Revision$ -->
36+
<!--
37+
    See `manual.xml` for XML namespaces defaults.
38+
    Keep the lines under 79 columns, to make the process of manual
39+
    translation easier, and to avoid wrap-around in some other contexts.
40+
-->
41+
<entities xmlns       = "http://docbook.org/ns/docbook"
42+
          xmlns:xlink = "http://www.w3.org/1999/xlink"
43+
          translate   = "yes">
44+
45+
<entity name="ext.$extention.$entity-name">
46+
 <simpara>
47+
  Text.
48+
 </simpara>
49+
</entity>
50+
51+
</entities>
52+
```

0 commit comments

Comments
 (0)