Replace rigid wiki message template with markdown content arrays#69
Replace rigid wiki message template with markdown content arrays#69
Conversation
Co-authored-by: DocMoebiuz <86157512+DocMoebiuz@users.noreply.github.com>
…e markdown stripping Co-authored-by: DocMoebiuz <86157512+DocMoebiuz@users.noreply.github.com>
wikiMenuItems.json
Outdated
| "href": "https://github.com/MobiFlight/MobiFlight-Connector/wiki/Using-the-selector-knob-on-a-Honeycomb-Bravo", | ||
| "preamble": "Check out this wiki page for information on using the selector knob with the Honeycomb Bravo:" | ||
| "content": [ | ||
| "☝️ **Check out this wiki page** for information on using the selector knob with the Honeycomb Bravo:", |
There was a problem hiding this comment.
☝️ Check out this wiki page
Replace all occurences with a 👉 emoji
There was a problem hiding this comment.
Done in commit c656bb4. Replaced all ☝️ emojis with 👉 (:point_right:) emoji across all wiki items.
…tibility Co-authored-by: DocMoebiuz <86157512+DocMoebiuz@users.noreply.github.com>
src/commands/general/wiki.js
Outdated
| if (item.description) { | ||
| option.setDescription(item.description); | ||
| } | ||
| else if (item.content && item.content.length > 0) { |
There was a problem hiding this comment.
Extract code to function createDescription
There was a problem hiding this comment.
Done in commit fe1b647. Extracted the description generation logic to a createDescription helper function that strips markdown formatting from content lines.
src/commands/general/wiki.js
Outdated
| .setName('topic') | ||
| .setDescription('The name of the wiki topic to send') | ||
| .setRequired(false), |
There was a problem hiding this comment.
why are we changing all strings to single quote? I am not aware of any style guide about it.
There was a problem hiding this comment.
The eslint config (.eslint.json) specifies "quotes": ["error", "single"] which automatically converts double quotes to single quotes when running eslint --fix. However, I've now reverted to the original file and kept the double quotes to match the existing codebase style.
| "👉 **Check out this wiki page** for information on using the selector knob with the Honeycomb Bravo:", | ||
| "[Using the selector knob on a Honeycomb Bravo](https://github.com/MobiFlight/MobiFlight-Connector/wiki/Using-the-selector-knob-on-a-Honeycomb-Bravo)" | ||
| ] |
There was a problem hiding this comment.
for all the links here in this json, use angle brackets for preventing the embed, e.g.
There was a problem hiding this comment.
Done in commit fe1b647. Added angle brackets around all URLs in markdown links (e.g., [text](<URL>)) to prevent Discord from showing link embeds.
DocMoebiuz
left a comment
There was a problem hiding this comment.
Take a look at my comments.
Also revert the whitespace changes. In the existing code base one tab was 2 spaces. It seems you changed to 4 which creates a lot of tracked changes
…2-space indentation Co-authored-by: DocMoebiuz <86157512+DocMoebiuz@users.noreply.github.com>
Wiki messages used a rigid 5-field template (label, description, value, href, preamble) that forced all messages into a single-line "preamble + hyperlinked description" format. This prevented multi-line messages and flexible markdown formatting.
Changes
Data Format
descriptionfield for clean dropdown menu descriptionshrefandpreamblefields withcontent: string[]valuefield as unique identifier for Discord select menu matching<URL>to prevent Discord embedsCode Updates (
wiki.js)createDescriptionhelper function for reusable markdown stripping logicdescriptionfield directly for dropdown menu descriptionscontent[0]only if missing (with markdown/emoji stripping)content.join('\n')hyperlinkandhideLinkEmbedimportsData Migration
Converted all 8 wiki items to new format:
{ "label": "Honeycomb Bravo", "description": "Using the selector knob on a Honeycomb Bravo", "value": "honeycombbravo", "content": [ "👉 **Check out this wiki page** for information on using the selector knob with the Honeycomb Bravo:", "[Using the selector knob on a Honeycomb Bravo](<https://github.com/MobiFlight/MobiFlight-Connector/wiki/...>)" ] }Enables arbitrary markdown formatting (bold, italic, links, emojis, multi-line) while maintaining clean dropdown descriptions and preventing unwanted link previews in Discord.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.