-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Replace {{anch}} macro with Markdown links #13802
Conversation
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.
Very nice work! Thanks @queengooborg !
Lots of comments but really only a few categories:
-
usages that need to be HTML links, either because the whole page is HTML (devtools) or because the containing element is an HTML table (including the HTML
<input>
elements, but some other cases too). Ideally we could convert these usages into HTML links. -
usages that are broken, but the original was broken too because
anch
didn't properly slugify links (e.g. not replacing things like "/" or "()"). It would be good to fix these while we are here. -
usages that are broken, but the original was broken too because of some weird line formatting thing.
-
usages like
`{{anch(...)}}`
, where we we end up with a Markdown link inside a Markdown code element, which doesn't work. Lots of these in<input>
elements, and a few in other places.
Ideally I would love it if these updates could only change the files that need to be updated, rather than update the script and redo them all. That way I don't have to re-review all the changes again.
@@ -70,5 +70,5 @@ If you would like your work assessed, or are stuck and want to ask for help: | |||
|
|||
- A descriptive title such as "Assessment wanted for Float skill test". | |||
- Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. | |||
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in {{anch("Learn Sidebar", "step 1")}} above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code. | |||
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in [step 1](#learn_sidebar) above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code. |
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.
Doesn't work but didn't before either.
files/en-us/mdn/structures/macros/commonly-used_macros/index.md
Outdated
Show resolved
Hide resolved
Thank you both for reviewing! I've updated the script and re-ran it, pushing updates in a way that won't clear the review status on all the unaffected files. I'm avoiding any manual fixes for the time being, such as already-bad anchors, to keep the changeset as small as possible. |
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.
Thanks the the updates! Mostly good now.
- I think we should just leave the meta-doc at https://pr13802.content.dev.mdn.mozit.cloud/en-US/docs/MDN/Structures/Macros/Commonly-used_macros#links_to_in-page_sections untouched and deal with it in Remove meta-docs for {{anch}} macro #13814, don't you?
- it looks like the script that fixes old broken anchors has a bug: I made some suggested fixes.
files/en-us/mdn/structures/macros/commonly-used_macros/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/file/using_files_from_web_applications/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/webrtc_api/signaling_and_video_calling/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: wbamberg <will@bootbonnet.ca>
Again, looks okay for the web extension content. |
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 one more left that I can see.
Co-authored-by: wbamberg <will@bootbonnet.ca>
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.
lgtm, great work @queengooborg !
This PR is a continuation off of #13347. This PR replaces all of the calls to the
{{arch}}
macro with Markdown links, using a simple find-and-replace script. This will allow us to remove the macro from MDN entirely. The script takes into account the second variable passed in as display text as well.Script used:
Notice: this is definitely a big PR, and I'm happy to split into smaller chunks if desired.