Commit 97ebe59b authored by twanvl's avatar twanvl

the way expand_keyword works has changed, templates updated.

parameter un-bolding now works for vs templates
parent b8c210bd
...@@ -388,8 +388,8 @@ text_filter := ...@@ -388,8 +388,8 @@ text_filter :=
keyword := "<nospellcheck>{keyword}</nospellcheck>" keyword := "<nospellcheck>{keyword}</nospellcheck>"
reminder := process_english_hints(reminder) reminder := process_english_hints(reminder)
if mode == "pseudo" then "<i-auto>{keyword}</i-auto>" if mode == "pseudo" then "<i-auto>{keyword}</i-auto>"
else "{keyword}<atom-reminder-{mode}> ({reminder})</atom-reminder-{mode}>" } else keyword + if expand then "<atom-reminder-{mode}> ({reminder})</atom-reminder-{mode}>"
) + }) +
# step 2b : move action keywords' reminder text to the end of the line # step 2b : move action keywords' reminder text to the end of the line
replace@( replace@(
match: "(<atom-reminder-action>(?:(?!<kw-).)*</atom-reminder-action></kw[^>]*>)(((?!<atom-reminder| ?<kw-)[^\n(])+)", match: "(<atom-reminder-action>(?:(?!<kw-).)*</atom-reminder-action></kw[^>]*>)(((?!<atom-reminder| ?<kw-)[^\n(])+)",
......
...@@ -126,9 +126,11 @@ init script: ...@@ -126,9 +126,11 @@ init script:
default_expand: { default_expand: {
chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text) chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text)
}, },
combine: { combine: {
keyword := "<nospellcheck>{keyword}</nospellcheck>"
reminder := process_english_hints(reminder)
if mode == "pseudo" then "<i-auto>{keyword}</i-auto>" if mode == "pseudo" then "<i-auto>{keyword}</i-auto>"
else "{keyword}<atom-reminder-{mode}> ({process_english_hints(reminder)})</atom-reminder-{mode}>" } else keyword + if expand then "<atom-reminder-{mode}> ({reminder})</atom-reminder-{mode}>" }
) + ) +
# step 2b : move inline keywords' reminder text to the end of the line # step 2b : move inline keywords' reminder text to the end of the line
replace@( replace@(
......
...@@ -51,8 +51,15 @@ init script: ...@@ -51,8 +51,15 @@ init script:
default_expand: { default_expand: {
chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text) chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text)
}, },
combine: { "<b-auto>{keyword}</b-auto><atom-reminder-{mode}> ({process_english_hints(reminder)})</atom-reminder-{mode}>" } combine: {
) + # un-bold parameters
keyword := tag_contents(keyword, tag:"<param",
contents: {"</b-auto>{input}<b-auto>"})
reminder := process_english_hints(reminder)
# the combined result
"<b-auto>{keyword}</b-auto>"
+ if expand then "<atom-reminder-{mode}> ({reminder})</atom-reminder-{mode}>"
}) +
# step 3 : Expand shortcut words ~ and CARDNAME # step 3 : Expand shortcut words ~ and CARDNAME
replace_rule( replace_rule(
match: "~|~THIS~|CARDNAME", match: "~|~THIS~|CARDNAME",
......
...@@ -42,8 +42,15 @@ init script: ...@@ -42,8 +42,15 @@ init script:
default_expand: { default_expand: {
chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text) chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text)
}, },
combine: { "<b-auto>{keyword}</b-auto><atom-reminder-{mode}> ({process_english_hints(reminder)})</atom-reminder-{mode}>" } combine: {
) + # un-bold parameters
keyword := tag_contents(keyword, tag:"<param",
contents: {"</b-auto>{input}<b-auto>"})
reminder := process_english_hints(reminder)
# the combined result
"<b-auto>{keyword}</b-auto>"
+ if expand then "<atom-reminder-{mode}> ({reminder})</atom-reminder-{mode}>"
}) +
# step 3 : Expand shortcut words ~ and CARDNAME # step 3 : Expand shortcut words ~ and CARDNAME
replace_rule( replace_rule(
match: "~|~THIS~|CARDNAME", match: "~|~THIS~|CARDNAME",
......
...@@ -45,13 +45,15 @@ ...@@ -45,13 +45,15 @@
default_expand: { default_expand: {
chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text) chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text)
}, },
combine: { combine: {
# un-bold parameters # un-bold parameters
keyword := tag_contents@(keyword, tag:"<param", keyword := tag_contents(keyword, tag:"<param",
contents: {"</b-auto>{input}<b-auto>"}) contents: {"</b-auto>{input}<b-auto>"})
reminder := process_english_hints(reminder)
# the combined result # the combined result
"<b-auto>{keyword}</b-auto><atom-reminder-{mode}> ({process_english_hints(reminder)})</atom-reminder-{mode}>" } "<b-auto>{keyword}</b-auto>"
) + + if expand then "<atom-reminder-{mode}> ({reminder})</atom-reminder-{mode}>"
}) +
# step 3 : Expand shortcut words ~ and CARDNAME # step 3 : Expand shortcut words ~ and CARDNAME
replace_rule( replace_rule(
match: "~|~THIS~|CARDNAME", match: "~|~THIS~|CARDNAME",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment