-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(developer): convert markdown description to html 🎺 #9476
feat(developer): convert markdown description to html 🎺 #9476
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
d17ea3b
to
0e382ba
Compare
…to feat/developer/keyboard-info-markdown
@@ -28,7 +28,7 @@ | |||
"@keymanapp/kmc-package": "*" | |||
}, | |||
"devDependencies": { | |||
"@types/chai": "^4.1.7", | |||
"@types/chai": "^4.3.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just stops typescript complaint in vscode
@@ -152,7 +152,7 @@ export class KeyboardInfoCompiler { | |||
// description | |||
|
|||
if(sources.kmpJsonData.info.description?.description) { | |||
keyboard_info.description = markDownToHTML(sources.kmpJsonData.info.description?.description); | |||
keyboard_info.description = sources.kmpJsonData.info.description?.description.trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
markdown conversion moved to kmc-package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it a bit interesting that we're using marked
instead of pandoc
, given that we already use it for some of the other platforms. Granted, that would be during their builds and not distributed.
I'm guessing marked
is a bit simpler to include and package for distribution, in which case... yeah, makes sense. (And it almost-surely is - pandoc aims to cover tons of different formats - not just Markdown.)
Also a mite surprised that we aren't linking any CSS to it. Granted, that impression comes from my experiences maintaining the pandoc
-based help rendering from the mobile apps. It's not like we can't address it down the line if necessary, so I'm not going to hold this up on account of no styling.
Yes, pandoc is a binary tool, not written in Javascript, so not as portable or easy to distribute, also it's HUGE and we really don't need 99% of what it does. pandoc is not a great match for this.
CSS does not belong in the description blobs. The description blobs are essentially content, so they should be nice tidy HTML, and styling can be left to the app or website that consumes the description and displays it. Markdown is primarily intended for supporting links, structure, and minor emphasis, noting that we block embedded HTML in the description for similar reasons. (The CSS requirements for a future welcome.md may be different.) |
Relates to #9351.
Next part of kmc work, converts the Markdown description field in the .kps into HTML during the .kmp build. This also filters through to the .keyboard_info file.
@keymanapp-test-bot skip