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

Update Markdown in MDN docs to use GFM syntax #33384

Merged
merged 5 commits into from
Jul 23, 2024
Merged

Conversation

queengooborg
Copy link
Collaborator

@queengooborg queengooborg commented May 3, 2024

Description

This PR updates the section about notes, warnings and callouts in the Markdown in MDN page to reflect the new GFM syntax.

Motivation

mdn/yari#10168 was just merged!


Depends on mdn/yari#11108.

@queengooborg queengooborg requested a review from a team as a code owner May 3, 2024 00:21
@queengooborg queengooborg requested review from bsmth and removed request for a team May 3, 2024 00:21
@github-actions github-actions bot added Content:Meta Content in the meta docs size/m [PR only] 51-500 LoC changed labels May 3, 2024
Comment on lines 252 to 253
> [!CALLOUT]
> **This is how you write a callout.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mdn-linter] reported by reviewdog 🐶

Suggested change
> [!CALLOUT]
> **This is how you write a callout.**
> [!CALLOUT] > **This is how you write a callout.**

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh, that's not proper!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A markdownlint rule kicking in here, I guess.

Copy link
Member

@bsmth bsmth May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to change this in mdlint config:

"no-blanks-blockquote": true,

edit: https://github.com/DavidAnson/markdownlint/blob/main/doc/md028.md

Copy link
Member

@bsmth bsmth May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although disabling this rule and running yarn run lint:md you get:

Linting: 12280 file(s)
Summary: 244 error(s)

Which is what the mdlint config comment says (consecutive admonitions) so this breaks:

> [!Note]
> The above behavior of block layout changes if ...

> [!Note]
> HTML (_HyperText Markup Language_) elements ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe I'm wrong, is it just happening with Callouts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that prettier caused this problem, see playground, issue: prettier/prettier#9099


A workaround to resolve this:

> [!CALLOUT]
>
> **This is how you write a callout.**

maybe we need to resolve the wrong parser logic of yari (as this could not be rendered correctly by yari)?

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just submitted mdn/yari#11108 to fix the rendering!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted 👍🏻

Copy link
Contributor

github-actions bot commented May 3, 2024

Preview URLs

External URLs (1)

URL: /en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN
Title: How to write in Markdown

(comment last updated: 2024-07-23 12:30:47)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@bsmth
Copy link
Member

bsmth commented Jun 10, 2024

Removing myself from review for the moment. Please re-add me when it's ready for a look 🙌🏻

@Josh-Cena
Copy link
Member

This is now unblocked :)

@queengooborg queengooborg marked this pull request as ready for review July 23, 2024 11:49
@queengooborg queengooborg requested a review from bsmth July 23, 2024 11:54
@@ -257,38 +267,19 @@ This will produce the following HTML:

This HTML will be rendered as a highlighted box:

> **Callout:**
> [!CALLOUT]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks fine, but this still looks broken on the preview, are we waiting for a Yari version to land in the content repo for this or what's the plan? Otherwise looking good!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preview looks broken because it's running a version of Yari prior to the bug fix, which isn't yet released. We can probably merge this now and then it'll automatically be fixed once Yari's been updated, but WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just on this page, right? If it's only one occurrence, which it looks like, it's probably fine to land this. Other instances (137 cases) use the older syntax:

grep -r "\*\*Callout:\*\*" ./files | wc -l
     137

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far, it's just this one, yeah!

Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Going to leave a +1 so we can merge when you're ready. The template page may look odd until the latest Yari gets pulled in, but we can keep an eye on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Meta Content in the meta docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants