Skip to content

Script to extract JavaScript fragments from a markdown file #113

@vsemozhetbyt

Description

@vsemozhetbyt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions