docs
docs copied to clipboard
Enhancement Proposal: Improve Code Block Language Specifiers Across Documentation
Background & Validation:
Several documentation files in the repository—including blog articles, concept guides, and code samples—contain fenced code blocks that do not specify their language, or use inconsistent language tags (such as missing specifiers for go, bash, yaml, etc.). This issue appears commonly in:
docs/blog/articles/getting-started-blog-p1.mddocs/blog/articles/getting-started-blog-p2.md- Files under
code-samples/ - Other markdown files throughout the
docs/directory.
The Knative docs contributor's guide recommends correct language specifiers for code blocks, but enforcement is inconsistent.
Proposed Enhancement
- Audit all documentation sources (
docs/,code-samples/, and relevant blog articles). - Update each markdown code block to specify the appropriate language (use “go”, “bash”, “yaml”, etc.).
- Use consistent names (e.g., always “bash” for shell scripts, “go” for Go code, “yaml” for manifests).
- Reference: MkDocs Material supported languages.
Benefits
- Enables syntax highlighting and improves readability for contributors and users.
- Supports better onboarding—new contributors can more easily read and copy-paste sample code.
- Aligns with markdown documentation best practices and the Knative docs style guide.
References
docs/code-samples/- Contributor's Guide
- Dart Doc Code Block Language Lint (Best Practice Reference)