1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

Add a [kbd] tag for highlighting keyboard shortcuts in the editor help

This allows backporting documentation from the `master` branch more easily,
as it already features the `[kbd]` tag.

Co-authored-by: Yuri Sizov <11782833+YuriSizov@users.noreply.github.com>
This commit is contained in:
Hugo Locurcio
2022-08-25 19:51:43 +02:00
parent 03940b77a2
commit ed380cc0fa
13 changed files with 59 additions and 37 deletions

View File

@@ -1008,6 +1008,12 @@ def rstize_text(text, state): # type: (str, State) -> str
tag_depth += 1
inside_code = True
escape_pre = True
elif cmd == "kbd":
tag_text = ":kbd:`"
tag_depth += 1
elif cmd == "/kbd":
tag_text = "`"
tag_depth -= 1
elif cmd.startswith("enum "):
tag_text = make_enum(cmd[5:], state)
escape_pre = True