Skip to content
/ js-in-md Public

[WIP] Plugins for linting and processing js snippets in markdown files

License

Notifications You must be signed in to change notification settings

a-x-/js-in-md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

js-in-md

Plugins for linting and processing js snippets in markdown files

WIP

prototype

for f in common.blocks/*/*.ru.md; do
  remark --tree-out $f 2> /dev/null \
  | jq '[.children[] | select(.type? == "code" and .lang? == "js") | .value]' \
  | node -p "
    '['
    +JSON.parse(require('fs').readFileSync('/dev/stdin').toString())
      .map(c=>{var c_=c.trim(); c_.startsWith('{') && (c_='('+c_+')'); return 'function(){\\n'+c_+'\\n}'})
      .join(',\\n')
    +']'" \
  | node -c \
  || echo Error in $f;
done

About

[WIP] Plugins for linting and processing js snippets in markdown files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published