🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@aexol/socket-to-markdown

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aexol/socket-to-markdown

Document socket using markdown

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

socket-to-markdown

Analyze socket.yml in current directory and print to stdout markdown with socket documentation. Project was inspired by jsdoc-to-markdown, though it's far simpler as my needs were simpler.

Installation

$ npm install --save-dev @aexol/socket-to-markdown

Usage

Just add this to your socket's package.json

{
    ...
    "scripts": {
        ...
        "docs": "socket2md > README.md; echo"
        ...
    },
    ...
}

and then run

$ npm run docs

Built in partials

  • class-row
  • classes-index
  • classes
  • config-index
  • config
  • endpoint
  • endpoints-index
  • endpoints
  • events
  • index
  • main
  • input
  • inputs
  • inputs-block
  • inputs-table

Extra partial

You can add any handlebars template file as partial template.

Built in helpers

  • socket - Get socket object
  • classes - Get classes obejct
  • config - Get config object
  • endpoints - Get endpoints obejct
  • events - Get events object
  • inputs - Get inputs for current endpoint
  • inputs-table - Create param table for current endpoint
  • reference-type - True if class type is reference or relation.

Extra helpers

Just add javascript file exporting simple function, for example:

module.exports = (context, options) => {
    let out = 'HEADER!!!!\n'
    out += options.fn(this)
    out += 'FOOTER!!!\n'
    return out:
}

TODO:

  • Syncano events.

Keywords

socket

FAQs

Package last updated on 08 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts