docs: migrate line highlighting to highlight-line, highlight-start, highlight-end #10134
Labels
good first issue
Issue that doesn't require previous experience with Gatsby
type: documentation
An issue or pull request for improving or updating Gatsby's documentation
Summary
Our docs currently use a line highlighting mechanism that is not necessarily ideal. See #9235 for further detail of the general issue. We've since fixed this in #9696, which enables improved functionality that is more maintainable.
Basic example
Given the following (existing) highlighted code snippet, we can re-factor with the changes in this new release.
Note: the following snippet indicates that line 6 is being highlighted, e.g. the
plugins
arrayto the following new variant
Motivation
This will be much more maintainable (e.g. resistant to things like prettier messing up line order, code changes, etc.) and a lot easier to use.
Consider using any of the following directives to accomplish this task:
highlight-line
- highlights the current linehighlight-next-line
- highlights the next linehighlight-start
&highlight-end
- highlight all lines untilhighlight-end
is encounteredAdditionally things like
highlight-range
are still supported, but I'd recommend using the previously mentioned directives to accomplish this task, as highlight-range does suffer from several of the same issues as the existing functionality.The text was updated successfully, but these errors were encountered: