Skip to content

Commit f8babb2

Browse files
committed
fix conflicts
2 parents 4e5d1c6 + 8d9ef79 commit f8babb2

File tree

2 files changed

+30
-51
lines changed

2 files changed

+30
-51
lines changed

examples/document.rst

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,42 @@ A model for documents.
55

66
**Allowed parameters**
77

8-
=============== =========== ==================================
8+
=============== =========== ====================================
99
Allowed field Data Type Description
10-
=============== =========== ==================================
11-
**id** str The unique id of the document
12-
**title** str Document title
13-
**ISBN** int International Standard Book Number
14-
=============== =========== ==================================
10+
=============== =========== ====================================
11+
**id** str *The unique id of the document*
12+
**title** str *Document title*
13+
**ISBN** int *International Standard Book Number*
14+
=============== =========== ====================================
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** `Section <#section>`__ *The sections of the document*
22+
=============== ====================== ==============================
2323

2424
=======
2525
Section
2626
=======
27-
A model of a section of the `Document <#document>`_. Will contain one `Paragraph <#paragraph>`_ or more, i.e the `Paragraph(s) <#paragraph>`_ in the section, probably related to the **title** of the `Document <#document>`_.
27+
A model of a section of the `Document <#document>`__ . Will contain one `Paragraph <#paragraph>`__ or more.
2828

2929
**Allowed parameters**
3030

31-
=============== =========== =====================
31+
=============== =========== =======================
3232
Allowed field Data Type Description
33-
=============== =========== =====================
34-
**id** str The id of the section
35-
=============== =========== =====================
33+
=============== =========== =======================
34+
**id** str *The id of the section*
35+
=============== =========== =======================
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** `Paragraph <#paragraph>`__ *The paragraphs*
43+
=============== ========================== ================
4444

4545
=========
4646
Paragraph
@@ -49,8 +49,8 @@ A model of a paragraph.
4949

5050
**Allowed parameters**
5151

52-
=============== =========== =============================================================
52+
=============== =========== ===================================================
5353
Allowed field Data Type Description
54-
=============== =========== =============================================================
55-
**contents** str Paragraph contents, which make up the `Sections <#section>`_.
56-
=============== =========== =============================================================
54+
=============== =========== ===================================================
55+
**contents** str *Paragraph contents, which make up the _Section_s.*
56+
=============== =========== ===================================================

src/modelspec/base_types.py

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ def _cls_generate_documentation(cls, format: str = MARKDOWN_FORMAT):
581581

582582
print(f" - {cls.__name__} ({definition})")
583583

584-
rst_url_format = "`%s <%s>`_"
584+
rst_url_format = "`%s <%s>`__"
585585

586586
def insert_links(text, format=MARKDOWN_FORMAT):
587587

@@ -594,12 +594,7 @@ def insert_links(text, format=MARKDOWN_FORMAT):
594594
pre = text2[0:ind]
595595
ref = text2[ind + len(code_ref) : ind2]
596596
post = text2[ind2 + 1 :]
597-
598-
if format == MARKDOWN_FORMAT:
599-
text2 = f"{pre}<b>{ref}</b>{post}"
600-
elif format == RST_FORMAT:
601-
text2 = f"{pre}**{ref}**{post}"
602-
597+
text2 = f"{pre}<b>{ref}</b>{post}"
603598
# print(" > Converted to: %s" % text2)
604599
text = text2
605600

@@ -617,23 +612,7 @@ def insert_links(text, format=MARKDOWN_FORMAT):
617612
if format == MARKDOWN_FORMAT:
618613
text2 = f'{pre}<a href="#{ref.lower()}">{ref}</a>{post}'
619614
elif format == RST_FORMAT:
620-
rr = ref
621-
pp = post
622-
623-
######################################
624-
# Some hardcoded fixes for plurals...
625-
if pp.startswith("s "):
626-
rr += "s"
627-
pp = pp[1:]
628-
if pp.startswith("s."):
629-
rr += "s"
630-
pp = pp[1:]
631-
if pp.startswith("(s)"):
632-
rr += "(s)"
633-
pp = pp[3:]
634-
######################################
635-
636-
text2 = f"{pre}`{rr} <#{ref.lower()}>`_{pp}"
615+
text2 = f"{pre}`{ref} <#{ref.lower()}>`__ {post}"
637616

638617
# print(" > Converted to: %s" % text2)
639618
text = text2
@@ -715,7 +694,7 @@ def insert_links(text, format=MARKDOWN_FORMAT):
715694
if referencable
716695
else type_str,
717696
)
718-
d = "%s" % (insert_links(description, format=RST_FORMAT))
697+
d = "*%s*" % (insert_links(description, format=RST_FORMAT))
719698
table_info.append([n, t, d])
720699

721700
if referencable:
@@ -776,7 +755,7 @@ def insert_links(text, format=MARKDOWN_FORMAT):
776755
if referencable
777756
else type_str,
778757
)
779-
d = "%s" % (insert_links(description, format=RST_FORMAT))
758+
d = "*%s*" % (insert_links(description, format=RST_FORMAT))
780759
table_info.append([n, t, d])
781760

782761
# Get the contained type

0 commit comments

Comments
 (0)