Skip to content

Commit

Permalink
Fix the udl-list.md generation
Browse files Browse the repository at this point in the history
- URL-encode relative links to UDL/AC/FL, but leave http and https links alone
    - update requirements.txt for the modules added for URL-encoding
- Fix the LSL_byKimpaTammas JSON entry to reference UDL/AC/FL
    - Created issue #259 when I discovered that commit had
      added the files without them being referenced from JSON

(Was originally 22 commits; force-push to collapse to a single commit)
  • Loading branch information
pryrt committed Jun 13, 2024
1 parent 68f8d62 commit d585610
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
26 changes: 20 additions & 6 deletions .validators/validator_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from hashlib import sha256
from jsonschema import Draft202012Validator, FormatChecker
from pathlib import Path
import urllib

api_url = os.environ.get('APPVEYOR_API_URL')
has_error = False
Expand Down Expand Up @@ -82,6 +83,10 @@ def gen_pl_table(filename):
if not udl_link:
udl_link = "./UDLs/" + udl["id-name"] + ".xml"

# make sure all URL are properly encoded for non-http(s) paths
if not (len(udl_link)>4 and udl_link[0:4]=="http"):
udl_link = urllib.parse.quote(udl_link)

# author name (with optional link to homepage)
mailto = ""
if ' <mailto:' in udl["author"]:
Expand Down Expand Up @@ -126,13 +131,15 @@ def gen_pl_table(filename):
ac_link = str(udl["autoCompletion"]) + ".xml"

# print(f'autoCompletion: {udl["autoCompletion"]} => {ac_link}')

# absolute path for existence testing
ac_link_abs = Path(os.path.join(os.getcwd(),"autoCompletion", ac_link))

# relative path for correct linking
ac_link = "./autoCompletion/%s" % (ac_link)
# relative path for correct linking of non-http(s) links
if not (len(ac_link)>4 and ac_link[0:4]=="http"):
ac_link = "./autoCompletion/%s" % (urllib.parse.quote(ac_link))

# TODO: use autoCompletionAuthor field if the autoCompletion has a different author than the UDL (like for RenderMan)
# use autoCompletionAuthor field if the autoCompletion has a different author than the UDL (like for RenderMan)
if "autoCompletionAuthor" in udl:
if udl["autoCompletionAuthor"]:
author = udl["autoCompletionAuthor"]
Expand Down Expand Up @@ -163,13 +170,15 @@ def gen_pl_table(filename):
fl_link = str(udl["functionList"]) + ".xml"

# print(f'functionList: {udl["functionList"]} => {fl_link}')

# absolute path for existence testing
fl_link_abs = Path(os.path.join(os.getcwd(),"functionList", fl_link))

# relative path for correct linking
fl_link = "./functionList/%s" % (fl_link)
# relative path for correct linking of non-http(s) links
if not (len(fl_link)>4 and fl_link[0:4]=="http"):
fl_link = "./functionList/%s" % (urllib.parse.quote(fl_link))

# TODO: use functionListAuthor field if the functionList has a different author than the UDL (like for RenderMan)
# use functionListAuthor field if the functionList has a different author than the UDL (like for RenderMan)
if "functionListAuthor" in udl:
if udl["functionListAuthor"]:
author = udl["functionListAuthor"]
Expand All @@ -188,13 +197,18 @@ def gen_pl_table(filename):
else:
fl_list.append(tmpl_tr_b + "[" + udl["display-name"] +"](" + fl_link + ")" + tmpl_td + author + tmpl_td + udl["description"] + tmpl_tr_e)

print(f'## functionList length: {len(fl_list)}')

# add the Auto-Completion Definitions in a separate table at the end
# #print(f'## final autoCompletion List length: {len(ac_list)}')
tab_text += tmpl_new_line
tab_text += "## Auto-Completion Definitions%s%s" % (tmpl_new_line, tmpl_new_line)
tab_text += tmpl_tab_head
tab_text += tmpl_new_line.join(ac_list)

# add the FunctionList Definitions in a separate table at the end
# #print(f'## final functionList List length: {len(fl_list)}')
tab_text += tmpl_new_line
tab_text += tmpl_new_line
tab_text += "## FunctionList Definitions%s%s" % (tmpl_new_line, tmpl_new_line)
tab_text += tmpl_tab_head
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ lxml==5.2.2
pywin32==306
requests==2.32.3
rfc3987==1.3.8

