jsdoc2md / jsdoc-parse

parses jsdoc documentation from javascript or html files, outputs JSON
MIT License
95 stars 19 forks source link

Does not support "extends" #10

Closed ca0v closed 8 years ago

ca0v commented 8 years ago

Here is an example which provides "@extends":

 * @classdesc
 * The map is the core component of OpenLayers. For a map to render, a view,
 * one or more layers, and a target container are needed:
 *
 *     var map = new ol.Map({
 *       view: new ol.View({
 *         center: [0, 0],
 *         zoom: 1
 *       }),
 *       layers: [
 *         new ol.layer.Tile({
 *           source: new ol.source.MapQuest({layer: 'osm'})
 *         })
 *       ],
 *       target: 'map'
 *     });
 *
 * The above snippet creates a map using a {@link ol.layer.Tile} to display
 * {@link ol.source.MapQuest} OSM data and render it to a DOM element with the
 * id `map`.
 *
 * The constructor places a viewport container (with CSS class name
 * `ol-viewport`) in the target element (see `getViewport()`), and then two
 * further elements within the viewport: one with CSS class name
 * `ol-overlaycontainer-stopevent` for controls and some overlays, and one with
 * CSS class name `ol-overlaycontainer` for other overlays (see the `stopEvent`
 * option of {@link ol.Overlay} for the difference). The map itself is placed in
 * a further element within the viewport, either DOM or Canvas, depending on the
 * renderer.
 *
 * @constructor
 * @extends {ol.Object}
 * @param {olx.MapOptions} options Map options.
 * @fires ol.MapBrowserEvent
 * @fires ol.MapEvent
 * @fires ol.render.Event#postcompose
 * @fires ol.render.Event#precompose
 * @api stable
 */
75lb commented 8 years ago

yes, it does support @extends.. i just pasted your code into a file and ran this: (you can see the augments data is present and correct)

$ jsdoc-parse tmp/extends-issue.js
[
  {
    "id": "yeah()",
    "longname": "yeah",
    "name": "yeah",
    "kind": "constructor",
    "memberof": "yeah",
    "params": [
      {
        "type": {
          "names": [
            "olx.MapOptions"
          ]
        },
        "description": "Map options.",
        "name": "options"
      }
    ],
    "order": 1
  },
  {
    "id": "yeah",
    "longname": "yeah",
    "name": "yeah",
    "scope": "global",
    "kind": "class",
    "augments": [
      "ol.Object"
    ],
    "description": "The map is the core component of OpenLayers. For a map to render, a view,\none or more layers, and a target container are needed:\n\n    var map = new ol.Map({\n      view: new ol.View({\n        center: [0, 0],\n        zoom: 1\n      }),\n      layers: [\n        new ol.layer.Tile({\n          source: new ol.source.MapQuest({layer: 'osm'})\n        })\n      ],\n      target: 'map'\n    });\n\nThe above snippet creates a map using a {@link ol.layer.Tile} to display\n{@link ol.source.MapQuest} OSM data and render it to a DOM element with the\nid `map`.\n\nThe constructor places a viewport container (with CSS class name\n`ol-viewport`) in the target element (see `getViewport()`), and then two\nfurther elements within the viewport: one with CSS class name\n`ol-overlaycontainer-stopevent` for controls and some overlays, and one with\nCSS class name `ol-overlaycontainer` for other overlays (see the `stopEvent`\noption of {@link ol.Overlay} for the difference). The map itself is placed in\na further element within the viewport, either DOM or Canvas, depending on the\nrenderer.",
    "fires": [
      "ol.event:MapBrowserEvent",
      "ol.event:MapEvent",
      "ol.render.Event#event:postcompose",
      "ol.render.Event#event:precompose"
    ],
    "customTags": [
      {
        "tag": "api",
        "value": "stable"
      }
    ],
    "order": 0
  }
]