jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
528 stars 47 forks source link

Add properties to versions #138

Closed jimporter closed 10 months ago

jimporter commented 1 year ago

This would be a dictionary of key/value pairs for each version with no built-in meaning in mike, but which can be used by themes or other tools to do fancy things.

AdrianoKF commented 10 months ago

After you pointed out you'd be open to contributions towards 2.0 in issue #180 (sorry for the duplicate), I'm happy to work on this issue, if you're interested.

From an implementation perspective, this seems relatively straightforward - I guess the question is about user ergonomics on the CLI. I would propose a signature like mike deploy --prop FOO=1 --prop BAR=42 [...] VERSION, where the user can pass the same option an arbitrary number of times (similar to --env in Docker). Alternatively, if more complex properties are interesting to the user, maybe allowing the props directly in JSON format (e.g., --props-json as a CLI arg, or --props-file to enable reading from a file).

jimporter commented 10 months ago

This is actually about 75% done on a branch already, but thanks for the offer.