chore: format curriculum#37912
Conversation
|
The curriculum linting is now done by remark lint, since it can fix minor mistakes automatically. And, to be honest, seems to give rise to less false positives than markdownlint. |
|
I just discovered it messes up when dealing with the Word Blanks challenge. It doesn't escape the _s properly, so I've blocked this until I figure out what I've done wrong. |
8a4f191 to
f35be85
Compare
|
@raisedadead it's been a bit of windy road getting here, but it seems to be in a good spot. It's possible that some challenges look slightly odd after this if they made heavy use of html, but none that I've found. I'd still like to change how the linter is called - it's hard-coded to English for the time being. Also, lint-staged still checks all languages (same as master), so those challenges will need formatting before that's particularly useful. Nonetheless I think it's worth looking at, since I'm not planning to change how the formatter behaves unless a bug is found. |
|
Yes, we would be wanting to configure the linter and even the markdown parser to be able to use other languages. Chinese curriculum is our focus next. I will take a look at the code soon. |
6eecb24 to
5aceb2c
Compare
|
@ojeytonwilliams I am wondering if this is something we're still thinking of doing |
|
@thecodingaviator Yes it is. We are just keeping it blocked until a few more things are implemented first. |
5aceb2c to
1a0268a
Compare
1a0268a to
00d8728
Compare
The current parser behaves differently if there is a blank line after the section tag for instructions and descriptions. formatCurriculum rewrites the challenges into GFM and inserts a space after the section tags to ensure the md is parsed correctly. In addition it formats the markdown and replaces code tags with backticks to improve readability. To improve bare url handling and escaping wrapBareUrls is localised so that it only changes the bare urls (including urls in html), not the surrounding markdown. Entities are convertd into characters when escaping, so the challenge parser will interpret them correctly. Html for dfn, sup, sub and similar are kept. This is in contrast to the default conversion to markdown which discards those tags.
chore(formatter): create own package fix(formatter): HTML -> Html test: check code is escaped fix: downgrade formatter to prevent it escaping <
00d8728 to
e87570f
Compare
|
@ojeytonwilliams What do you think about turning |
|
@RandellDawson I don't want to invest too much more time into this, since it's only going to be used once, but I think it's okay now. |
Update index.md)masterbranch of freeCodeCamp.Provides a script,
formatCurriculum, that takes the existing English curriculum, parses each challenge and transforms the instructions and descriptions into standard GFM. In addition, where possible, itThe result is that the challenges are much easier to read. Also, this is PR is a necessary step before #36879 can be fixed - as all challenges need to be in this format before the parser can be changed.
This isn't the prettiest script, but it's quite well tested!