From a532a756d5050210cb3d30cf1b3aeb929d88ad65 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 12 Sep 2023 16:17:27 -0700 Subject: [PATCH] Add support for printing resource types in the markdown backend. This just adds simple markdown support for resources which just prints their name and documentation. --- crates/markdown/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/markdown/src/lib.rs b/crates/markdown/src/lib.rs index d349c1d04..a1d23d627 100644 --- a/crates/markdown/src/lib.rs +++ b/crates/markdown/src/lib.rs @@ -508,9 +508,10 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> { } } - fn type_resource(&mut self, id: TypeId, name: &str, docs: &Docs) { - _ = (id, name, docs); - todo!() + fn type_resource(&mut self, _id: TypeId, name: &str, docs: &Docs) { + self.print_type_header("resource", name); + self.push_str("\n"); + self.docs(docs); } fn type_tuple(&mut self, _id: TypeId, name: &str, tuple: &Tuple, docs: &Docs) {