wpilibsuite/wpilib-docs

Convert inline code blocks to allwpilib snippets with RLIs

开放

#3,018 创建于 2025年4月23日

 (2 条评论) (0 个反应) (0 位负责人)JavaScript (297 个派生)auto 404
Good First Issue

仓库指标

星标
 (187 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

frc-docs has ~700 java or c++ code blocks that are inline in the article. This causes maintenance issues as those code blocks aren't compiled against the latest wpilib, so breaking changes in wpilib can slip through and not be reflected in the docs. With the 2027 wpilib introducing more breaking changes to work with the new robot controller, this will be an even bigger issue.

frc-docs already has a number of articles that use RLI's from allwpilib examples. However many of the simple code blocks in frc-docs don't lend themselves to be good examples, and in the past we polluted the VS Code example list with too many examples.

wpilibsuite/allwpilib#7909 introduces the infrastructure for "snippets" that get compiled in every wpilib build like the examples, but separately so they don't pollute the VS Code example list. #3017 then updates the Encoder frc-docs article to use the Encoder snippets. All the inline code blocks should be PRed to snippets in allwpilib and then PRed to frc-docs to replace the code blocks with RLIs to the snippets.

贡献者指南