documentationjs / documentationjs/documentation

html: output both @classdesc and constructor

Open
#109 2 comments 3 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
JavaScript
Stars
5.8k
Forks
481
PR merge metrics
No merged PRs in 30d

Description

Documentation for a class should include both the class-level description (from `@classdesc`) and the description for the constructor.

## Help wanted summary

* **Intent**: To show the `classdesc` tag in HTML output. [Here's the documentation for classdesc](http://usejsdoc.org/tags-classdesc.html) on JSDoc's site.
* **Requirements**: This task requires JavaScript skills, but can be done without deep changes to documentation.js.
* **Where**: this [lodash template](https://github.com/documentationjs/documentation/blob/master/default_theme/section._) in default_theme is where we output `section.description`. You will add a new section ( [here are examples of template syntax](https://lodash.com/docs/4.17.4#template) ) that will check whether `section` has a `classdesc` property, and if it does, output it onto the page. The value of the classdesc property will be a Markdown object, so, like section.description, you'll use the `md` function to turn it into a string that fits in an HTML page
* **Tests**: [nested.input.js](https://github.com/documentationjs/documentation/blob/master/test/fixture/html/nested.input.js) is the only test fixture that generates a HTML output, so that's the place. Add a `@classdesc` tag to `Klass` and run it.

Shortcuts:

To quickly test changes to documentation.js, you can run `./bin/documentation.js` instead of npm installing it. That will let you run, for instance

./bin/documentation.js serve test/fixture/html/nested.input.js

To update the test fixture, run

UPDATE=true npm test

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.