GithubHelp home page GithubHelp logo

simple-docs's Introduction

GitHub package.json version CircleCI Build Status Known Vulnerabilities PR GitHub Twitter Follow

simple-docs

A simple documentation tool.

Installation

npm install --save-dev @nhevia/simple-docs

Usage

  • Add sdoc as a package.json script:
"scripts": {
  "docs": "sdoc"
}
  • Use a comment block at the start of any file with sdoc preffix:
/*sdoc
This is the main component
*/

// your code
  • Run npm run docs. It will indentify documentation blocks in your project and generates an output file (sdoc.md by default, on root folder):

Since the generated file is markdown, it is supported inside documentation blocks.

/*sdoc
  This is the **main** component
*/

image

Options

  • -f <filename>, --file <filename>
    Set the output file name: sdoc -f docs-components | sdoc --file docs-components
  • -ni, --no-index
    Set the output file name. sdoc -ni | sdoc --no-index

Why?

Most major documentation libraries have tools that are beyond the current necessities for personal projects.

I needed a really simple tool to generate documentation for my scripts. Insert a comment block at the beggining of the file describing it and its usage and that's it.

Note that if you're working in a team with multiple people, there are better, more tested and reliable alternatives.

Contributing

Pull requests are more than welcome.

License

Copyright © 2020 Nicolas Hevia This project is MIT licensed

simple-docs's People

Contributors

malows avatar nhevia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

malows

simple-docs's Issues

Full coverage check

Right now sitting at 72%. Need to add tests for impure functions (fs, fsp).

Index links point to online repository

Since we know the path of each file (ex: src/sdocs.js) using options to determine git online repository (be github, gitlab, bitbucket, etc) can be reproduced easily (ex: https://github.com/nhevia/simple-docs/blob/master/src/sdocs.js).

File paths in the index are links already (hash links inside the output file), so this needs to be added next to them (icon for example).

Things to take into consideration:

  • User is able to opt-out (default: true)
  • Git remote option list (github, gitlab, bitbucket, etc). This will need maintenance as providers might differ in their url structure.
  • Consider main branch?

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.