-
Couldn't load subscription status.
- Fork 13.9k
Description
EDIT (2025-05-26): This is currently stuck as the original way it was done was making the code more complex (zulip). Before this can continue, it needs design work to make sure that having the templates in Askama is nicer than the current format! approach.
Tracking Issue for Rustdoc Askama Migration
This issue is to track the progress of migrating rustdoc's HTML rendering to Askama.
Suggested Workflow
If you'd like to work on a component, please leave a comment claiming it so that work doesn't conflict.
Work on translating the current series of format!() and string building calls into an HTML template. Where possible, try to keep as much logic as possible on the Rust side. Make sure to refer to STYLE.md for templating style, especially using comment blocks to minimize whitespace.
A specific example of a migration (and some style considerations) is here.
Components to Migrate
- Sidebar (rustdoc: Migrate sidebar rendering to Askama #108784)
- Content
- Stability/Portability/Deprecation (rustdoc: Migrate
document_item_infoto Askama #108757) - Item (
print_item.rs)- Item Header
- Doc Block
- Modules
- Functions
- Traits
- Structs
- Unions (rustdoc: migrate item_union to an Askama template #109925)
- Enums
- Typedefs
- Macros
- ProcMacros (Migrate
item_proc_macroto Askama #112031) - Primitives (Migrate
item_primitiveto Askama #112032) - Statics (bump minimum OS X version to 10.7 #11927)
- Constants
- Foreign Types (Migrate
item_foreign_typeto Askama #112005) Keywords- Opaque Types (Migrate
item_opaque_tyto Askama #112034) - Trait Aliases (Migrate
item_trait_aliasto Askama #112030)
- Scraped examples
- Stability/Portability/Deprecation (rustdoc: Migrate
- Source View
- Line Numbers (Render source page layout with Askama #109187)
- Code Highlighting
Implementation History
- Use Tera templates for rustdoc. #86157
- Move top part of print_item to Tera templates #89695
- Migrate rustdoc from Tera to Askama #92526
@rustbot label +T-rustdoc +A-rustdoc-ui