car docs: document parts of parts
Includes old and new code (why it's only a green diff)
This aims to make it easy to document and maintain the parts that come in the shop and the parts required to drive the car.
- [ ] clean up old parts code
- [ ] use new code for all cars
- [ ] ensure we can make a template using this for the site
- [ ] (another PR) display all openpilot hardware and their sub parts somewhere in a md file on GitHub, then only list top level parts on CARS.md and site (comma three, Hyundai A connector) with links?
This allows you to specify sub-parts recursively for any part. So you can separate car harness, red panda kit, and comma three parts for the shop. You can also specify to only show the required parts on the docs and then have all parts in the shop.
It still may be a bit complicated, but I don't know if the alternative with the flat parts enum will be any easier to maintain. I tried to encapsulate all of the specifics of the part shop into one place, instead of having logic spread across openpilot, jinja website templates, and javascript which eventually will get out of hand.
@maxime-desroches what do you think about something like this? It's also possible we don't need this complexity just yet.
Yes this is pretty much what I was about to write but with kits. It does add complexity + redundant/duplicate code, but at least it is in only one place and is in Python which make it much more manageable.
feel free to take this over and make changes as you wish then