-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
docs: finish CarDocs migration to opendbc #1333
Conversation
This reverts commit 9d6f65a.
@sshane At your convenience, can you help make sure this stuff follows? Per our discussion, the API output will be kept stable even with upcoming CARS.md 2.0, but consumers will need to change their import path. |
# FIXME: make sure we run in a sensible way if not checked out as a submodule, try-except for writing to CARS.md | ||
CARS_MD_OUT = os.path.join(BASEDIR, "../", "../", "../", "docs", "CARS.md") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path to the out file should be in openpilot and passed in.
Since we don't write any docs in opendbc, probably best to leave everything in openpilot for now
For example, web4 just needs the opendbc API:
import os
from opendbc.car.docs import generate_cars_md, get_all_car_docs
WEB4_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
OUT_FILE = os.path.join(WEB4_DIR, "src/lib/vehicles.json")
if __name__ == '__main__':
content = generate_cars_md(get_all_car_docs(), os.path.join(WEB4_DIR, "static/vehicles_template.json"))
with open(OUT_FILE, "w") as f:
f.write(content)
print(f"Generated and written to {OUT_FILE}")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path to the out file should be in openpilot and passed in.
I can do that.
Since we don't write any docs in opendbc, probably best to leave everything in openpilot for now
We will. The new ALL-CARS.md (or whatever name we bikeshed) will live in opendbc. It needs to run, generate, save, and test in opendbc without having openpilot available.
CARS.md only lives in openpilot because we don't want to change the link until we have a bigger step-change in how it looks and works.
from opendbc.car.docs import generate_cars_md, get_all_car_docs
I'll see if I can juggle things to maintain that import location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just make docs.py executable and write the opendbc docs by default, then openpilot's docs.py can stay using the APIs in this file
Create opendbc/car/docs, gather docs-related stuff there. Prereq for #1286.
CARS.md will continue to live in the same place in openpilot.