Closed LaurenIke closed 1 year ago
I'm not sure if we can change our syntax highlighter but if we use https://github.com/wooorm/starry-night cadence will be supported (https://github.com/wooorm/starry-night/blob/main/lang/source.cadence.js)
We just need to port the highlighter over to the new one. It uses the same grammar as Starry Night, the TextMate grammar from the VS Code plugin.
@schpet Do you know if there is a way to hook in a markdown AST plugin into the new developer portal?
The old documentation site had support for highlighting Cadence code, both for Markdown code blocks and inline-code.
The new developer portal does not properly highlight code blocks, and does not highlight inline-code anymore.
For example, consider https://developers.flow.com/cadence/language/accounts#path-functions:
fun
keyword is not highlightedcadence•fun save<T>(_ value: T, to: StoragePath)
, should be highlighted as Cadence, but is not. In addition the prefix indicating the programming language is rendered to the user/reader, which is confusing themThe old documentation page had support for both using this plugin, developed by @turbolent: https://github.com/onflow/flow/tree/v0.3.2/docs/plugins/gatsby-remark-vscode-flow
Previously, a PR proposed removing the inline-code prefixes, https://github.com/onflow/cadence/pull/1896, but this would be a worse experience then we had previously.