Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tables markdown for classes in gendoc #137

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ontospy/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import logging
logging.basicConfig()

from configparser import SafeConfigParser
from configparser import ConfigParser
import sys, os
import pickle as cPickle

Expand Down Expand Up @@ -56,8 +56,8 @@

# sample endpoints
BOOTSTRAP_ENDPOINTS = [
"http://dbpedia.org/sparql",
"http://dbpedia.org/sparql",
"http://data.semanticweb.org/sparql",
"http://linkedgeodata.org/sparql",
"http://linkedgeodata.org/sparql",
"http://sparql.data.southampton.ac.uk/"
]
71 changes: 21 additions & 50 deletions ontospy/gendocs/media/templates/markdown/markdown_classinfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,59 +72,30 @@ owl:Thing
{% if each.domain_of_inferred %}
#### Instances of {{each.title}} can have the following properties:

<table border="1" cellspacing="3" cellpadding="5" class="classproperties table-hover ">

<tr>
<th height="40">Property</th><th>Description</th><th>Expected Type</th>
</tr>

{% for group in each.domain_of_inferred %}

{% for k,v in group.items() %}


<tr style="background: lightcyan;text-align: left;">
<th colspan="3" height="10" class="treeinfo"><span style="font-size: 80%;">
From <a title="{{k.qname}}" href="{{k.slug}}.md" class="rdfclass">{{k.title}}</a></span>
</th>
</tr>

{% for prop in v %}
<tr>
<td class="firsttd">
<a class="propcolor" title="{{prop.qname}}" href="{{prop.slug}}.md">{{prop.title}}</a>
</td>
<td class="thirdtd">
<span>{{prop.bestDescription}}</span>
</td>
<td class="secondtd">
{% if prop.ranges %}
{% for range in prop.ranges %}

<a title="{{range.qname}}" href="{{range.slug}}.md" class="rdfclass">{{range.title}}</a>

{% endfor %}
{% else %}
<i>owl:Thing</i>
{% endif %}
</td>
</tr>

{% endfor %}

{% endfor %}

{% endfor %}

</table>
{% for group in each.domain_of_inferred %}
{%- for k,v in group.items() -%}

##### From [{{k.title}}]({{k.slug}}.md):

| Property | Description | Expected Type |
|----------|-------------|---------------|
{% for prop in v -%}
| [{{prop.title}}]({{prop.slug}}.md) | {{prop.bestDescription()}} |
{%- if prop.ranges -%}
{%- for range in prop.ranges -%}
[{{range.title}}]({{range.slug}}.md)
{%- endfor -%}
{%- else -%}
*owl:Thing*
{%- endif -%}
|
{% endfor %}
{% endfor %}
{% endfor %}

{% endif %}



{% endif %}




{% endblock main_column %}
{% endblock main_column %}