-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
toolingCI, mdBook and other infrastructureCI, mdBook and other infrastructure
Description
Problem
Neither Markdown dialect seems to support fenced code blocks in tables.
Something like this (here HTML):
| GDScript | Rust |
|---|---|
class_name MyClass
extends Node
|
#[derive(GodotClass)] #[class(base=Node)] struct MyClass; |
In mdbook, it's possible to use raw HTML, but it's also very unreadable.
This is the source for the above. Yes, the line breaks need to be like that to avoid trailing/leading empty lines.
<table>
<thead>
<tr>
<th>GDScript</th>
<th>Rust</th>
</tr>
</thead>
<tr>
<td>
<pre>
class_name MyClass
extends Node
</pre>
</td>
<td>
<pre>#[derive(GodotClass)]
#[class(base=Node)]
struct MyClass;
</pre>
</td>
</tr>
</table>Possible solutions
With mdbook, the tag <code class="language-rust"> can be used for syntax highlighting instead of <pre>.
We should research if there is an mdbook plugin achieving something similar, or write our own.
If we do it ourselves, it doesn't necessarily need to be generic and reusable. We could just start to support the above case and take it from there. Even something simple such as
```codetable left="gdscript" right="rust" class_name MyClass extends Node --- #[derive(GodotClass)] #[class(base=Node)] struct MyClass; ```
could be transformed into the verbose HTML above.
Metadata
Metadata
Assignees
Labels
toolingCI, mdBook and other infrastructureCI, mdBook and other infrastructure