We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7130b17 commit 0b1f819Copy full SHA for 0b1f819
scripts/make_mdx.sh
@@ -57,9 +57,15 @@ function convert_to_mdx() {
57
for f in *.py *.sh; do
58
if [ -f "$f" ]; then
59
local extension="${f##*.}"
60
- awk 'BEGIN {print "```" extension}
+ local lang=""
61
+ if [ "$extension" = "py" ]; then
62
+ lang="python"
63
+ elif [ "$extension" = "sh" ]; then
64
+ lang="bash"
65
+ fi
66
+ awk -v lang="$lang" 'BEGIN {print "```" lang}
67
{print}
- END {print "```"}' extension="$extension" "$f" > "${f}.mdx"
68
+ END {print "```"}' "$f" > "${f}.mdx"
69
mv "${f}.mdx" "$f"
70
else
71
echo "No files to convert in ${CODE_DIR}"
0 commit comments