Repository navigation
Low-Level Base Controller: include blocks as firmware excerpts - #70
Merged
Merged
Conversation
The block was indented after a paragraph, so Markdown showed it as plain indented code, with its ```cpp fences as text. It's a normal code block now.
|
The page's two include blocks and its lib_deps block were copied by hand from the firmware. They are now excerpts of main.cpp (lines 1–3 and 4–5) and of platformio.ini's teensy40 environment (lines 27–34), with links to the same lines, from the page's firmware pin. The encoder excerpt gets such a link too. The info box moves to the start of the section, before the first excerpt, and says which blocks it means: the firmware excerpts, the code blocks with a file name and line numbers. The code blocks of the high-level section further down are still copied by hand. The generator now writes these excerpts as well. On a later run, it finds each excerpt by its introducing sentence and its title, not by its line range, so a repin that moves the ranges still works. Checked: mkdocs build --strict against GitHub, codespell, the generator giving the same page from this branch's previous state and on a second run, a repin test with every source file shifted by one line (all ranges and links move by one), no literal fences in the built page, and Chromium at 390 px light and 1440 px dark without page overflow or JavaScript errors.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The
#includeblock after "After including Remo-specific definitions" was indented by four spaces after a paragraph, so Markdown showed it as indented code, with its```cppfences as text. That block, the include block before it and thelib_depsblock fromplatformio.iniwere also copied by hand from the firmware.All three are now excerpts of the real files, from the page's firmware pin (
low_level_src_rawandlow_level_src_url, from #64), each with a link to the same lines on GitHub:main.cpp, lines 1–3: the ROS header and Remo's configurationmain.cpp, lines 4–5: the libraries fromlibplatformio.ini, lines 27–34: the libraries of Remo's Teensy 4.0 environmentThe encoder excerpt further down gets such a link too. The info box about the excerpts moves to the start of the section, before the first excerpt, and says which blocks it means: the firmware excerpts, the code blocks with a file name and line numbers. The code blocks of the high-level section further down are still copied by hand. They are part of the docs clean-up. The page's generator from #64 now writes these excerpts too. On a later run, it finds each excerpt by its introducing sentence and title, not by its line range, so a repin still works.
Preview
How it was checked
mkdocs build --strictagainst GitHub and codespell pass, and the built page contains no literal fences.