From 8375e717b563f7b4ecf009ffae00174de1a0b8e9 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 23 Mar 2022 11:27:25 -0700 Subject: [PATCH] experiment with video links in GH add image how does this look? fix --- docs/CARS.md | 48 +++++++++++++++---------------- docs/assets/icon-youtube.svg | 3 ++ selfdrive/car/CARS_template.md | 3 +- selfdrive/car/docs.py | 2 +- selfdrive/car/docs_definitions.py | 5 +++- 5 files changed, 34 insertions(+), 27 deletions(-) create mode 100644 docs/assets/icon-youtube.svg diff --git a/docs/CARS.md b/docs/CARS.md index 72aa3bd5c..cd23e222f 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -39,11 +39,11 @@ How We Rate The Cars |Make|Model|Supported Package|openpilot ACC|Stop and Go|Steer to 0|Steering Torque|Actively Maintained| |---|---|---|:---:|:---:|:---:|:---:|:---:| |Genesis|G70 2020|All|||||| -|Hyundai|Palisade 2020-21|All|||||| +|Hyundai|Palisade 2020-21|All|||||| |Hyundai|Santa Fe 2019-20|All|||||| -|Hyundai|Sonata 2020-22|All|||||| +|Hyundai|Sonata 2020-22|All|||||| |Hyundai|Sonata Hybrid 2021-22|All|||||| -|Kia|Niro Electric 2019-22|All|||||| +|Kia|Niro Electric 2019-22|All|||||| |Kia|Telluride 2020|SCC + LKAS|||||| |Lexus|ES 2019-21|All|||||| |Lexus|ES Hybrid 2019-21|All|||||| @@ -57,15 +57,15 @@ How We Rate The Cars |Toyota|Avalon Hybrid 2022|All|||||| |Toyota|Camry 2021-22|All||[4](#Footnotes)|||| |Toyota|Camry Hybrid 2021-22|All|||||| -|Toyota|Corolla 2020-22|All|||||| -|Toyota|Corolla Hatchback 2019-22|All|||||| +|Toyota|Corolla 2020-22|All|||||| +|Toyota|Corolla Hatchback 2019-22|All|||||| |Toyota|Corolla Hybrid 2020-22|All|||||| |Toyota|Highlander 2020-22|All|||||| |Toyota|Highlander Hybrid 2020-22|All|||||| |Toyota|Mirai 2021|All|||||| -|Toyota|Prius 2021-22|All|||||| -|Toyota|Prius Prime 2021-22|All|||||| -|Toyota|RAV4 2019-21|All|||||| +|Toyota|Prius 2021-22|All|||||| +|Toyota|Prius Prime 2021-22|All|||||| +|Toyota|RAV4 2019-21|All|||||| |Toyota|RAV4 Hybrid 2019-21|All|||||| ## Silver Cars @@ -79,14 +79,14 @@ How We Rate The Cars |Audi|S3 2015-17|ACC + Lane Assist|||||| |Genesis|G70 2018|All|||||| |Genesis|G80 2018|All|||||| -|Hyundai|Elantra 2021-22|SCC + LKAS|||||| -|Hyundai|Elantra Hybrid 2021|SCC + LKAS|||||| +|Hyundai|Elantra 2021-22|SCC + LKAS|||||| +|Hyundai|Elantra Hybrid 2021|SCC + LKAS|||||| |Hyundai|Ioniq Electric 2020|SCC + LKAS|||||| |Hyundai|Ioniq Hybrid 2020-22|SCC + LFA|||||| |Hyundai|Ioniq Plug-In Hybrid 2020-21|SCC + LKAS|||||| |Hyundai|Kona 2020|SCC + LKAS|||||| |Hyundai|Kona Electric 2018-19|SCC + LKAS|||||| -|Hyundai|Kona Hybrid 2020|SCC + LKAS|||||| +|Hyundai|Kona Hybrid 2020|SCC + LKAS|||||| |Hyundai|Santa Fe 2021-22|All|||||| |Hyundai|Santa Fe Hybrid 2022|All|||||| |Hyundai|Santa Fe Plug-In Hybrid 2022|All|||||| @@ -97,8 +97,8 @@ How We Rate The Cars |Kia|Niro Hybrid 2021-22|SCC + LKAS|||||| |Kia|Optima 2019|SCC + LKAS|||||| |Kia|Seltos 2021|SCC + LKAS|||||| -|Kia|Sorento 2018-19|SCC + LKAS|||||| -|Kia|Stinger 2018|SCC + LKAS|||||| +|Kia|Sorento 2018-19|SCC + LKAS|||||| +|Kia|Stinger 2018|SCC + LKAS|||||| |Lexus|CT Hybrid 2017-18|LSS|[3](#Footnotes)||||| |Lexus|ES Hybrid 2017-18|LSS|[3](#Footnotes)||||| |Lexus|NX 2018-19|All|[3](#Footnotes)||||| @@ -112,12 +112,12 @@ How We Rate The Cars |Toyota|Avalon Hybrid 2019-21|TSS-P|[3](#Footnotes)||||| |Toyota|C-HR 2017-21|All|||||| |Toyota|C-HR Hybrid 2017-19|All|||||| -|Toyota|Camry 2018-20|All||[4](#Footnotes)|||| -|Toyota|Camry Hybrid 2018-20|All||[4](#Footnotes)|||| -|Toyota|Highlander 2017-19|All|[3](#Footnotes)||||| +|Toyota|Camry 2018-20|All||[4](#Footnotes)|||| +|Toyota|Camry Hybrid 2018-20|All||[4](#Footnotes)|||| +|Toyota|Highlander 2017-19|All|[3](#Footnotes)||||| |Toyota|Highlander Hybrid 2017-19|All|[3](#Footnotes)||||| |Toyota|RAV4 Hybrid 2016-18|TSS-P|[3](#Footnotes)||||| -|Toyota|Sienna 2018-20|All|[3](#Footnotes)||||| +|Toyota|Sienna 2018-20|All|[3](#Footnotes)||||| |Volkswagen|Arteon 2018, 2021[8](#Footnotes)|Driver Assistance|||||| |Volkswagen|Atlas 2018-19, 2022[8](#Footnotes)|Driver Assistance|||||| |Volkswagen|Golf 2015-20|Driver Assistance|||||| @@ -158,15 +158,15 @@ How We Rate The Cars |Chrysler|Pacifica 2020|Adaptive Cruise|||||| |Chrysler|Pacifica Hybrid 2017-18|Adaptive Cruise|||||| |Chrysler|Pacifica Hybrid 2019-21|Adaptive Cruise|||||| -|GMC|Acadia 2018[1](#Footnotes)|Adaptive Cruise|||||| +|GMC|Acadia 2018[1](#Footnotes)|Adaptive Cruise|||||| |Genesis|G90 2018|All|||||| -|Honda|Accord 2018-21|All|||||| +|Honda|Accord 2018-21|All|||||| |Honda|Accord Hybrid 2018-21|All|||||| |Honda|CR-V 2015-16|Touring|||||| |Honda|CR-V 2017-21|Honda Sensing|||||| |Honda|CR-V Hybrid 2017-19|Honda Sensing|||||| |Honda|Civic 2016-18|Honda Sensing|||||| -|Honda|Civic 2019-20|All|||[2](#Footnotes)||| +|Honda|Civic 2019-20|All|||[2](#Footnotes)||| |Honda|Civic Hatchback 2017-21|Honda Sensing|||||| |Honda|Fit 2018-19|Honda Sensing|||||| |Honda|Freed 2020|Honda Sensing|||||| @@ -183,8 +183,8 @@ How We Rate The Cars |Hyundai|Ioniq Electric 2019|SCC + LKAS|||||| |Hyundai|Ioniq Hybrid 2017-19|SCC + LKAS|||||| |Hyundai|Veloster 2019-20|SCC + LKAS|||||| -|Jeep|Grand Cherokee 2016-18|Adaptive Cruise|||||| -|Jeep|Grand Cherokee 2019-20|Adaptive Cruise|||||| +|Jeep|Grand Cherokee 2016-18|Adaptive Cruise|||||| +|Jeep|Grand Cherokee 2019-20|Adaptive Cruise|||||| |Kia|Niro Plug-In Hybrid 2019|SCC + LKAS|||||| |Kia|Optima 2017|SCC + LKAS|||||| |Lexus|IS 2017-19|All|||||| @@ -200,8 +200,8 @@ How We Rate The Cars |Subaru|Impreza 2017-19|EyeSight|||||| |Toyota|Avalon 2016-18|TSS-P|[3](#Footnotes)||||| |Toyota|Corolla 2017-19|All|[3](#Footnotes)||||| -|Toyota|Prius 2016-20|TSS-P|[3](#Footnotes)|||[5](#Footnotes)|| -|Toyota|Prius Prime 2017-20|All|[3](#Footnotes)|||[5](#Footnotes)|| +|Toyota|Prius 2016-20|TSS-P|[3](#Footnotes)|||[5](#Footnotes)|| +|Toyota|Prius Prime 2017-20|All|[3](#Footnotes)|||[5](#Footnotes)|| |Toyota|Prius v 2017|TSS-P|[3](#Footnotes)|||[5](#Footnotes)|| |Toyota|RAV4 2016-18|TSS-P|[3](#Footnotes)||||| |Volkswagen|California 2021[8](#Footnotes)|Driver Assistance|||||| diff --git a/docs/assets/icon-youtube.svg b/docs/assets/icon-youtube.svg new file mode 100644 index 000000000..48d3e9596 --- /dev/null +++ b/docs/assets/icon-youtube.svg @@ -0,0 +1,3 @@ + + + diff --git a/selfdrive/car/CARS_template.md b/selfdrive/car/CARS_template.md index 822595409..8de7d22da 100644 --- a/selfdrive/car/CARS_template.md +++ b/selfdrive/car/CARS_template.md @@ -1,4 +1,5 @@ {% set footnote_tag = '[{}](#Footnotes)' -%} +{% set video_link_tag = '' -%} {% set star_icon = '' -%} # Supported Cars @@ -43,7 +44,7 @@ How We Rate The Cars |{{Column | map(attribute='value') | join('|')}}| |---|---|---|:---:|:---:|:---:|:---:|:---:| {% for car_info in cars %} -|{% for column in Column %}{{car_info.get_column(column, star_icon, footnote_tag)}}|{% endfor %} +|{% for column in Column %}{{car_info.get_column(column, star_icon, footnote_tag, video_link_tag)}}|{% endfor %} {% endfor %} diff --git a/selfdrive/car/docs.py b/selfdrive/car/docs.py index 8077bfb13..ddbf8bb18 100755 --- a/selfdrive/car/docs.py +++ b/selfdrive/car/docs.py @@ -54,7 +54,7 @@ def get_tier_car_info() -> List[Tuple[Tier, List[CarInfo]]]: def generate_cars_md(tier_car_info: List[Tuple[Tier, List[CarInfo]]], template_fn: str) -> str: with open(template_fn, "r") as f: - template = jinja2.Template(f.read(), trim_blocks=True, lstrip_blocks=True) + template = jinja2.Template(f.read(), trim_blocks=True) footnotes = [fn.value.text for fn in ALL_FOOTNOTES] return template.render(tiers=tier_car_info, footnotes=footnotes, Star=Star, Column=Column) diff --git a/selfdrive/car/docs_definitions.py b/selfdrive/car/docs_definitions.py index 9bd140b8d..50f436ea6 100644 --- a/selfdrive/car/docs_definitions.py +++ b/selfdrive/car/docs_definitions.py @@ -89,7 +89,7 @@ class CarInfo: self.tier = {5: Tier.GOLD, 4: Tier.SILVER}.get(list(self.row.values()).count(Star.FULL), Tier.BRONZE) @typing.no_type_check - def get_column(self, column: Column, star_icon: str, footnote_tag: str) -> str: + def get_column(self, column: Column, star_icon: str, footnote_tag: str, video_link_tag: Optional[str] = None) -> str: item: Union[str, Star] = self.row[column] if column in StarColumns: item = star_icon.format(item.value) @@ -98,4 +98,7 @@ class CarInfo: if footnote is not None: item += footnote_tag.format(self.all_footnotes[footnote]) + if column == Column.MODEL and self.video_link is not None and video_link_tag is not None: + item += video_link_tag.format(self.video_link) + return item