Skip to content
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

Merged

Conversation

mcdurdin
Copy link
Member

@mcdurdin mcdurdin commented Aug 17, 2023

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

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Aug 17, 2023

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@mcdurdin mcdurdin force-pushed the feat/developer/keyboard-info-markdown branch from d17ea3b to 0e382ba Compare August 17, 2023 03:26
@@ -28,7 +28,7 @@
"@keymanapp/kmc-package": "*"
},
"devDependencies": {
"@types/chai": "^4.1.7",
"@types/chai": "^4.3.5",
Copy link
Member Author

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();
Copy link
Member Author

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

Copy link
Contributor

@jahorton jahorton left a 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.

@mcdurdin
Copy link
Member Author

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.)

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.

Also a mite surprised that we aren't linking any CSS to it.

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.)

Base automatically changed from feat/developer/compile-without-source-keyboard-info to epic/package-metadata September 1, 2023 03:05
@mcdurdin mcdurdin merged commit 651af2f into epic/package-metadata Sep 1, 2023
2 checks passed
@mcdurdin mcdurdin deleted the feat/developer/keyboard-info-markdown branch September 1, 2023 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants