Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Apr 12, 2019
1 parent 27715b1 commit c2215a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions foliatools/foliaspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,11 @@ def outputblock(block, target, varname, args, indent = ""):
required_attribs = addfromparents(element['class'],'required_attribs')
optional_attribs = addfromparents(element['class'],'optional_attribs')
if "CLASS" in required_attribs:
specdata["Declaration"] = "``<" + annotationtype.lower() + "-annotation set=\"...\">``"
specdata["Declaration"] = "``<" + annotationtype.lower() + "-annotation set=\"...\">`` *(note: set is mandatory)*"
elif "CLASS" in optional_attribs:
specdata["Declaration"] = "``<" + annotationtype.lower() + "-annotation set=\"...\">`` *(note: set is optional for this annotation type; if you declare this annotation type to be setless you can not assign classes)*"
else:
specdata["Declaration"] = "``<" + annotationtype.lower() + "-annotation>`` *(note: there is no set associated with this annotation type)"
specdata["Declaration"] = "``<" + annotationtype.lower() + "-annotation>`` *(note: there is never a set associated with this annotation type)"
specdata["Version History"] = spec['annotationtype_doc'][annotationtype.lower()]['history']
if target == 'rst':
for key, value in specdata.items():
Expand All @@ -582,7 +582,7 @@ def outputblock(block, target, varname, args, indent = ""):
except KeyError:
annotationtype = None
specdata["**Element**"] = "``<" + element['properties']['xmltag'] + ">``"
specdata["API Class"] = "``" + element['class'] + "`` (`FoLiApy API Reference <https://foliapy.readthedocs.io/en/latest/_autosummary/folia.main." + element['class'] + ">`_)"
specdata["API Class"] = "``" + element['class'] + "`` (`FoLiApy API Reference <https://foliapy.readthedocs.io/en/latest/_autosummary/folia.main." + element['class'] + ".html>`_)"
required_attribs = addfromparents(element['class'],'required_attribs')
if "CLASS" in required_attribs: required_attribs.add("SET")
if "ANNOTATOR" in required_attribs:
Expand Down Expand Up @@ -612,7 +612,7 @@ def outputblock(block, target, varname, args, indent = ""):
for elementname in accepted_data:
if "AbstractSpanRole" in parents[elementname]:
spanroles.append(elementname)
spanroles = ", ".join([ "``<" + elementdict[elementname]['properties']['xmltag'] + ">`` (``" + x + "``)" for x in spanroles ])
spanroles = ", ".join([ "``<" + elementdict[x]['properties']['xmltag'] + ">`` (``" + x + "``)" for x in spanroles ])
specdata["Span Role Elements"] = spanroles
specdata["Required Attributes"] = "\n ".join( [ line for line in outputblock("attributes_doc", target, "attributes_doc", ["EMPTY"] + [a.lower() for a in required_attribs]).split("\n") if line ] )
if ("xlink" in element["properties"] and element["properties"]["xlink"]) or ("xlink" in elementdict[parents[element["class"]][0]]["properties"] and elementdict[parents[element["class"]][0]]["properties"]["xlink"]):
Expand Down

0 comments on commit c2215a1

Please sign in to comment.