GW2-Elite-Insights-Parser icon indicating copy to clipboard operation
GW2-Elite-Insights-Parser copied to clipboard

Allow for templates to be "hydrated" from a given json blob

Open Lego6245 opened this issue 5 years ago • 0 comments

EI has the option to output a json blob and an HTML output. The HTML output uses a slightly different version of the data dumped in the json blob, the two are not compatable with each other. This means that if a developer wants structured data and the HTML output, they have three options.

  1. Generate just the HTML output, and then "pull out" the json used by the HTML output.
  2. Generate just the JSON and build their own HTML output.
  3. Generate both and store both, effectively doubling the amount of storage needed for a single log.

I propose the ability to take a given JSON blob and parse it into an HTML template. Ideally, this is possible without having to run EI again. Instead, a single template file could be loaded, and then via some other mechanism, the JSON needed to populate it is requested and loaded in place. This template file will likely be versioned as the underlying JSON contract may change from version to version. A developer would then maintain the JSON blobs and the template versions, and when a log file is requested, provide both the template matching the version of JSON, and the JSON blob itself.

This will allow for users of EI to store the rich, machine readable information, and still provide the familiar HTML interface to consumers, meaning that tasks like meta-analysis become much easier, without having to take the requirement of storing a bunch of duplicated data.

Lego6245 avatar Apr 15 '19 22:04 Lego6245