Created
July 21, 2020 20:58
-
-
Save kfsone/6b5262c5a0c1324f0049262f681ec41a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<comment> | |
A pseudo-RXML of how you might implement a table-rendering based on a collection of YAML files, | |
using technologies built into Roxen since 1995, imagining the vcs tag had gained git support, | |
and that a yaml tag had been introduced similar to other parsing tags. | |
Roxen was based on uLPC, the MUD language, which was a dynamic (jit'd -> p-code) C++/Objective-C | |
like language, which meant it was capable of jit/caching dynamic content generation... | |
It featured a server-side XML-based scripting language called RXML which integrated with | |
your HTML fluidly the way modern HTML 5 introduced things like <template> etc. | |
http://docs.roxen.com/roxen/4.5/index.xml | |
</comment> | |
... | |
<table id="packages"> | |
<thead> | |
<tr> | |
<th> Package </th> <th> Id </th> <th> Description </th> | |
</tr> | |
</thead> | |
<tbody> | |
<comment> Populate and maintain a working copy, and try a git pull once every 5 minutes. </comment> | |
<cache minutes="5" variable="_.tmpdir,_.url"> <!-- if tmpdir or url change, discard the cache. --> | |
<vcs provider="git" path="&_.tmpdir;" uri="&_.url;" checkout="true" refresh="true" branch="master"/> | |
</cache> | |
<comment> Only rebuild the list if the commit hash changes. </comment> | |
<cache variable="vcs.revision"> | |
<comment> iterate over files in the working copy. </comment> | |
<emit source="path" path="&vcs.wc;" scope="file" glob="*.yaml" recurse="true"> | |
<!-- [roxen predates yaml, so I'm basing this on other modules --> | |
<yaml source="&file.path;" scope="yaml"> | |
<tr> <td> &file.filename; </td> <td> &yaml.Id; </td> <td> &yaml.Description; </td> </tr> | |
</yaml> | |
</emit> | |
</cache> | |
</tbody> | |
</table> | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment