mirror of https://github.com/tdwg/dwc.git
Fix two problems with list of terms build script
Fixed: - correctly removed trailing vertical bars from all index sections - added missing <tr> opening tag
This commit is contained in:
parent
5bd258ecee
commit
d26027826a
|
@ -233,11 +233,9 @@
|
|||
" if row['rdf_type'] == 'http://www.w3.org/2000/01/rdf-schema#Class':\n",
|
||||
" curie = row['pref_ns_prefix'] + \":\" + row['term_localName']\n",
|
||||
" curie_anchor = curie.replace(':','_')\n",
|
||||
" text += '[' + curie + '](#' + curie_anchor + ')'\n",
|
||||
" if row_index < len(terms_sorted_by_localname) - 1:\n",
|
||||
" text += ' |'\n",
|
||||
" text += '\\n'\n",
|
||||
"text += '\\n'\n",
|
||||
" text += '[' + curie + '](#' + curie_anchor + ') |\\n'\n",
|
||||
"text = text[:len(text)-2] # remove final trailing vertical bar and newline\n",
|
||||
"text += '\\n\\n' # put back removed newline\n",
|
||||
"\n",
|
||||
"for category in range(0,len(display_order)):\n",
|
||||
" text += '**' + display_label[category] + '**\\n'\n",
|
||||
|
@ -252,11 +250,10 @@
|
|||
" if row['rdf_type'] != 'http://www.w3.org/2000/01/rdf-schema#Class':\n",
|
||||
" curie = row['pref_ns_prefix'] + \":\" + row['term_localName']\n",
|
||||
" curie_anchor = curie.replace(':','_')\n",
|
||||
" text += '[' + curie + '](#' + curie_anchor + ')'\n",
|
||||
" if row_index < len(filtered_table) - 1:\n",
|
||||
" text += ' |'\n",
|
||||
" text += '\\n'\n",
|
||||
" text += '\\n'\n",
|
||||
" text += '[' + curie + '](#' + curie_anchor + ') |\\n'\n",
|
||||
" text = text[:len(text)-2] # remove final trailing vertical bar and newline\n",
|
||||
" text += '\\n\\n' # put back removed newline\n",
|
||||
"\n",
|
||||
"index_by_name = text\n",
|
||||
"\n",
|
||||
"#print(index_by_name)\n",
|
||||
|
@ -301,11 +298,9 @@
|
|||
"for row_index,row in terms_sorted_by_label.iterrows():\n",
|
||||
" if row['rdf_type'] == 'http://www.w3.org/2000/01/rdf-schema#Class':\n",
|
||||
" curie_anchor = row['pref_ns_prefix'] + \"_\" + row['term_localName']\n",
|
||||
" text += '[' + row['label'] + '](#' + curie_anchor + ')'\n",
|
||||
" if row_index < len(terms_sorted_by_label) - 1:\n",
|
||||
" text += ' |'\n",
|
||||
" text += '\\n'\n",
|
||||
"text += '\\n'\n",
|
||||
" text += '[' + row['label'] + '](#' + curie_anchor + ') |\\n'\n",
|
||||
"text = text[:len(text)-2] # remove final trailing vertical bar and newline\n",
|
||||
"text += '\\n\\n' # put back removed newline\n",
|
||||
"\n",
|
||||
"for category in range(0,len(display_order)):\n",
|
||||
" if organized_in_categories:\n",
|
||||
|
@ -320,11 +315,10 @@
|
|||
" if row_index == 0 or (row_index != 0 and row['label'] != filtered_table.iloc[row_index - 1].loc['label']): # this is a hack to prevent duplicate labels\n",
|
||||
" if row['rdf_type'] != 'http://www.w3.org/2000/01/rdf-schema#Class':\n",
|
||||
" curie_anchor = row['pref_ns_prefix'] + \"_\" + row['term_localName']\n",
|
||||
" text += '[' + row['label'] + '](#' + curie_anchor + ')'\n",
|
||||
" if row_index < len(filtered_table) - 2 or (row_index == len(filtered_table) - 2 and row['label'] != filtered_table.iloc[row_index + 1].loc['label']):\n",
|
||||
" text += ' |'\n",
|
||||
" text += '\\n'\n",
|
||||
" text += '\\n'\n",
|
||||
" text += '[' + row['label'] + '](#' + curie_anchor + ') |\\n'\n",
|
||||
" text = text[:len(text)-2] # remove final trailing vertical bar and newline\n",
|
||||
" text += '\\n\\n' # put back removed newline\n",
|
||||
"\n",
|
||||
"index_by_label = text\n",
|
||||
"print()\n",
|
||||
"\n",
|
||||
|
@ -384,6 +378,7 @@
|
|||
" uri = row['pref_ns_uri'] + row['term_localName']\n",
|
||||
" text += '\\t\\t\\t<td><a href=\"' + uri + '\">' + uri + '</a></td>\\n'\n",
|
||||
" text += '\\t\\t</tr>\\n'\n",
|
||||
" text += '\\t\\t<tr>\\n'\n",
|
||||
" text += '\\t\\t\\t<td>Modified</td>\\n'\n",
|
||||
" text += '\\t\\t\\t<td>' + row['term_modified'] + '</td>\\n'\n",
|
||||
" text += '\\t\\t</tr>\\n'\n",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue