TheOdinProject / theodinproject

Main Website for The Odin Project

Home Page:http://www.theodinproject.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Markdown preview tool linting

damon314159 opened this issue · comments

Checks

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this issue follows the Feature Request: brief description of feature request format, e.g. Feature Request: Add a dark mode to the website
  • Would you like to work on this issue?

Description of the Feature Request

The markdown preview tool used when contributing to lessons (app/views/lessons/previews/) renders content without checking that it will meet the criteria applied by the linting tool in the new PR checks pipeline on the curriculum repo. This can lead to a situation where a user checks using the tool, everything looks fine, and then once the PR is open the bot will complain.

If this could be highlighted during the preview stage, it would prevent several commits, check what the bot says, commit again, etc

Acceptance criteria

Additional Comments

I would offer to help on this if I had any idea how 😆

Knowing some things about how the Markdown parsing works behind the scenes on that preview tool, this sounds like it might be tricky to implement haha.

It'd definitely be nice to have and I'll keep this open unless Kevin thinks it's just completely unfeasible. But I know it's not something that'd be trivial to add in.

Something we can do in the meantime: advocate using the CLI. If you npm install that package globally, then you can run something like:

markdownlint-cli2 --config "lesson.markdownlint-cli2.jsonc" "path/to/lesson.md" 
# use project config if lesson is project

What do you think about that @damon314159 ?

Maybe we can write some wrapper script to make running it more ergonomic lol. Something I'm not crazy about: this obviously requires installations for node and npm. Curriculum contributions requiring zero tooling (even as a nice-to-have) would be nice to preserve.

I have been using the VSCode extension for a few days. It automatically picks up the basic config, though not the parts in the lesson and project file. But that gets the vast majority of the problems.

Now I just have to figure out how to turn it off on other repos, lol

It would be cool if we could find and use a JS package to perform the linting in realtime as the markdown is inputed. It would probably be easier trying to wrangle it into our modified backend markdown parser haha. Happy to leave this open too though @JoshDevHub, if someone manages to find a way, it would be a brilliant quality of life upgrade.

I appreciate the CLI guidance and will use that until a different solution presents itself. FWIW I do agree about the 0 tooling issue, but I understand it's not an easy implementation. Thanks for reading this over 🔥

I can take this @KevinMulhern