Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: Text output templating engine for XML/Javascript/etc files #11

Open
hoche opened this issue Feb 24, 2020 · 4 comments
Open

Comments

@hoche
Copy link
Owner

hoche commented Feb 24, 2020

Right now there's a bunch of different functions where XML is generated by doing sprintfs. Much is redundant and could be combined together. However, it occurs to me that it might be better to incorporate some sort of template engine for that. I'm not talking about sucking in a full-bore templating engine like Jinja or Jade (wrong language anyway), just creating a simple substitution engine where key tags in the text file get replaced with something out of std::unordered_map.

I'll have to analyze the code some, but I don't think we need much more than that.

If we have complex data it'd get complicated, but even then we could suck in something like https://github.com/pantor/inja.

@hoche hoche changed the title Discussion: Text output templating engine for HTML/JSON/etc files Discussion: Text output templating engine for HTML/Javascript/etc files Feb 24, 2020
@dBitech
Copy link
Collaborator

dBitech commented Feb 24, 2020

I'm not in favor of having splat produce anything that resembles HTML natively. Have it produce other computer readable formats such as JSOM or XML would be far better. Let a separate tool convert the computer-readable output into front end displayable data.

@der-stefan
Copy link
Collaborator

Having an optional HTML output would be a great feature and improves native usability. It also could serve as a kind of template for new splat web services - all that I knew are offline now.
And why not? Yet another option doesn't make splat unusable.
@hoche I had exactly this problem today how to include my existing Leaflet based map output in a clean way. All I did today was reading and understanding splat's code, but still there are open questions (#9 , #10 ).
My own toolchain is fine with one PNG and a JSON file that includes the four coordinates of two diagonal corners. It can also include additional meta information, e.g. all parameters that were used. Going to push that these days, but propably not finished for release.

@hoche
Copy link
Owner Author

hoche commented Feb 24, 2020

Sorry yeah, I misspoke and meant XML where I said HTML. I'll change the issue title. The general problem is the same though.

@hoche hoche changed the title Discussion: Text output templating engine for HTML/Javascript/etc files Discussion: Text output templating engine for XML/Javascript/etc files Feb 24, 2020
@hoche
Copy link
Owner Author

hoche commented Feb 25, 2020

@der-stefan When I mentioned HTML I was really thinking of the XML that's generated to make nice KML/KMZ files. For website usage, I'm not sure how much SPLAT! should generate, but I'd be more inclined to have it create JSON files that could be used as a data source for some client-side Javascript processing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants