From 9e2099114f2321a5cfd5ee2f53a8dd8e7ce4b6f2 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 12 Sep 2023 18:52:53 -0700 Subject: [PATCH] Add support for printing resource types in the markdown backend. (#666) 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) {