Open heyAyushh opened 1 month ago
this is a very cool and nice feature you are adding!
a few things I noticed without performing a full review:
git
/i18n/**
directory (which is ignored by git).md
files
.mdx
files that will have code snippets in them. so we need to make sure we collect all content files in the /content
directory and the /i18n
directorygetMarkdownFiles
function to look at the mdx files and as I suspected, the code script injects extra content which breaks the mdx render. this is a must fix! (also to note that any .md
file can also use our custom components or standard html components)file
metadata that starts with a slash, it does not load the content
/
that represents the root of the repo. this way things stay consistent and are easier to maintain and testhttp://
and it is easily detected tootsx
cli tool which gets pretty flakey
npx esrun
instead since it is more reliable and works on more platformsNo markdown file will be empty with code blocks, Instead it will be synced and updated with codeblock everytime build or dev happens.
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