From 50ef795d227ad6b1f4a4ff180a797e7186dd012d Mon Sep 17 00:00:00 2001 From: Lachlan Heywood Date: Mon, 29 Jul 2024 10:48:09 -0400 Subject: [PATCH] fix(markdown): use id attribute instead of obsolete name attribute (#1009) Signed-off-by: Lachlan Heywood --- crates/markdown/src/lib.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/markdown/src/lib.rs b/crates/markdown/src/lib.rs index 82d6922a2..ae6380003 100644 --- a/crates/markdown/src/lib.rs +++ b/crates/markdown/src/lib.rs @@ -43,7 +43,7 @@ impl WorldGenerator for Markdown { let world = &resolve.worlds[world]; uwriteln!( self.src, - "# World {}\n", + "# World {}\n", world.name.to_snake_case(), world.name ); @@ -121,7 +121,7 @@ impl WorldGenerator for Markdown { let name = resolve.name_world_key(name); uwriteln!( self.src, - "## Import interface {name}\n", + "## Import interface {name}\n", name.to_snake_case() ); self.hrefs @@ -160,7 +160,7 @@ impl WorldGenerator for Markdown { let name = resolve.name_world_key(name); uwriteln!( self.src, - "## Export interface {name}\n", + "## Export interface {name}\n", name.to_snake_case() ); self.hrefs @@ -265,7 +265,7 @@ impl InterfaceGenerator<'_> { fn func(&mut self, func: &Function) { self.push_str(&format!( - "#### `", + "#### `", func.name.to_snake_case() )); self.gen @@ -281,7 +281,7 @@ impl InterfaceGenerator<'_> { self.push_str("##### Params\n\n"); for (name, ty) in func.params.iter() { self.push_str(&format!( - "- `{}`: ", + "- `{}`: ", name, f = func.name.to_snake_case(), p = name.to_snake_case(), @@ -297,7 +297,7 @@ impl InterfaceGenerator<'_> { Results::Named(params) => { for (name, ty) in params.iter() { self.push_str(&format!( - "- `{}`: ", + "- `{}`: ", name, f = func.name.to_snake_case(), p = name, @@ -308,7 +308,7 @@ impl InterfaceGenerator<'_> { } Results::Anon(ty) => { self.push_str(&format!( - "- ", + "- ", f = func.name.to_snake_case(), )); self.print_ty(ty); @@ -469,7 +469,7 @@ impl InterfaceGenerator<'_> { self.types_header_printed = true; } self.push_str(&format!( - "#### `{} {}`\n", + "#### `{} {}`\n", name.to_snake_case(), type_, name, @@ -492,7 +492,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> { self.push_str("\n##### Record Fields\n\n"); for field in record.fields.iter() { self.push_str(&format!( - "- `{name}`: ", + "- `{name}`: ", r = name.to_snake_case(), f = field.name.to_snake_case(), name = field.name, @@ -525,7 +525,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> { self.push_str("\n##### Tuple Fields\n\n"); for (i, ty) in tuple.types.iter().enumerate() { self.push_str(&format!( - "- `{name}`: ", + "- `{name}`: ", r = name.to_snake_case(), f = i, name = i, @@ -546,7 +546,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> { self.push_str("\n##### Flags members\n\n"); for flag in flags.flags.iter() { self.push_str(&format!( - "- `{name}`: ", + "- `{name}`: ", r = name.to_snake_case(), f = flag.name.to_snake_case(), name = flag.name, @@ -572,7 +572,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> { self.push_str("\n##### Variant Cases\n\n"); for case in variant.cases.iter() { self.push_str(&format!( - "- `{name}`", + "- `{name}`", v = name.to_snake_case(), c = case.name.to_snake_case(), name = case.name, @@ -602,7 +602,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> { self.push_str("\n##### Enum Cases\n\n"); for case in enum_.cases.iter() { self.push_str(&format!( - "- `{name}`", + "- `{name}`", v = name.to_snake_case(), c = case.name.to_snake_case(), name = case.name,