-
Notifications
You must be signed in to change notification settings - Fork 284
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
Code Import #256
Code Import #256
Conversation
this is a very cool and nice feature you are adding! a few things I noticed without performing a full review:
|
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.
Looking forward to getting this is - I love being able to use real files in our code examples (and run CI on them!). I'll leave this to @nickfrosty to sign off on, as he has more a strategic idea for .com, but here are some small and hopefully useful code suggestions, everything else looks great.
No markdown file will be empty with code blocks, |
@nickfrosty shall we update this repo to use pnpm instead of yarn? |
I am thinking of adding a code import chaining feature where we can chain the Lines to add multiple lines of codeblocks from the same file, will that be good idea? eg. ```file=\code\hello.js#3-4#6-10#11-15 this way code files can exist as a test file instead of the exact code. |
* code import refactor, sync and watch mode * husky precommit lint hook * mdx support * debug support * ignore node modules * optional quotes and line chaining * husky deprecation changes * use fs/promises * ignore contributing.md * package merge resolve * ignore pnpm lock * refactor: scripts --------- Co-authored-by: nickfrosty <[email protected]>
Problem
Solves #170
Summary of Changes
added a script to import code files
does supports dev and build mode for md and mdx files
supports this syntax (ignore square brackets)
[```]language file="filepath.ext" .....
[`` `]
added pre-build script, before building, import code files and then builds contentlayer project
added dev script to import code files at
development
to import code use
yarn code-import
Example
markdown file
code file