Skip to content

Commit

Permalink
Merge pull request OBOFoundry#160 from jamesaoverton/sort-ont-table
Browse files Browse the repository at this point in the history
Sort ontology list: Foundry, Library, Obsolete
  • Loading branch information
jamesaoverton committed Nov 4, 2015
2 parents 818bfc2 + 3e731ac commit 682a0f0
Show file tree
Hide file tree
Showing 8 changed files with 2,691 additions and 2,670 deletions.
1,142 changes: 571 additions & 571 deletions _config.yml

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions _includes/ontology_table.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Download table as: [ <a href="/registry/ontologies.yml">YAML</a> | <a href="/registry/ontologies.jsonld">JSON-LD</a> | <a href="/registry/ontologies.ttl">RDF/Turtle</a> ]
<table class="table">
<tbody>
{% assign sorted_ontologies = site.ontologies | sort: 'in_foundry_order', 'last' %}
{% for ont in sorted_ontologies %}
<tr>
{% for ont in site.ontologies %}
<tr class="{% if ont.in_foundry_order %}foundry{% elsif ont.is_obsolete %}obsolete{% endif %}">
<td>
<a href="ontology/{{ ont.id }}.html" >
{% if ont.is_obsolete %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/themes/bootstrap-3/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<link href="{{ ASSET_PATH }}/bootstrap/css/bs-sticky-footer.css" rel="stylesheet">

<!-- Custom styles -->
<link href="{{ ASSET_PATH }}/css/style.css?body=1" rel="stylesheet" type="text/css" media="all">
<link href="/css/custom.css" rel="stylesheet" type="text/css" media="all">

<style>
@media (min-width: 768px) {
Expand Down
7 changes: 7 additions & 0 deletions css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.foundry {
background-color: #f0fbff;
}

.obsolete {
background-color: #f6f6f6;
}
2,834 changes: 1,417 additions & 1,417 deletions registry/ontologies.jsonld

Large diffs are not rendered by default.

208 changes: 104 additions & 104 deletions registry/ontologies.ttl

Large diffs are not rendered by default.

1,142 changes: 571 additions & 571 deletions registry/ontologies.yml

Large diffs are not rendered by default.

21 changes: 18 additions & 3 deletions util/extract-metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,32 @@ def validate_structure(obj,md):
return errs

def concat_ont_yaml(args):
"""
Given arguments with files and ouput,
read YAML files into an array, decorate the objects, and write an output YAML file.
Output will be Foundry ontologies first, Library ontologies second, and obsolete last.
Assumes that args.files is already sorted alphabetically.
"""
objs = []
foundry = []
library = []
obsolete = []
cfg = {}
if (args.include):
f = open(args.include, 'r')
f = open(args.include, 'r')
cfg = yaml.load(f.read())
for fn in args.files:
(obj, md) = load_md(fn)
objs.append(obj)
if 'is_obsolete' in obj and obj['is_obsolete'] == True:
obsolete.append(obj)
elif 'in_foundry_order' in obj:
foundry.append(obj)
else:
library.append(obj)
objs = foundry + library + obsolete
cfg['ontologies'] = objs
decorate_metadata(objs)
f = open(args.output, 'w')
f = open(args.output, 'w')
f.write(yaml.dump(cfg))
return cfg

Expand Down

0 comments on commit 682a0f0

Please sign in to comment.