samgaudet / mkdocs-madlibs

Code templating with user inputs for MkDocs superfences
MIT License
5 stars 1 forks source link

[Feature request]: Madlibs should support syncing several inputs when they share the same name #21

Open weaversam8 opened 6 days ago

weaversam8 commented 6 days ago

What would you like to see changed?

Sam, thanks for writing this, it's awesome! I can see this being particularly helpful for long guides where users must copy code or configuration but customize it with their inputs (e.g. username) as they do so.

I could see it being extremely helpful if a madlibs fence had two "inputs" with the same name, that they would be synced, so you'd only have to enter the input once. Going further, this could be extended to sync across the entire document (perhaps behind a frontmatter config) so a user could enter their information once (at the top of the document) and not have to enter it anywhere else.

For a good example of the type of document that might benefit from this, I submit 99designs/aws-vault/USAGE.md. The example string my_profile_master shows up in 18 different places in that document - it would be great if the user only had to update it once.

Code of Conduct

samgaudet commented 6 days ago

Hi Sam, thanks for creating this feature request!

I agree that this would be a great feature. For a bit of background, I wrote this library in hopes of mimicking Google's technical documentation—here is an example (try it yourself here):

Screenshot 2024-09-11 at 12 40 55 PM

To that end, Google's code snippet templating does support the functionality you are talking about, and I think it provides immense value to the user. I'll try to find some time to work on this feature soon, and please help yourself if you are interested to give it a shot yourself!

Thanks!