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

Feature Request: Markdown preview tool linting #4340

Open
2 of 4 tasks
damon314159 opened this issue Jan 16, 2024 · 5 comments · May be fixed by #4520
Open
2 of 4 tasks

Feature Request: Markdown preview tool linting #4340

damon314159 opened this issue Jan 16, 2024 · 5 comments · May be fixed by #4520
Assignees
Labels
Status: Needs Review This issue/PR needs an initial or additional review

Comments

@damon314159
Copy link
Member

damon314159 commented Jan 16, 2024

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 😆

@damon314159 damon314159 added the Status: Needs Review This issue/PR needs an initial or additional review label Jan 16, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog / Ideas in Main Site Jan 16, 2024
@JoshDevHub
Copy link
Contributor

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.

@Unique-Pixels
Copy link

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

@KevinMulhern
Copy link
Member

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.

@damon314159
Copy link
Member Author

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 🔥

@ZachBaird
Copy link
Contributor

I can take this @KevinMulhern

@ZachBaird ZachBaird self-assigned this May 9, 2024
@ZachBaird ZachBaird linked a pull request May 9, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review This issue/PR needs an initial or additional review
Projects
Status: 📋 Backlog / Ideas
Development

Successfully merging a pull request may close this issue.

5 participants