GithubHelp home page GithubHelp logo

kettanaito / doc-validator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nickmccurdy/doc-validator

0.0 2.0 0.0 295 KB

A library/tool for validating JavaScript code in Markdown documentation

JavaScript 89.12% Shell 10.88%

doc-validator's Introduction

doc-validator

A library/tool for validating JavaScript code in Markdown documentation

Status

In development. JavaScript code in Markdown documentation can be parsed via the API or CLI, but there is no support for running code yet (see 1.0.0 milestone).

Usage

Library

Install doc-validator as a dependency. All commands take a Markdown source string and return an Array of any Errors reported. Errors are not thrown to make it easier to detect multiple errors from separate JavaScript code examples in the same file, so you will probably want to print or throw them.

Tool

Install doc-validator globally for any project, or as a local development dependency for CI and test scripts. Use with a filename like doc-validator parse README.md to parse existing Markdown files, or pass stdin with no path argument for advanced scripting.

API

parse

Parses JavaScript using Babel. Modern standardized syntax is supported, including ES modules (supported by Node).

import { parse } from "doc-validator"
;(async () => {
  await parse('```js\nconsole.log("Hello, world!")\n```')
})()

Planned

  • type
  • run
  • test

doc-validator's People

Contributors

nickmccurdy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.