# urllib # not needed to be listed (builtin module)
# hashlib # not needed to be listed (builtin module)
pathlib
2 changes: 2 additions & 0 deletions udl-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,8 @@
"display-name": "LSL",
"version": "Wed, 12 Jun 2024 17:43:48 GMT",
"repository": "",
"autoCompletion": true,
"functionList": true,
"description": "Linden Script Language (dark theme version)",
"author": "Kimpa Tammas <mailto:kimpa.tammas@free.fr>"
},
Expand Down
12 changes: 7 additions & 5 deletions udl-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
| [HSpice](./UDLs/HSpice_by-sahjakjebndmns.xml) | [sahjakjebndmns](mailto:sahjakjebndmns@users.sourceforge.net) | HSpice |
| [Htaccess](./UDLs/Htaccess_bySilasBrill.xml) | [Silas Brill](mailto:brilliand@gmail.com) | Htaccess |
| [IBM Net.Data](./UDLs/Net.Data-IBM_byMarkus.xml) | [Markus](mailto:die_scholl@yahoo.com) | IBM Net.Data |
| [IBM SBI Mapper Extended Rules](./UDLs/SBI Mapper.xml) | Mayot | IBM Sterling B2B Integrator Mapper for Extended Rules |
| [IBM SBI Mapper Extended Rules (Dark Mode)](./UDLs/SBI Mapper (Dark Mode).xml) | Mayot | IBM Sterling B2B Integrator Mapper for Extended Rules (Dark Mode) |
| [IBM SBI Mapper Extended Rules](./UDLs/SBI%20Mapper.xml) | Mayot | IBM Sterling B2B Integrator Mapper for Extended Rules |
| [IBM SBI Mapper Extended Rules (Dark Mode)](./UDLs/SBI%20Mapper%20%28Dark%20Mode%29.xml) | Mayot | IBM Sterling B2B Integrator Mapper for Extended Rules (Dark Mode) |
| [iCalendar](./UDLs/iCalendar_by-jfreundo.xml) | [jfreundo](mailto:jfreundo@users.sourceforge.net) | iCalendar |
| [IceBreak RPG](./UDLs/IceBreak-RPG_byNielsLiisberg.xml) | [Niels Liisberg](mailto:nli@system-method.com) | IceBreak RPG |
| [Icinga DSL](./UDLs/Icinga_DSL_by_robweber.xml) | [robweber](https://github.com/robweber) | Icinga DSL for use with Icinga2 monitoring solution |
Expand Down Expand Up @@ -290,7 +290,7 @@
| [Snort](./UDLs/Snort_byAnonymous_in2012.xml) | Anonymous | Snort |
| [Solution (.sln) files for Visual Studio](https://gist.githubusercontent.com/CADbloke/5493663/raw/fc217e40f7a451bc3d679196d0111f61786c775f/VisualStudioSolutionSLNstyler.xml) | [CADbloke](https://gist.github.com/CADbloke/5493663) | Solution (.sln) files for Visual Studio |
| [SPARQL 1.1](./UDLs/SPARQL-v1p1_byFranckMichel.xml) | [Franck Michel](mailto:frmichel7@killspam.gmail.remove.com) | SPARQL 1.1 |
| [SPiiPlus ACSPL+](./UDLs/SPiiPlus_ACSPL+_bySROMSE.xml) | MSE, SCHNEEBERGER AG Lineartechnik | SPiiPlus ACSPL+ |
| [SPiiPlus ACSPL+](./UDLs/SPiiPlus_ACSPL%2B_bySROMSE.xml) | MSE, SCHNEEBERGER AG Lineartechnik | SPiiPlus ACSPL+ |
| [SPlunk configuration](./UDLs/SplunkConfig_by-httpstergeek.xml) | [httpstergeek](mailto:httpstergeek@users.sourceforge.net) | SPlunk configuration |
| [SQL/9](./UDLs/SQL_Manifold9_byRKolka.xml) | [Riivo Kolka](mailto:riivo.kolka@gmail.com) | SQL of Manifold 9 |
| [SQR](./UDLs/SQR_byJames.xml) | [James](mailto:James@users.sourceforge.net) | SQR |
Expand Down Expand Up @@ -358,14 +358,16 @@
| [DAX](./autoCompletion/DAX_bySaschaKasper.xml) | [Sascha D. Kasper](https://sascha-kasper.com/dax-syntax-highlighting-for-notepad/) | DAX Data Visualization (Microsoft Power BI) |
| [Fobagraph Script LightMode](./autoCompletion/fobagraph.xml) | [HelloWorldFR](https://github.com/HelloWorldFR/) | Fobagraph Script for laser machine |
| [INTERLIS](./autoCompletion/interlis_byStefanBurckhardt.xml) | [Stefan Burckhardt](https://geostandards-ch.github.io/doc_refhb24/#_sonderzeichen_und_reservierte_w%C3%B6rter) | Syntax Highlightin for INTERLIS |
| [LSL](./autoCompletion/LSL_byKimpaTammas.xml) | [Kimpa Tammas](mailto:kimpa.tammas@free.fr) | Linden Script Language (dark theme version) |
| [RenderMan Shading Language &amp; RIB](./autoCompletion/RenderMan-RSL_by-focus_gfx.xml) | focus_gfx | RenderMan Shading Language &amp; RIB |
| [Robotframework v0.1](./autoCompletion/vkosuri-robotframework.xml) | [https://github.com/vkosuri](https://github.com/vkosuri/npp-robot) | Notepad++ syntax highlighting for Robotframework |
| [SciLab (highlighting and autocompletion)](./autoCompletion/http://fileexchange.scilab.org/toolboxes/140000/6.1/files/scilab.xml) | [Samuel Gougeon](http://fileexchange.scilab.org/toolboxes/140000) | SciLab (highlighting and autocompletion) |
| [SciLab (highlighting and autocompletion)](http://fileexchange.scilab.org/toolboxes/140000/6.1/files/scilab.xml) | [Samuel Gougeon](http://fileexchange.scilab.org/toolboxes/140000) | SciLab (highlighting and autocompletion) |
| [smali](./autoCompletion/smali_by_enjoyop.xml) | Enjoyop | Smali Language identification and autocompletion |
| [Smartsheet](./autoCompletion/Smartsheet_byKevinDickinson.xml) | [Kevin Dickinson](mailto:ktdickinson@gmail.com) | Smartsheet |
| [Vim script](./autoCompletion/Vimscript_by_rdipardo.xml) | [Robert Di Pardo](https://gist.github.com/rdipardo/0b78f62e1ce481ff0d8f8e80cc298ced) | User Defined Language for Vim script |

## FunctionList Definitions

| Name | Author | Description |
|-----|--------|-------------|

| [LSL](./functionList/LSL_byKimpaTammas.xml) | [Kimpa Tammas](mailto:kimpa.tammas@free.fr) | Linden Script Language (dark theme version) |

0 comments on commit d585610

Please sign in to comment.