Skip to content

Commit c8c62d7

Browse files
accompanying files
1 parent 4323c61 commit c8c62d7

File tree

7 files changed

+34
-85
lines changed

7 files changed

+34
-85
lines changed

examples/document.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ A model for documents.
3030
<table>
3131
<tr>
3232
<td><b>sections</b></td>
33-
<td><a href="#section">Section</a></td>
33+
<td><a href="#list">List</a></td>
3434
<td><i>The sections of the document</i></td>
3535
</tr>
3636

@@ -55,7 +55,7 @@ A model of a section of the <a href="#document">Document</a>. Will contain one <
5555
<table>
5656
<tr>
5757
<td><b>paragraphs</b></td>
58-
<td><a href="#paragraph">Paragraph</a></td>
58+
<td><a href="#list">List</a></td>
5959
<td><i>The paragraphs</i></td>
6060
</tr>
6161

examples/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ class Document(Base):
110110
with open("document.specification.bson", "wb") as d:
111111
d.write(bson.encode(doc_dict))
112112

113-
save_to_xml_file(doc_dict, "document.specification.xml")
113+
save_to_xml_file(doc, "document.specification.xml")

examples/document.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Allowed field Data Type Description
1515

1616
**Allowed children**
1717

18-
=============== ====================== ============================
19-
Allowed child Data Type Description
20-
=============== ====================== ============================
21-
**sections** `Section <#section>`__ The sections of the document
22-
=============== ====================== ============================
18+
=============== ================ ============================
19+
Allowed child Data Type Description
20+
=============== ================ ============================
21+
**sections** `List <#list>`__ The sections of the document
22+
=============== ================ ============================
2323

2424
=======
2525
Section
@@ -36,11 +36,11 @@ Allowed field Data Type Description
3636

3737
**Allowed children**
3838

39-
=============== ========================== ==============
40-
Allowed child Data Type Description
41-
=============== ========================== ==============
42-
**paragraphs** `Paragraph <#paragraph>`__ The paragraphs
43-
=============== ========================== ==============
39+
=============== ================ ==============
40+
Allowed child Data Type Description
41+
=============== ================ ==============
42+
**paragraphs** `List <#list>`__ The paragraphs
43+
=============== ================ ==============
4444

4545
=========
4646
Paragraph

examples/document.specification.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"allowed_children": {
1919
"sections": {
20-
"type": "Section",
20+
"type": "List",
2121
"description": "The sections of the document"
2222
}
2323
}
@@ -32,7 +32,7 @@
3232
},
3333
"allowed_children": {
3434
"paragraphs": {
35-
"type": "Paragraph",
35+
"type": "List",
3636
"description": "The paragraphs"
3737
}
3838
}

examples/document.specification.xml

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,10 @@
11
<?xml version="1.0" ?>
2-
<modelspec>
3-
<Document>
4-
<definition>A model for documents.</definition>
5-
<allowed_parameters>
6-
<id>
7-
<type>str</type>
8-
<description>The unique id of the document</description>
9-
</id>
10-
<title>
11-
<type>str</type>
12-
<description>The document title</description>
13-
</title>
14-
<ISBN>
15-
<type>int</type>
16-
<description>International Standard Book Number</description>
17-
</ISBN>
18-
</allowed_parameters>
19-
<allowed_children>
20-
<sections>
21-
<type>Section</type>
22-
<description>The sections of the document</description>
23-
</sections>
24-
</allowed_children>
25-
</Document>
26-
<Section>
27-
<definition>A model of a section of the :class:`Document`. Will contain one :class:`Paragraph` or more, i.e the :class:`Paragraph`(s) in the section, probably related to the :code:`title` of the `Document &lt;#document&gt;`_.</definition>
28-
<allowed_parameters>
29-
<id>
30-
<type>str</type>
31-
<description>The id of the section</description>
32-
</id>
33-
</allowed_parameters>
34-
<allowed_children>
35-
<paragraphs>
36-
<type>Paragraph</type>
37-
<description>The paragraphs</description>
38-
</paragraphs>
39-
</allowed_children>
2+
<Document id="MyBook" title="My life in Python" ISBN="None">
3+
<Section id="Abstract">
4+
<Paragraph contents="Blah blah blah"/>
5+
<Paragraph contents="Blah2"/>
406
</Section>
41-
<Paragraph>
42-
<definition>A model of a paragraph.</definition>
43-
<allowed_parameters>
44-
<contents>
45-
<type>str</type>
46-
<description>Paragraph contents, which make up the :class:`Section`s.</description>
47-
</contents>
48-
</allowed_parameters>
49-
</Paragraph>
50-
</modelspec>
7+
<Section id="Chapter 1">
8+
<Paragraph contents="More..."/>
9+
</Section>
10+
</Document>

examples/document.specification.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Document:
1212
description: International Standard Book Number
1313
allowed_children:
1414
sections:
15-
type: Section
15+
type: List
1616
description: The sections of the document
1717
Section:
1818
definition: A model of a section of the :class:`Document`. Will contain one :class:`Paragraph`
@@ -24,7 +24,7 @@ Section:
2424
description: The id of the section
2525
allowed_children:
2626
paragraphs:
27-
type: Paragraph
27+
type: List
2828
description: The paragraphs
2929
Paragraph:
3030
definition: A model of a paragraph.

examples/document.xml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
<?xml version="1.0" ?>
2-
<modelspec>
3-
<MyBook>
4-
<title>My life in Python</title>
5-
<sections>
6-
<Abstract>
7-
<paragraphs>
8-
<contents>Blah blah blah</contents>
9-
</paragraphs>
10-
<paragraphs>
11-
<contents>Blah2</contents>
12-
</paragraphs>
13-
</Abstract>
14-
<Chapter_1>
15-
<paragraphs>
16-
<contents>More...</contents>
17-
</paragraphs>
18-
</Chapter_1>
19-
</sections>
20-
</MyBook>
21-
</modelspec>
2+
<Document id="MyBook" title="My life in Python" ISBN="None">
3+
<Section id="Abstract">
4+
<Paragraph contents="Blah blah blah"/>
5+
<Paragraph contents="Blah2"/>
6+
</Section>
7+
<Section id="Chapter 1">
8+
<Paragraph contents="More..."/>
9+
</Section>
10+
</Document>

0 commit comments

Comments
 (0)