-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
- Loading branch information
Showing
97 changed files
with
1,692 additions
and
1,190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[data-tooltip] { | ||
position: relative; | ||
display: inline-block; | ||
border-bottom: 1px dotted black; | ||
} | ||
|
||
[data-tooltip] .tooltip-content { | ||
width: max-content; | ||
max-width: 25em; | ||
position: absolute; | ||
top: 100%; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
background-color: white; | ||
color: #404040; | ||
box-shadow: 0 4px 14px 0 rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.05); | ||
padding: 10px; | ||
font: 14px/1.5 Lato, proxima-nova, Helvetica Neue, Arial, sans-serif; | ||
text-decoration: none; | ||
opacity: 0; | ||
visibility: hidden; | ||
transition: opacity 0.1s, visibility 0s; | ||
z-index: 1000; | ||
pointer-events: none; /* Prevent accidental interaction */ | ||
} | ||
|
||
[data-tooltip]:hover .tooltip-content { | ||
opacity: 1; | ||
visibility: visible; | ||
pointer-events: auto; /* Allow interaction when visible */ | ||
} | ||
|
||
.tooltip-content .tooltip-glossary-link { | ||
display: inline-block; | ||
margin-top: 8px; | ||
font-size: 12px; | ||
color: #007bff; | ||
text-decoration: none; | ||
} | ||
|
||
.tooltip-content .tooltip-glossary-link:hover { | ||
color: #0056b3; | ||
text-decoration: underline; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import re | ||
import tomllib | ||
|
||
def load_glossary(file_path="docs/glossary.toml"): | ||
with open(file_path, "rb") as f: | ||
glossary_data = tomllib.load(f) | ||
return glossary_data.get("glossary", {}) | ||
|
||
def generate_anchor_id(name): | ||
return name.replace(" ", "-").replace("_", "-").lower() | ||
|
||
def format_markdown_term(name, definition): | ||
anchor_id = generate_anchor_id(name) | ||
markdown = f"* [**{name.replace('_', ' ').title()}**](#{anchor_id})" | ||
if definition.get("abbreviation"): | ||
markdown += f" *({definition['abbreviation']})*" | ||
if definition.get("description"): | ||
markdown += f": {definition['description']}\n" | ||
return markdown | ||
|
||
def glossary_markdown(vocabulary): | ||
markdown = "" | ||
for category, terms in vocabulary.items(): | ||
markdown += f"## {category.replace('_', ' ').title()}\n\n" | ||
for name, definition in terms.items(): | ||
markdown += format_markdown_term(name, definition) | ||
return markdown | ||
|
||
def format_tooltip_html(term_key, definition, html): | ||
display_term = term_key.replace("_", " ").title() | ||
clean_description = re.sub(r"\[(.+)]\(.+\)", r"\1", definition["description"]) | ||
glossary_link = ( | ||
f"<a href='/concepts/glossary#{term_key}' class='tooltip-glossary-link' title='View in glossary'>Glossary🔗</a>" | ||
) | ||
return re.sub( | ||
re.escape(display_term), | ||
lambda | ||
match: f"<span data-tooltip>{match.group(0)}<span class='tooltip-content'>{clean_description} {glossary_link}</span></span>", | ||
html, | ||
flags=re.IGNORECASE, | ||
) | ||
|
||
def apply_tooltip(_term_key, _definition, pattern, html): | ||
return re.sub( | ||
pattern, | ||
lambda match: format_tooltip_html(_term_key, _definition, match.group(0)), | ||
html, | ||
flags=re.IGNORECASE, | ||
) | ||
|
||
def tooltip_html(vocabulary, html): | ||
for _category, terms in vocabulary.items(): | ||
for term_key, definition in terms.items(): | ||
if definition.get("description"): | ||
pattern = rf"(?<!\w){re.escape(term_key.replace('_', ' ').title())}(?![^<]*<\/a>)(?!\([^)]*\))" | ||
html = apply_tooltip(term_key, definition, pattern, html) | ||
return html | ||
|
||
# Page Hooks | ||
def on_page_markdown(markdown, **kwargs): | ||
glossary = load_glossary() | ||
return markdown.replace("{{GLOSSARY_DEFINITIONS}}", glossary_markdown(glossary)) | ||
|
||
def on_page_content(html, **kwargs): | ||
if kwargs.get("page").title == "Glossary": | ||
return html | ||
glossary = load_glossary() | ||
return tooltip_html(glossary, html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule opendbc_repo
updated
18 files
+3 −34 | .github/workflows/tests.yml | |
+5 −1 | README.md | |
+10 −9 | docs/CARS.md | |
+2 −2 | opendbc/car/docs.py | |
+21 −15 | opendbc/car/gm/carstate.py | |
+3 −0 | opendbc/car/gm/fingerprints.py | |
+11 −1 | opendbc/car/gm/interface.py | |
+8 −1 | opendbc/car/gm/values.py | |
+3 −3 | opendbc/car/hyundai/carcontroller.py | |
+5 −3 | opendbc/car/hyundai/carstate.py | |
+11 −8 | opendbc/car/hyundai/hyundaican.py | |
+3 −3 | opendbc/car/hyundai/interface.py | |
+1 −0 | opendbc/car/tests/routes.py | |
+1 −0 | opendbc/car/torque_data/override.toml | |
+0 −22 | opendbc/dbc/generator/test_generator.py | |
+2 −2 | opendbc/dbc/hyundai_kia_generic.dbc | |
+2 −1 | pyproject.toml | |
+17 −2 | test.sh |
Submodule panda
updated
16 files
+3 −3 | Dockerfile | |
+2 −2 | README.md | |
+3 −11 | board/boards/cuatro.h | |
+1 −1 | board/config.h | |
+0 −26 | board/drivers/beeper.h | |
+2 −2 | board/jungle/README.md | |
+1 −1 | board/main.c | |
+11 −2 | board/safety/safety_hyundai.h | |
+1 −1 | board/safety/safety_subaru_preglobal.h | |
+0 −1 | board/stm32h7/board.h | |
+0 −1 | board/stm32h7/peripherals.h | |
+17 −12 | board/stm32h7/sound.h | |
+2 −2 | drivers/linux/README.md | |
+1 −1 | drivers/linux/panda.c | |
+4 −4 | python/__init__.py | |
+1 −1 | tests/misra/test_misra.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.