Skip to content

Duologic/autodoc

Repository files navigation

Autodoc

Autodoc can generate documentation for Jsonnet code, optionally annotated with code comments.

While any comments are processed, the goal is to parse and pretty print JSDoc annotations.

Caution

This is an experimental library.

Index

Fields

func new

new(title, file)

new creates a new autodoc parser

  • @constructor
  • @param {string} - title
  • @param {string} - file (example: imporstr './main.libsonnet')
  • @returns {object}

func new().render

render(depth=0)

render processes the file into Markdown

  • @param {number} - [depth=0]
  • @returns {string}

func new().generateIndex

generateIndex(lines)

func new().findRootObject

findRootObject(ast)

func new().renderObject

renderObject(object, parents=[], depth, noHeader=false)

func new().documentableFields

documentableFields(object)

Find fields that can be documented. This essentially filters out calculated fields in the form of [<expr>].

func new().fieldName

fieldName(field)

Get the field name, this assumes fieldname.type is either string or id. Use documentableFields() to filter these out.

func new().filterFunctionFields

filterFunctionFields(fields)

func new().filterAnonymousFunctionFields

filterAnonymousFunctionFields(fields)

func new().filterObjectFields

filterObjectFields(fields)

func new().renderFieldFunction

renderFieldFunction(field, parents, depth)

func new().renderAnonymousFunction

renderAnonymousFunction(field, parents, depth)

func new().renderFunction

renderFunction(name, signature, docstring, depth)

func new().getCommentBeforeLine

getCommentBeforeLine(lineNr)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Contributors