Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Script to extract JavaScript fragments from a markdown file #113

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

Closed
vsemozhetbyt opened this issue Jan 11, 2017 · 3 comments
Closed

Script to extract JavaScript fragments from a markdown file #113

vsemozhetbyt opened this issue Jan 11, 2017 · 3 comments

Comments

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Jan 11, 2017

Most likely there are many better solutions for this, but here it is my quick attempt.

Usage: md.extract-js.js markdown-file.md.

Extracted .js files will be created in the markdown-file.md.extracted-js directory next to markdown-file.md. Each file has this name template: numberOfFragment.numberOfFirstLine-numberOfLastLine.js.

A contributor can run a linter on the whole directory or run each file with Node.js. There will be many linter errors or runtime errors due to many undeclared (or unused) variables, so some filter work will be needed.

In our case, the odd filenames are bad examples, the even filenames are good ones.

Here is a new PR from this script's work.

@ryanmcdermott
Copy link
Owner

Hey this is a cool script! This could be expanded upon to be used as part of a code testing suite too for this project. I think having real working code here is a thing to aim for!

@ryanmcdermott
Copy link
Owner

Closing for now, would love to see the script as its own project, cool stuff!

@vsemozhetbyt
Copy link
Contributor Author

@ryanmcdermott There is an ESLint plugin for js in markdown from the ESLint team itself!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants