ember-cli-jsdoc icon indicating copy to clipboard operation
ember-cli-jsdoc copied to clipboard

Consider supporting this alternative documentation location within an Ember application itself

Open notmessenger opened this issue 9 years ago • 0 comments
trafficstars

@makepanic has integrated generated JSDoc output into a dummy Ember app so that styling is picked up from the app and are an Ember route. This can be viewed at http://makepanic.github.io/ember-keyword-complete/#/api/ember-keyword-complete_addon_components_keyword-complete.js

He states that the current disadvantages are that this currently relies on a couple lines of bash

https://raw.githubusercontent.com/makepanic/ember-keyword-complete/master/jsdoc-ast.sh

#!/usr/bin/env bash

ADDON_NAME="ember-keyword-complete"

PWD=$(pwd | sed 's_/_\\/_g')
CONF_PATH="tests/dummy/config/"
AST_FILE="jsdoc-ast.json"

jsdoc -X -r addon \
  | sed "s/${PWD}/${ADDON_NAME}/g" \
  | jq 'map(select(has("undocumented")|not))' \
  > ${CONF_PATH}${ADDON_NAME}.ast.json

and isn't usable for all jsdoc cases.

It basically works by loading the AST generated from the shell script mentioned above and puts it in the dummy environment.

  • https://github.com/makepanic/ember-keyword-complete/blob/master/tests/dummy/config/environment.js#L20
  • https://github.com/makepanic/ember-keyword-complete/blob/master/tests/dummy/app/templates/api/file.hbs

notmessenger avatar Dec 17 '15 21:12 notmessenger