Skip to content
New issue

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

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

Already on GitHub? # to your account

How to add auto-generated parts to web pages? #13

Open
lassik opened this issue Nov 25, 2023 · 4 comments
Open

How to add auto-generated parts to web pages? #13

lassik opened this issue Nov 25, 2023 · 4 comments

Comments

@lassik
Copy link
Contributor

lassik commented Nov 25, 2023

(Prompted by issue #11)

Many of our current pages are fixed .html files. It's not simple to add machine-generated information (e.g. standardi links and timestamps) onto those.

On the www.scheme.org front page, generated from the repo https://github.com/schemeorg/schemeorg, we use an approach where the HTML structure of the page is embedded as SXML in a Scheme script. Most of the text on the page is parsed from Markdown (.md) files into SXML and inserted into the right place in the structure. This works nicely. Could we scale up this approach?

@arthurgleckler
Copy link
Contributor

I replied on #11, but should have replied here:

On another project, I've had luck using Pandoc to convert HTML into JSON, then reading the JSON, manipulating it, and converting back to HTML. We could use that technique to put footer elements even on static HTML pages.

@lassik
Copy link
Contributor Author

lassik commented Dec 9, 2023

Quoting @spdegabrielle:

I understand the urge to automate - but I believe it creates a barrier to contribution.

If I edit html I know it is going to work, if I use an automation someone else has put together - even common ones - you add the responsibility for me to locally implement your implementation to test my change has worked before posting the PR.

You also run the risk I am naughty and don't test my PR - then the repo owners get the additional work that comes with untested PR's failing more often than ones that have been tested.

@lassik
Copy link
Contributor Author

lassik commented Dec 9, 2023

You also run the risk I am naughty and don't test my PR - then the repo owners get the additional work that comes with untested PR's failing more often than ones that have been tested.

This happens already. It's not a big deal - one minute is wasted occasionally.

@lassik
Copy link
Contributor Author

lassik commented Dec 9, 2023

On another project, I've had luck using Pandoc to convert HTML into JSON, then reading the JSON, manipulating it, and converting back to HTML. We could use that technique to put footer elements even on static HTML pages.

Based on both your comments and my own recent experiences, I'm starting to lean toward this option.

So the repos would contain bare-bones HTML files that produce readable pages as-is, but are fleshed out with boilerplate and styling by script. @spdegabrielle Is this OK?

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

No branches or pull requests

2 participants