Skip to content

Commit 3719e6a

Browse files
madsmtmpyfisch
authored andcommitted
Add clarifying comment to Code::Backquote and Code::Quote
To note aliases / alternative names for these.
1 parent c322f34 commit 3719e6a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

convert.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ def print_from_str_entries(display, file):
7171
print(" => Ok({0}),".format(key), file=file)
7272

7373

74+
def add_comment_to(display, key, comment):
75+
for (i, [found_key, doc_comment, alternatives]) in enumerate(display):
76+
if found_key != key:
77+
continue
78+
doc_comment = doc_comment + "\n" + comment
79+
display[i] = [found_key, doc_comment, alternatives]
80+
81+
7482
def add_alternative_for(display, key, alternative):
7583
for [found_key, doc_comment, alternatives] in display:
7684
if found_key != key:
@@ -237,6 +245,9 @@ def convert_code(text, file):
237245
[]
238246
])
239247

248+
add_comment_to(display, 'Backquote', 'This is also called a backtick or grave.')
249+
add_comment_to(display, 'Quote', 'This is also called an apostrophe.')
250+
240251
add_alternative_for(display, 'MetaLeft', 'OSLeft')
241252
add_alternative_for(display, 'MetaRight', 'OSRight')
242253
add_alternative_for(display, 'AudioVolumeDown', 'VolumeDown')

src/code.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::error::Error;
2020
#[non_exhaustive]
2121
pub enum Code {
2222
/// <kbd>`~</kbd> on a US keyboard. This is the <kbd>半角/全角/漢字</kbd> (<span class="unicode">hankaku/zenkaku/kanji</span>) key on Japanese keyboards
23+
/// This is also called a backtick or grave.
2324
Backquote,
2425
/// Used for both the US <kbd>\|</kbd> (on the 101-key layout) and also for the key
2526
/// located between the <kbd>"</kbd> and <kbd>Enter</kbd> keys on row C of the 102-,
@@ -127,6 +128,7 @@ pub enum Code {
127128
/// <kbd>.&gt;</kbd> on a US keyboard.
128129
Period,
129130
/// <kbd>'"</kbd> on a US keyboard.
131+
/// This is also called an apostrophe.
130132
Quote,
131133
/// <kbd>;:</kbd> on a US keyboard.
132134
Semicolon,

0 commit comments

Comments
 (0)