From f7f117adae2ff97ef3dd0494a9d403592190a58e Mon Sep 17 00:00:00 2001 From: Ryuichi Okumura Date: Sat, 15 Aug 2015 23:22:21 +0900 Subject: [PATCH] Build docs --- docs/args/partials/help.mustache | 2 +- output/api/api.js | 3 +- output/api/assets/js/api-filter.js | 6 +- output/api/assets/js/api-list.js | 8 +- output/api/assets/js/apidocs.js | 8 +- output/api/classes/CLI.html | 3 +- output/api/classes/DocBuilder.html | 239 +++++++++++++++++++++---- output/api/classes/DocParser.html | 131 +++++++++++--- output/api/classes/DocView.html | 3 +- output/api/classes/Files.html | 3 +- output/api/classes/Help.html | 3 +- output/api/classes/Main.html | 3 +- output/api/classes/Options.html | 3 +- output/api/classes/Server.html | 3 +- output/api/classes/Utils.html | 3 +- output/api/classes/YUIDoc.html | 3 +- output/api/data.json | 179 ++++++++++++------ output/api/elements/index.html | 10 ++ output/api/files/lib_builder.js.html | 202 ++++++++++++++++++--- output/api/files/lib_cli.js.html | 3 +- output/api/files/lib_docparser.js.html | 152 ++++++++++++++-- output/api/files/lib_docview.js.html | 3 +- output/api/files/lib_files.js.html | 3 +- output/api/files/lib_help.js.html | 3 +- output/api/files/lib_index.js.html | 3 +- output/api/files/lib_options.js.html | 3 +- output/api/files/lib_project.js.html | 3 +- output/api/files/lib_server.js.html | 3 +- output/api/files/lib_utils.js.html | 3 +- output/api/files/lib_yuidoc.js.html | 3 +- output/api/index.html | 3 +- output/api/modules/yuidoc.html | 4 +- output/args/index.html | 2 +- output/index.html | 4 +- output/syntax/index.html | 97 +++++++++- 35 files changed, 912 insertions(+), 195 deletions(-) create mode 100644 output/api/elements/index.html diff --git a/docs/args/partials/help.mustache b/docs/args/partials/help.mustache index dbd36f27..992addcd 100644 --- a/docs/args/partials/help.mustache +++ b/docs/args/partials/help.mustache @@ -1,7 +1,7 @@ YUI Doc generates API documentation from a modified JavaDoc syntax. -Current version (0.8.1) +Current version (0.9.0) Usage: yuidoc diff --git a/output/api/api.js b/output/api/api.js index ce5fa4d2..7e472516 100644 --- a/output/api/api.js +++ b/output/api/api.js @@ -22,6 +22,7 @@ YUI.add("yuidoc-meta", function(Y) { "name": "yuidoc", "description": "This is the __module__ description for the `YUIDoc` module.\n\n var options = {\n paths: [ './lib' ],\n outdir: './out'\n };\n\n var Y = require('yuidocjs');\n var json = (new Y.YUIDoc(options)).run();" } - ] + ], + "elements": [] } }; }); \ No newline at end of file diff --git a/output/api/assets/js/api-filter.js b/output/api/assets/js/api-filter.js index 37aefbab..d442e543 100644 --- a/output/api/assets/js/api-filter.js +++ b/output/api/assets/js/api-filter.js @@ -14,6 +14,10 @@ Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], { } }); + if (this.get('queryType') === 'elements') { + name = '<' + name + '>'; + } + return name; } @@ -24,7 +28,7 @@ Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], { value: 'phraseMatch' }, - // May be set to "classes" or "modules". + // May be set to "classes", "elements" or "modules". queryType: { value: 'classes' }, diff --git a/output/api/assets/js/api-list.js b/output/api/assets/js/api-list.js index 88905b52..e8f650d5 100644 --- a/output/api/assets/js/api-list.js +++ b/output/api/assets/js/api-list.js @@ -6,6 +6,7 @@ var Lang = Y.Lang, APIList = Y.namespace('APIList'), classesNode = Y.one('#api-classes'), + elementsNode = Y.one('#api-elements'), inputNode = Y.one('#api-filter'), modulesNode = Y.one('#api-modules'), tabviewNode = Y.one('#api-tabview'), @@ -97,7 +98,9 @@ tabview.get('panelNode').all('a').each(function (link) { // -- Private Functions -------------------------------------------------------- function getFilterResultNode() { - return filter.get('queryType') === 'classes' ? classesNode : modulesNode; + var queryType = filter.get('queryType'); + return queryType === 'classes' ? classesNode + : queryType === 'elements' ? elementsNode : modulesNode; } // -- Event Handlers ----------------------------------------------------------- @@ -105,7 +108,7 @@ function onFilterResults(e) { var frag = Y.one(Y.config.doc.createDocumentFragment()), resultNode = getFilterResultNode(), typePlural = filter.get('queryType'), - typeSingular = typePlural === 'classes' ? 'class' : 'module'; + typeSingular = typePlural === 'classes' ? 'class' : typePlural === 'elements' ? 'element' : 'module'; if (e.results.length) { YArray.each(e.results, function (result) { @@ -181,6 +184,7 @@ function onTabSelectionChange(e) { }; switch (name) { + case 'elements':// fallthru case 'classes': // fallthru case 'modules': filter.setAttrs({ diff --git a/output/api/assets/js/apidocs.js b/output/api/assets/js/apidocs.js index e00591c1..af9ac322 100644 --- a/output/api/assets/js/apidocs.js +++ b/output/api/assets/js/apidocs.js @@ -43,6 +43,12 @@ pjax = new Y.Pjax({ callbacks: defaultRoute }, + // -- /elements/* ------------------------------------------------------- + { + path : '/elements/:element.html*', + callbacks: defaultRoute + }, + // -- /classes/* ------------------------------------------------------- { path : '/classes/:class.html*', @@ -167,7 +173,7 @@ pjax.initLineNumbers = function () { }; pjax.initRoot = function () { - var terminators = /^(?:classes|files|modules)$/, + var terminators = /^(?:classes|files|elements|modules)$/, parts = pjax._getPathRoot().split('/'), root = [], i, len, part; diff --git a/output/api/classes/CLI.html b/output/api/classes/CLI.html index 876aa816..7c4da830 100644 --- a/output/api/classes/CLI.html +++ b/output/api/classes/CLI.html @@ -17,7 +17,7 @@

- API Docs for: 0.8.1 + API Docs for: 0.9.0
@@ -51,6 +51,7 @@

APIs

  • YUIDoc
  • + diff --git a/output/api/classes/DocBuilder.html b/output/api/classes/DocBuilder.html index 59228b51..0b4ca753 100644 --- a/output/api/classes/DocBuilder.html +++ b/output/api/classes/DocBuilder.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + @@ -189,6 +190,10 @@

    Methods

  • populateClasses +
  • +
  • + populateElements +
  • populateFiles @@ -209,6 +214,10 @@

    Methods

  • renderClass +
  • +
  • + renderElement +
  • renderFile @@ -227,7 +236,7 @@

    Methods

  • - writeClasses + writeComponents
  • @@ -349,7 +358,7 @@

    _inlineCode

    Defined in - lib/builder.js:722 + lib/builder.js:767

    @@ -408,7 +417,7 @@

    _mixExternal

    Defined in - lib/builder.js:274 + lib/builder.js:297

    @@ -450,7 +459,7 @@

    _parseCode

    Defined in - lib/builder.js:709 + lib/builder.js:754

    @@ -520,7 +529,7 @@

    _parseCrossLink

    Defined in - lib/builder.js:168 + lib/builder.js:169

    @@ -601,7 +610,7 @@

    addFoundAt

    Defined in - lib/builder.js:580 + lib/builder.js:625

    @@ -667,7 +676,7 @@

    augmentData

    Defined in - lib/builder.js:596 + lib/builder.js:641

    @@ -731,7 +740,7 @@

    compile

    Defined in - lib/builder.js:1597 + lib/builder.js:1737

    @@ -788,7 +797,7 @@

    filterFileName

    Defined in - lib/builder.js:1584 + lib/builder.js:1724

    @@ -850,7 +859,7 @@

    getProjectMeta

    Defined in - lib/builder.js:410 + lib/builder.js:433

    @@ -902,7 +911,7 @@

    hasProperty

    Defined in - lib/builder.js:995 + lib/builder.js:1055

    @@ -975,7 +984,7 @@

    makeDirs

    Defined in - lib/builder.js:656 + lib/builder.js:701

    @@ -1033,7 +1042,7 @@

    markdown

    Defined in - lib/builder.js:143 + lib/builder.js:144

    @@ -1102,7 +1111,7 @@

    mergeExtends

    Defined in - lib/builder.js:1019 + lib/builder.js:1079

    @@ -1179,7 +1188,7 @@

    mixExternal

    Defined in - lib/builder.js:322 + lib/builder.js:345

    @@ -1239,7 +1248,7 @@

    nameSort

    Defined in - lib/builder.js:1406 + lib/builder.js:1545

    @@ -1316,7 +1325,7 @@

    populateClasses

    Defined in - lib/builder.js:453 + lib/builder.js:476

    @@ -1357,6 +1366,72 @@

    Returns:

    +
    +
    +

    populateElements

    + +
    + (
      +
    • + opts +
    • +
    ) +
    + + + Object + + + + + + + + +
    +

    + Defined in + lib/builder.js:500 +

    + + + +
    + +
    +

    Populate the meta data for elements

    + +
    + +
    +

    Parameters:

    + +
      +
    • + opts + Object + + +
      +

      The original options

      + +
      + +
    • +
    +
    + +
    +

    Returns:

    + +
    + Object: +

    The modified options

    + +
    +
    + +

    populateFiles

    @@ -1382,7 +1457,7 @@

    populateFiles

    Defined in - lib/builder.js:523 + lib/builder.js:568

    @@ -1448,7 +1523,7 @@

    populateModules

    Defined in - lib/builder.js:477 + lib/builder.js:522

    @@ -1523,7 +1598,7 @@

    render

    Defined in - lib/builder.js:741 + lib/builder.js:786

    @@ -1645,7 +1720,7 @@

    renderAPIMeta

    Defined in - lib/builder.js:1551 + lib/builder.js:1690

    @@ -1711,7 +1786,7 @@

    renderClass

    Defined in - lib/builder.js:1071 + lib/builder.js:1131

    @@ -1765,6 +1840,82 @@

    Parameters:

    +
    +
    +

    renderElement

    + +
    + (
      +
    • + cb +
    • +
    ) +
    + + + + + + + + +
    +

    + Defined in + lib/builder.js:1424 +

    + + + +
    + +
    +

    Render the element file

    + +
    + +
    +

    Parameters:

    + +
      +
    • + cb + Function + + +
      +

      The callback fired when complete

      + +
      + +
        +
      • + html + String + +
        +

        The HTML to render this view

        + +
        + +
      • +
      • + view + Object + +
        +

        The View Data

        + +
        + +
      • +
      +
    • +
    +
    + + +

    renderFile

    @@ -1787,7 +1938,7 @@

    renderFile

    Defined in - lib/builder.js:1479 + lib/builder.js:1618

    @@ -1863,7 +2014,7 @@

    renderIndex

    Defined in - lib/builder.js:797 + lib/builder.js:842

    @@ -1939,7 +2090,7 @@

    renderModule

    Defined in - lib/builder.js:858 + lib/builder.js:904

    @@ -2016,7 +2167,7 @@

    writeAPIMeta

    Defined in - lib/builder.js:1538 + lib/builder.js:1677

    @@ -2049,11 +2200,14 @@

    Parameters:

    -
    -

    writeClasses

    +
    +

    writeComponents

    (
    - Defined in: lib/docparser.js:752 + Defined in: lib/docparser.js:794
    Module: yuidoc @@ -132,7 +133,7 @@

    DocParser

    Defined in - lib/docparser.js:752 + lib/docparser.js:794

    @@ -566,6 +567,9 @@

    Attributes

  • currentclass
  • +
  • + currentelement +
  • currentfile
  • @@ -3010,7 +3014,7 @@

    _resolveFor

    Defined in - lib/docparser.js:1036 + lib/docparser.js:1110

    @@ -4375,7 +4379,7 @@

    extract

    Defined in - lib/docparser.js:1205 + lib/docparser.js:1287

    @@ -4804,7 +4808,7 @@

    handlecomment

    Defined in - lib/docparser.js:1127 + lib/docparser.js:1209

    @@ -5521,7 +5525,7 @@

    parse

    Defined in - lib/docparser.js:1447 + lib/docparser.js:1562

    @@ -5682,7 +5686,7 @@

    processblock

    Defined in - lib/docparser.js:1260 + lib/docparser.js:1342

    @@ -6479,7 +6483,7 @@

    transform

    Defined in - lib/docparser.js:1333 + lib/docparser.js:1433

    @@ -6548,7 +6552,7 @@

    unindent

    Defined in - lib/docparser.js:1106 + lib/docparser.js:1188

    @@ -6729,7 +6733,7 @@

    CORRECTIONS

    Defined in - lib/docparser.js:190 + lib/docparser.js:194

    @@ -6755,7 +6759,7 @@

    DIGESTERS

    Defined in - lib/docparser.js:213 + lib/docparser.js:217

    @@ -6784,7 +6788,7 @@

    IGNORE_TAGLIST

    Defined in - lib/docparser.js:178 + lib/docparser.js:182

    @@ -6837,7 +6841,7 @@

    TAGLIST

    Defined in - lib/docparser.js:96 + lib/docparser.js:97

    @@ -6873,7 +6877,7 @@

    currentclass

    Defined in - lib/docparser.js:996 + lib/docparser.js:1040

    @@ -6936,6 +6940,85 @@

    Parameters:

    +
    +
    + +

    currentelement

    + String + + + + + + + + +
    +

    + Defined in + lib/docparser.js:1080 +

    + + +
    + +
    +

    The element currently being parsed

    + +
    + + +
    +

    Fires event currentelementChange

    + +

    + Fires when the value for the configuration attribute currentelement is + changed. You can listen for the event using the on method if you + wish to be notified before the attribute's value has changed, or + using the after method if you wish to be notified after the + attribute's value has changed. +

    + +
    +

    Parameters:

    + +
      +
    • + e + EventFacade + +
      + An Event Facade object with the following + attribute-specific properties added: +
      + +
        +
      • + prevVal + Any +
        The value of the attribute, prior to it being set.
        +
      • +
      • + newVal + Any +
        The value the attribute is to be set to.
        +
      • +
      • + attrName + String +
        The name of the attribute being set.
        +
      • +
      • + subAttrName + String +
        If setting a property within the attribute's value, the name of the sub-attribute property being set.
        +
      • +
      +
    • +
    +
    +
    +
    @@ -6952,7 +7035,7 @@

    currentfile

    Defined in - lib/docparser.js:840 + lib/docparser.js:882

    @@ -7031,7 +7114,7 @@

    currentmodule

    Defined in - lib/docparser.js:897 + lib/docparser.js:939

    @@ -7110,7 +7193,7 @@

    currentsubmodule

    Defined in - lib/docparser.js:956 + lib/docparser.js:999

    @@ -7270,7 +7353,7 @@

    digesters

    Defined in - lib/docparser.js:780 + lib/docparser.js:822

    @@ -7359,7 +7442,7 @@

    dirmap

    Defined in - lib/docparser.js:830 + lib/docparser.js:872

    @@ -7440,7 +7523,7 @@

    emitters

    Defined in - lib/docparser.js:802 + lib/docparser.js:844

    @@ -7520,7 +7603,7 @@

    filemap

    Defined in - lib/docparser.js:822 + lib/docparser.js:864

    @@ -7680,7 +7763,7 @@

    mainmodule

    Defined in - lib/docparser.js:861 + lib/docparser.js:903

    @@ -7759,7 +7842,7 @@

    syntaxtype

    Defined in - lib/docparser.js:813 + lib/docparser.js:855

    diff --git a/output/api/classes/DocView.html b/output/api/classes/DocView.html index 039a0bb9..71e146c1 100644 --- a/output/api/classes/DocView.html +++ b/output/api/classes/DocView.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/classes/Files.html b/output/api/classes/Files.html index 6bccbbbe..2289c18d 100644 --- a/output/api/classes/Files.html +++ b/output/api/classes/Files.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/classes/Help.html b/output/api/classes/Help.html index 79200ba8..e4661eff 100644 --- a/output/api/classes/Help.html +++ b/output/api/classes/Help.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/classes/Main.html b/output/api/classes/Main.html index 7fcfbfc6..254d0e9c 100644 --- a/output/api/classes/Main.html +++ b/output/api/classes/Main.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/classes/Options.html b/output/api/classes/Options.html index 528fd0ba..7c20fccf 100644 --- a/output/api/classes/Options.html +++ b/output/api/classes/Options.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/classes/Server.html b/output/api/classes/Server.html index 8ab29df2..ca9e5aa1 100644 --- a/output/api/classes/Server.html +++ b/output/api/classes/Server.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/classes/Utils.html b/output/api/classes/Utils.html index 7f5b2c06..a29dd410 100644 --- a/output/api/classes/Utils.html +++ b/output/api/classes/Utils.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/classes/YUIDoc.html b/output/api/classes/YUIDoc.html index b9cd4695..637f97ee 100644 --- a/output/api/classes/YUIDoc.html +++ b/output/api/classes/YUIDoc.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/data.json b/output/api/data.json index ac9cadcd..c758dc38 100644 --- a/output/api/data.json +++ b/output/api/data.json @@ -2,7 +2,7 @@ "project": { "name": "yuidoc-root", "description": "YUIDoc, YUI's JavaScript Documentation engine.", - "version": "0.8.1" + "version": "0.9.0" }, "files": { "lib/builder.js": { @@ -122,6 +122,7 @@ "yuidoc": { "name": "yuidoc", "submodules": {}, + "elements": {}, "classes": { "DocBuilder": 1, "CLI": 1, @@ -186,7 +187,7 @@ "module": "yuidoc", "namespace": "", "file": "lib/docparser.js", - "line": 752, + "line": 794, "description": "The doc parser accepts a **map** of files to file content.\nOnce `parse()` is called, various properties will be populated\nwith the parsers data (aggregated in the `'data'` property).", "extends": "Base", "is_constructor": 1, @@ -336,6 +337,7 @@ ] } }, + "elements": {}, "classitems": [ { "file": "lib/builder.js", @@ -361,7 +363,7 @@ }, { "file": "lib/builder.js", - "line": 143, + "line": 144, "description": "Wrapper around the Markdown parser so it can be normalized or even side stepped", "itemtype": "method", "name": "markdown", @@ -383,7 +385,7 @@ }, { "file": "lib/builder.js", - "line": 168, + "line": 169, "description": "Parse the item to be cross linked and return an HREF linked to the item", "itemtype": "method", "name": "_parseCrossLink", @@ -414,7 +416,7 @@ }, { "file": "lib/builder.js", - "line": 274, + "line": 297, "description": "Mixes the various external data soures together into the local data, augmenting\nit with flags.", "itemtype": "method", "name": "_mixExternal", @@ -425,7 +427,7 @@ }, { "file": "lib/builder.js", - "line": 322, + "line": 345, "description": "Fetches the remote data and fires the callback when it's all complete", "itemtype": "method", "name": "mixExternal", @@ -442,7 +444,7 @@ }, { "file": "lib/builder.js", - "line": 397, + "line": 420, "description": "File counter", "itemtype": "property", "name": "files", @@ -452,7 +454,7 @@ }, { "file": "lib/builder.js", - "line": 403, + "line": 426, "description": "Holder for project meta data", "itemtype": "property", "name": "_meta", @@ -464,7 +466,7 @@ }, { "file": "lib/builder.js", - "line": 410, + "line": 433, "description": "Prep the meta data to be fed to Selleck", "itemtype": "method", "name": "getProjectMeta", @@ -477,7 +479,7 @@ }, { "file": "lib/builder.js", - "line": 453, + "line": 476, "description": "Populate the meta data for classes", "itemtype": "method", "name": "populateClasses", @@ -497,7 +499,27 @@ }, { "file": "lib/builder.js", - "line": 477, + "line": 500, + "description": "Populate the meta data for elements", + "itemtype": "method", + "name": "populateElements", + "params": [ + { + "name": "opts", + "description": "The original options", + "type": "Object" + } + ], + "return": { + "description": "The modified options", + "type": "Object" + }, + "class": "DocBuilder", + "module": "yuidoc" + }, + { + "file": "lib/builder.js", + "line": 522, "description": "Populate the meta data for modules", "itemtype": "method", "name": "populateModules", @@ -517,7 +539,7 @@ }, { "file": "lib/builder.js", - "line": 523, + "line": 568, "description": "Populate the meta data for files", "itemtype": "method", "name": "populateFiles", @@ -537,7 +559,7 @@ }, { "file": "lib/builder.js", - "line": 580, + "line": 625, "description": "Parses file and line number from an item object and build's an HREF", "itemtype": "method", "name": "addFoundAt", @@ -557,7 +579,7 @@ }, { "file": "lib/builder.js", - "line": 596, + "line": 641, "description": "Augments the **DocParser** meta data to provide default values for certain keys as well as parses all descriptions\nwith the `Markdown Parser`", "itemtype": "method", "name": "augmentData", @@ -577,7 +599,7 @@ }, { "file": "lib/builder.js", - "line": 656, + "line": 701, "description": "Makes the default directories needed", "itemtype": "method", "name": "makeDirs", @@ -593,7 +615,7 @@ }, { "file": "lib/builder.js", - "line": 709, + "line": 754, "description": "Parses `
    ` tags and adds the __prettyprint__ `className` to them",
                 "itemtype": "method",
                 "name": "_parseCode",
    @@ -615,7 +637,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 722,
    +            "line": 767,
                 "description": "Ported from [Selleck](https://github.com/rgrove/selleck), this handles ```'s in fields\n       that are not parsed by the **Markdown** parser.",
                 "itemtype": "method",
                 "name": "_inlineCode",
    @@ -637,7 +659,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 741,
    +            "line": 786,
                 "description": "Ported from [Selleck](https://github.com/rgrove/selleck)\n       Renders the handlebars templates with the default View class.",
                 "itemtype": "method",
                 "name": "render",
    @@ -689,7 +711,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 797,
    +            "line": 842,
                 "description": "Render the index file",
                 "itemtype": "method",
                 "name": "renderIndex",
    @@ -717,7 +739,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 832,
    +            "line": 878,
                 "description": "Generates the index.html file",
                 "itemtype": "method",
                 "name": "writeIndex",
    @@ -745,7 +767,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 858,
    +            "line": 904,
                 "description": "Render a module",
                 "itemtype": "method",
                 "name": "renderModule",
    @@ -773,7 +795,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 952,
    +            "line": 1012,
                 "description": "Generates the module files under \"out\"/modules/",
                 "itemtype": "method",
                 "name": "writeModules",
    @@ -801,7 +823,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 995,
    +            "line": 1055,
                 "description": "Checks an array of items (class items) to see if an item is in that list",
                 "itemtype": "method",
                 "name": "hasProperty",
    @@ -825,7 +847,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1012,
    +            "line": 1072,
                 "description": "Counter for stepping into merges",
                 "access": "private",
                 "tagname": "",
    @@ -837,7 +859,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1019,
    +            "line": 1079,
                 "description": "Merge superclass data into a child class",
                 "itemtype": "method",
                 "name": "mergeExtends",
    @@ -863,7 +885,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1071,
    +            "line": 1131,
                 "description": "Render the class file",
                 "itemtype": "method",
                 "name": "renderClass",
    @@ -891,11 +913,44 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1363,
    -            "description": "Generates the class files under \"out\"/classes/",
    +            "line": 1424,
    +            "description": "Render the element file",
                 "itemtype": "method",
    -            "name": "writeClasses",
    +            "name": "renderElement",
                 "params": [
    +                {
    +                    "name": "cb",
    +                    "description": "The callback fired when complete",
    +                    "type": "Function",
    +                    "props": [
    +                        {
    +                            "name": "html",
    +                            "description": "The HTML to render this view",
    +                            "type": "String"
    +                        },
    +                        {
    +                            "name": "view",
    +                            "description": "The View Data",
    +                            "type": "Object"
    +                        }
    +                    ]
    +                }
    +            ],
    +            "class": "DocBuilder",
    +            "module": "yuidoc"
    +        },
    +        {
    +            "file": "lib/builder.js",
    +            "line": 1501,
    +            "description": "Generates the class or element files under \"out\"/classes/ or \"out\"/elements/",
    +            "itemtype": "method",
    +            "name": "writeComponents",
    +            "params": [
    +                {
    +                    "name": "type",
    +                    "description": "The component type, \"classes\" or \"elements\"",
    +                    "type": "String"
    +                },
                     {
                         "name": "cb",
                         "description": "The callback to execute after it's completed",
    @@ -919,7 +974,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1406,
    +            "line": 1545,
                 "description": "Sort method of array of objects with a property called __name__",
                 "itemtype": "method",
                 "name": "nameSort",
    @@ -944,7 +999,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1429,
    +            "line": 1568,
                 "description": "Generates the syntax files under `\"out\"/files/`",
                 "itemtype": "method",
                 "name": "writeFiles",
    @@ -972,7 +1027,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1479,
    +            "line": 1618,
                 "description": "Render the source file",
                 "itemtype": "method",
                 "name": "renderFile",
    @@ -1000,7 +1055,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1538,
    +            "line": 1677,
                 "description": "Write the API meta data used for the AutoComplete widget",
                 "itemtype": "method",
                 "name": "writeAPIMeta",
    @@ -1017,7 +1072,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1551,
    +            "line": 1690,
                 "description": "Render the API meta and return the JavaScript",
                 "itemtype": "method",
                 "name": "renderAPIMeta",
    @@ -1041,7 +1096,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1584,
    +            "line": 1724,
                 "description": "Normalizes a file path to a writable filename:\n\n   var path = 'lib/file.js';\n   returns 'lib_file.js';",
                 "itemtype": "method",
                 "name": "filterFileName",
    @@ -1061,7 +1116,7 @@
             },
             {
                 "file": "lib/builder.js",
    -            "line": 1597,
    +            "line": 1737,
                 "description": "Compiles the templates from the meta-data provided by DocParser",
                 "itemtype": "method",
                 "name": "compile",
    @@ -1157,7 +1212,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 96,
    +            "line": 97,
                 "description": "A list of known tags.  This populates a member variable\nduring initialization, and will be updated if additional\ndigesters are added.",
                 "itemtype": "property",
                 "name": "TAGLIST",
    @@ -1168,7 +1223,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 178,
    +            "line": 182,
                 "description": "A list of ignored tags. These tags should be ignored because there is\nlikely to be used for purposes other than JSDoc tags in JavaScript comments.",
                 "itemtype": "property",
                 "name": "IGNORE_TAGLIST",
    @@ -1179,7 +1234,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 190,
    +            "line": 194,
                 "description": "Common errors will get scrubbed instead of being ignored.",
                 "itemtype": "property",
                 "name": "CORRECTIONS",
    @@ -1190,7 +1245,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 213,
    +            "line": 217,
                 "description": "A map of the default tag processors, keyed by the\ntag name.  Multiple tags can use the same digester\nby supplying the string name that points to the\nimplementation rather than a function.",
                 "itemtype": "property",
                 "name": "DIGESTERS",
    @@ -1201,7 +1256,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 780,
    +            "line": 822,
                 "description": "Digesters process the tag/text pairs found in a\ncomment block.  They are looked up by tag name.\nThe digester gets the tagname, the value, the\ntarget object to apply values to, and the full\nblock that is being processed.  Digesters can\nbe declared as strings instead of a function --\nin that case, the program will try to look up\nthe key listed and use the function there instead\n(it is an alias).  Digesters can return a host\nobject in the case the tag defines a new key\nblock type (modules/classes/methods/events/properties)",
                 "itemtype": "attribute",
                 "name": "digesters",
    @@ -1210,7 +1265,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 802,
    +            "line": 844,
                 "description": "Emitters will be schemas for the types of payloads\nthe parser will emit.  Not implemented.",
                 "itemtype": "attribute",
                 "name": "emitters",
    @@ -1219,7 +1274,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 813,
    +            "line": 855,
                 "description": "Comment syntax type.",
                 "itemtype": "attribute",
                 "name": "syntaxtype",
    @@ -1229,7 +1284,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 822,
    +            "line": 864,
                 "description": "The map of file names to file content.",
                 "itemtype": "attribute",
                 "name": "filemap",
    @@ -1238,7 +1293,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 830,
    +            "line": 872,
                 "description": "A map of file names to directory name.  Provided in\ncase this needs to be used to reset the module name\nappropriately -- currently not used",
                 "itemtype": "attribute",
                 "name": "dirmap",
    @@ -1247,7 +1302,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 840,
    +            "line": 882,
                 "description": "The file currently being parsed",
                 "itemtype": "attribute",
                 "name": "currentfile",
    @@ -1257,7 +1312,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 861,
    +            "line": 903,
                 "description": "The main documentation block for the module itself.",
                 "itemtype": "attribute",
                 "name": "mainmodule",
    @@ -1267,7 +1322,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 897,
    +            "line": 939,
                 "description": "The module currently being parsed",
                 "itemtype": "attribute",
                 "name": "currentmodule",
    @@ -1277,7 +1332,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 956,
    +            "line": 999,
                 "description": "The submodule currently being parsed",
                 "itemtype": "attribute",
                 "name": "currentsubmodule",
    @@ -1287,7 +1342,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 996,
    +            "line": 1040,
                 "description": "The class currently being parsed",
                 "itemtype": "attribute",
                 "name": "currentclass",
    @@ -1297,7 +1352,17 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 1036,
    +            "line": 1080,
    +            "description": "The element currently being parsed",
    +            "itemtype": "attribute",
    +            "name": "currentelement",
    +            "type": "String",
    +            "class": "DocParser",
    +            "module": "yuidoc"
    +        },
    +        {
    +            "file": "lib/docparser.js",
    +            "line": 1110,
                 "description": "Takes a non-namespaced classname and resolves it to a namespace (to support `@for`)",
                 "access": "private",
                 "tagname": "",
    @@ -1319,7 +1384,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 1106,
    +            "line": 1188,
                 "description": "Normalizes the initial indentation of the given _content_ so that the first line\nis unindented, and all other lines are unindented to the same degree as the\nfirst line. So if the first line has four spaces at the beginning, then all\nlines will be unindented four spaces. Ported from [Selleck](https://github.com/rgrove/selleck)",
                 "itemtype": "method",
                 "name": "unindent",
    @@ -1341,7 +1406,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 1127,
    +            "line": 1209,
                 "description": "Transforms a JavaDoc style comment block (less the start and end of it)\ninto a list of tag/text pairs. The leading space and '*' are removed,\nbut the remaining whitespace is preserved so that the output should be\nfriendly for both markdown and html parsers.",
                 "itemtype": "method",
                 "name": "handlecomment",
    @@ -1367,7 +1432,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 1205,
    +            "line": 1287,
                 "description": "Accepts a map of filenames to file content.  Returns\na map of filenames to an array of API comment block\ntext.  This expects the comment to start with / **\non its own line, and end with * / on its own\nline.  Override this function to provide an\nalternative comment parser.",
                 "itemtype": "method",
                 "name": "extract",
    @@ -1392,7 +1457,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 1260,
    +            "line": 1342,
                 "description": "Processes all the tags in a single comment block",
                 "itemtype": "method",
                 "name": "processblock",
    @@ -1408,7 +1473,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 1333,
    +            "line": 1433,
                 "description": "Transforms a map of filenames to arrays of comment blocks into a\nJSON structure that represents the entire processed API doc info\nand relationships between elements for the entire project.",
                 "itemtype": "method",
                 "name": "transform",
    @@ -1428,7 +1493,7 @@
             },
             {
                 "file": "lib/docparser.js",
    -            "line": 1447,
    +            "line": 1562,
                 "description": "Extracts and transforms the filemap provided to constructor",
                 "itemtype": "method",
                 "name": "parse",
    diff --git a/output/api/elements/index.html b/output/api/elements/index.html
    new file mode 100644
    index 00000000..487fe15b
    --- /dev/null
    +++ b/output/api/elements/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/output/api/files/lib_builder.js.html b/output/api/files/lib_builder.js.html
    index 69f2ebc9..75b8c146 100644
    --- a/output/api/files/lib_builder.js.html
    +++ b/output/api/files/lib_builder.js.html
    @@ -17,7 +17,7 @@
                     

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + @@ -232,6 +233,7 @@

    File: lib/builder.js

    }); }); }, + /** * Wrapper around the Markdown parser so it can be normalized or even side stepped * @method markdown @@ -267,31 +269,36 @@

    File: lib/builder.js

    */ _parseCrossLink: function (item, raw, content) { var self = this; - var base = '../', + var parts, + base = '../', baseItem, newWin = false, + group = /&lt;.*(?=&gt;$)/.test(item) ? 'elements' : 'classes', className = 'crosslink'; - item = fixType(item); + if (group === 'classes') { + item = fixType(item); + } item = baseItem = Y.Lang.trim(item.replace('{', '').replace('}', '')); //Remove Cruft - item = item.replace('*', '').replace('[', '').replace(']', ''); + item = item.replace('*', '').replace('[', '').replace(']', '').replace('&lt;', '').replace('&gt;', ''); + var link = false, href; - if (self.data.classes[item]) { + if (self.data[group][item]) { link = true; } else { - if (self.data.classes[item.replace('.', '')]) { + if (self.data[group][item.replace('.', '')]) { link = true; item = item.replace('.', ''); } } if (self.options.externalData) { - if (self.data.classes[item]) { - if (self.data.classes[item].external) { - href = self.data.classes[item].path; + if (self.data[group][item]) { + if (self.data[group][item].external) { + href = self.data[group][item].path; base = self.options.externalData.base; className += ' external'; newWin = true; @@ -300,10 +307,27 @@

    File: lib/builder.js

    } } - if (item.indexOf('/') > -1) { + if (group === 'elements' && item.indexOf(' ') > -1) { + // Fragment link for an attribute is required + parts = item.split(' '); + var el = parts[0], + attr = parts[1]; + + if (el && attr) { + if (self.data.elements[el]) { + self.data.elements[el].attributes.some(function (i) { + if (i.name === attr) { + link = true; + baseItem = attr; + href = Y.webpath(base, 'elements', el + '.html#' + attr); + } + }); + } + } + } else if (item.indexOf('/') > -1) { //We have a class + method to parse - var parts = item.split('/'), - cls = parts[0], + parts = item.split('/'); + var cls = parts[0], method = parts[1], type = 'method'; @@ -338,9 +362,9 @@

    File: lib/builder.js

    link = false; } if (!href) { - href = Y.webpath(base, 'classes', item + '.html'); + href = Y.webpath(base, group, item + '.html'); if (base.match(/^https?:\/\//)) { - href = base + Y.webpath('classes', item + '.html'); + href = base + Y.webpath(group, item + '.html'); } } if (!link && self.options.linkNatives) { @@ -374,7 +398,7 @@

    File: lib/builder.js

    Y.log('External data received, mixing', 'info', 'builder'); self.options.externalData.forEach(function (exData) { - ['files', 'classes', 'modules'].forEach(function (k) { + ['files', 'elements', 'classes', 'modules'].forEach(function (k) { Y.each(exData[k], function (item, key) { item.external = true; var file = item.name; @@ -566,6 +590,28 @@

    File: lib/builder.js

    opts.meta.classes.sort(this.nameSort); return opts; }, + /** + * Populate the meta data for elements + * @method populateElements + * @param {Object} opts The original options + * @return {Object} The modified options + */ + populateElements: function (opts) { + opts.meta.elements = []; + Y.each(this.data.elements, function (v) { + if (v.external) { + return; + } + opts.meta.elements.push({ + displayName: '<' + v.name + '>', + name: v.name, + module: v.module, + description: v.description + }); + }); + opts.meta.elements.sort(this.nameSort); + return opts; + }, /** * Populate the meta data for modules * @method populateModules @@ -752,7 +798,7 @@

    File: lib/builder.js

    */ makeDirs: function (cb) { var self = this; - var dirs = ['classes', 'modules', 'files']; + var dirs = ['classes', 'elements', 'modules', 'files']; if (self.options.dumpview) { dirs.push('json'); } @@ -907,6 +953,7 @@

    File: lib/builder.js

    opts.meta.projectAssets = './assets'; opts.meta.projectLogo = self._resolveUrl(self.data.project.logo, opts); opts = self.populateClasses(opts); + opts = self.populateElements(opts); opts = self.populateModules(opts); var view = new Y.DocView(opts.meta); @@ -980,6 +1027,7 @@

    File: lib/builder.js

    opts.meta.projectAssets = '../assets'; opts.meta.projectLogo = self._resolveUrl(self.data.project.logo, opts); opts = self.populateClasses(opts); + opts = self.populateElements(opts); opts = self.populateModules(opts); opts = self.populateFiles(opts); @@ -996,6 +1044,19 @@

    File: lib/builder.js

    }); opts.meta.moduleClasses.sort(self.nameSort); } + if (data.elements && Object.keys(data.elements).length) { + opts.meta.moduleElements = []; + Y.each(Object.keys(data.elements), function (name) { + var i = self.data.elements[name]; + if (i) { + opts.meta.moduleElements.push({ + name: i.name, + displayName: i.name + }); + } + }); + opts.meta.moduleElements.sort(self.nameSort); + } if (data.example && data.example.length) { if (data.example.forEach) { var e = ''; @@ -1188,6 +1249,7 @@

    File: lib/builder.js

    opts.meta.projectLogo = self._resolveUrl(self.data.project.logo, opts); opts = self.populateClasses(opts); + opts = self.populateElements(opts); opts = self.populateModules(opts); opts = self.populateFiles(opts); @@ -1453,13 +1515,91 @@

    File: lib/builder.js

    }); }, /** - * Generates the class files under "out"/classes/ - * @method writeClasses + * Render the element file + * @method renderElement + * @param {Function} cb The callback fired when complete + * @param {String} cb.html The HTML to render this view + * @param {Object} cb.view The View Data + */ + renderElement: function (cb, data, layout) { + var self = this; + var stack = new Y.Parallel(); + + Y.prepare([DEFAULT_THEME, themeDir], self.getProjectMeta(), function (err, opts) { + if (err) { + console.log(err); + } + opts.meta = Y.merge(opts.meta, data); + + opts.meta.title = self.data.project.name; + opts.meta.moduleName = data.name; + opts.meta.file = data.file; + opts.meta.line = data.line; + opts.meta = self.addFoundAt(opts.meta); + opts.meta.projectRoot = '../'; + opts.meta.projectAssets = '../assets'; + opts.meta.projectLogo = self._resolveUrl(self.data.project.logo, opts); + + opts = self.populateClasses(opts); + opts = self.populateElements(opts); + opts = self.populateModules(opts); + opts = self.populateFiles(opts); + + opts.meta.elementDescription = self._parseCode(self.markdown(data.description || ' ')); + + if (data.example && data.example.length) { + if (data.example.forEach) { + var e = ''; + data.example.forEach(function (v) { + e += self._parseCode(self.markdown(v)); + }); + data.example = e; + } else { + data.example = self._parseCode(self.markdown(data.example)); + } + opts.meta.example = data.example; + } + + if (!self.options.dontsortfields) { + opts.meta.attributes.sort(self.nameSort); + } + + opts.meta.attributes.forEach(function (a) { + a.description = self._parseCode(a.description); + }); + + if (!opts.meta.attributes.length) { + delete opts.meta.attributes; + } + + var view = new Y.DocView(opts.meta); + var mainLayout = opts.layouts[layout]; + self.render('{{>elements}}', view, mainLayout, opts.partials, stack.add(function (renderErr, html) { + if (renderErr) { + Y.log(renderErr, 'error', 'builder'); + cb(renderErr); + return; + } + self.files++; + stack.html = html; + stack.view = view; + stack.opts = opts; + })); + }); + + stack.done(function () { + cb(stack.html, stack.view, stack.opts); + }); + }, + /** + * Generates the class or element files under "out"/classes/ or "out"/elements/ + * @method writeComponents + * @param {String} type The component type, "classes" or "elements" * @param {Callback} cb The callback to execute after it's completed * @param {String} cb.html The HTML to write class view * @param {Object} cb.view The View Data */ - writeClasses: function (cb, layout) { + writeComponents: function (type, cb, layout) { layout = layout || 'main'; var self = this, stack = new Y.Parallel(); @@ -1467,31 +1607,31 @@

    File: lib/builder.js

    stack.view = []; var counter = 0; - Object.keys(self.data.classes).forEach(function (k) { - if (!self.data.classes[k].external) { + Object.keys(self.data[type]).forEach(function (k) { + if (!self.data[type][k].external) { counter++; } }); Y.log('Rendering and writing ' + counter + ' class pages.', 'info', 'builder'); - Y.each(self.data.classes, function (v) { + Y.each(self.data[type], function (v) { if (v.external) { return; } - self.renderClass(stack.add(function (html, view) { + self[type === 'classes' ? 'renderClass' : 'renderElement'](stack.add(function (html, view) { stack.html.push(html); stack.view.push(view); if (self.options.dumpview) { Y.Files.writeFile( - path.join(self.options.outdir, 'json', 'classes_' + v.name + '.json'), + path.join(self.options.outdir, 'json', type + '_' + v.name + '.json'), JSON.stringify(view), stack.add(noop) ); } - Y.Files.writeFile(path.join(self.options.outdir, 'classes', v.name + '.html'), html, stack.add(noop)); + Y.Files.writeFile(path.join(self.options.outdir, type, v.name + '.html'), html, stack.add(noop)); }), v, layout); }); stack.done(function () { - Y.log('Finished writing class files', 'info', 'builder'); + Y.log('Finished writing ' + type.replace(/e?s$/, '') + ' files', 'info', 'builder'); cb(stack.html, stack.view); }); }, @@ -1654,8 +1794,9 @@

    File: lib/builder.js

    }; opts = this.populateClasses(opts); opts = this.populateModules(opts); + opts = this.populateElements(opts); - ['classes', 'modules'].forEach(function (id) { + ['classes', 'modules', 'elements'].forEach(function (id) { opts.meta[id].forEach(function (v, k) { opts.meta[id][k] = v.name; if (v.submodules) { @@ -1712,7 +1853,12 @@

    File: lib/builder.js

    var cstack = new Y.Parallel(); self.writeModules(cstack.add(function () { - self.writeClasses(cstack.add(function () { + self.writeComponents('classes', cstack.add(function () { + if (!self.options.nocode) { + self.writeFiles(cstack.add(noop)); + } + })); + self.writeComponents('elements', cstack.add(function () { if (!self.options.nocode) { self.writeFiles(cstack.add(noop)); } diff --git a/output/api/files/lib_cli.js.html b/output/api/files/lib_cli.js.html index 6eec3c9b..1859f1d5 100644 --- a/output/api/files/lib_cli.js.html +++ b/output/api/files/lib_cli.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/files/lib_docparser.js.html b/output/api/files/lib_docparser.js.html index ecca42e3..f4262f57 100644 --- a/output/api/files/lib_docparser.js.html +++ b/output/api/files/lib_docparser.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + @@ -155,6 +156,7 @@

    File: lib/docparser.js

    CURRENT_SUBMODULE = 'currentsubmodule', CURRENT_FILE = 'currentfile', CURRENT_CLASS = 'currentclass', + CURRENT_ELEMENT = 'currentelement', REGEX_TYPE = /(.*?)\{(.*?)\}(.*)/, REGEX_FIRSTWORD = /^\s*?(\[.+\]\*?|[^\s]+)(.*)/, @@ -197,7 +199,7 @@

    File: lib/docparser.js

    TAGLIST = [ 'async', // bool, custom events can fire the listeners in a setTimeout 'author', // author best for projects and modules, but can be used anywhere // multi - 'attribute', // YUI attributes -- get/set with change notification, etc + 'attribute', // YUI attributes / custom element attributes 'beta', // module maturity identifier 'broadcast', // bool, events 'bubbles', // custom events that bubble @@ -209,11 +211,13 @@

    File: lib/docparser.js

    'const', // not standardized yet, converts to final property 'constructs', // factory methods (not yet used) 'constructor', // this is a constructor + 'content', // permitted content for an @element 'contributor', // like author 'default', // property/attribute default value 'deprecated', // please specify what to use instead 'description', // can also be free text at the beginning of a comment is 'emitfacade', // bool, YUI custom event can have a dom-like event facade + 'element', // Web Components custom element 'event', // YUI custom event 'evil', // uses eval 'extension', // this is an extension for [entity] @@ -232,7 +236,7 @@

    File: lib/docparser.js

    'in', // indicates module this lives in (obsolete now) 'initonly', // attribute writeonce value 'injects', // injects {HTML|script|CSS} - 'interface', // Is Interface + 'interface', // Is Interface / Interface for an @element 'knownissue', // 0..n known issues for your consumption 'line', // line number for the comment block (used by the parser) 'method', // a method @@ -242,6 +246,7 @@

    File: lib/docparser.js

    'optional', // For optional attributes 'required', // For required attributes 'param', // member param + 'parents', // permitted parents for an @element 'plugin', // this is a plugin for [entityl] 'preventable', // YUI custom events can be preventable ala DOM events 'private', // > access @@ -632,6 +637,27 @@

    File: lib/docparser.js

    return host; }, + // A key bock type for declaring custom elements + 'element': function (tagname, value) { + var name, parent, host; + + name = value.split(/\s+/)[0]; + this.set(CURRENT_ELEMENT, name); + host = this.elements[name]; + + parent = this.get(CURRENT_MODULE); + if (parent) { + host.module = parent; + } + + parent = this.get(CURRENT_SUBMODULE); + if (parent) { + host.submodule = parent; + } + + return host; + }, + // change 'const' to final property 'const': function (tagname, value, target) { target.itemtype = 'property'; @@ -669,10 +695,27 @@

    File: lib/docparser.js

    } }, 'method': 'property', - 'attribute': 'property', 'config': 'property', 'event': 'property', + 'attribute': function (tagname, value, target) { + // Use 'property' if not currently parsing an element + if (!this.get(CURRENT_ELEMENT)) { + return DIGESTERS.property.apply(this, arguments); + } + + var nameVal = value.split(/\s+([\s\S]*$)/), + desc = nameVal[1] || target.description || ''; + + if (!target.attributes) { + target.attributes = []; + } + target.attributes.push({ + name: nameVal[0], + description: desc + }); + }, + // access fields 'public': function (tagname, value, target) { target.access = tagname; @@ -1035,6 +1078,7 @@

    File: lib/docparser.js

    this.modules[val] = { name: val, submodules: {}, + elements: {}, classes: {}, fors: {}, namespaces: {} @@ -1060,6 +1104,7 @@

    File: lib/docparser.js

    var mod = this.modules[val] = { name: val, submodules: {}, + elements: {}, classes: {}, fors: {}, is_submodule: 1, @@ -1121,6 +1166,36 @@

    File: lib/docparser.js

    } return name; } + }, + lastelement: { + + }, + /** + * The element currently being parsed + * @attribute currentelement + * @type String + */ + currentelement: { + setter: function (val) { + if (!val) { + return val; + } + this.set('lastelement', this.get(CURRENT_ELEMENT)); + val = trim(val); + var name = val, + el; + if (!(val in this.elements)) { + el = this.elements[name] = { + name: name, + attributes: [] + }; + el.module = this.get(CURRENT_MODULE); + if (this.get(CURRENT_SUBMODULE)) { + el.submodule = this.get(CURRENT_SUBMODULE); + } + } + return name; + } } }; @@ -1157,30 +1232,38 @@

    File: lib/docparser.js

    */ self.set(CURRENT_SUBMODULE, ''); self.set(CURRENT_CLASS, ''); + self.set(CURRENT_ELEMENT, ''); }); self.after('currentmoduleChange', function (e) { var mod = e.newVal, - classes = self.classes; - Y.each(classes, function (clazz) { - if (!(clazz.module)) { - clazz.module = mod; - } - }); + elements = self.elements, + classes = self.classes, + addModule = function (c) { + if (!(c.module)) { + c.module = mod; + } + }; + + Y.each(classes, addModule); + Y.each(elements, addModule); }); self.after('currentsubmoduleChange', function (e) { var mod = e.newVal, - classes = self.classes; - - if (mod) { - Y.each(classes, function (clazz) { - if (!(clazz.submodule)) { - if (!clazz.module) { - clazz.submodule = mod; + classes = self.classes, + elements = self.elements, + addModule = function (c) { + if (!(c.submodule)) { + if (!c.module) { + c.submodule = mod; } } - }); + }; + + if (mod) { + Y.each(classes, addModule); + Y.each(elements, addModule); } }); @@ -1405,6 +1488,24 @@

    File: lib/docparser.js

    if (host) { Y.mix(host, target); + + if (host.attributes && target.attributes) { + host.attributes.push.apply(host.attributes, target.attributes); + } + } else if (target.attributes) { + host = this.elements[this.get(CURRENT_ELEMENT)]; + if (host) { + if (target.deprecated) { + target.attributes.forEach(function (a) { + a.deprecated = target.deprecated; + + if (target.deprecationMessage) { + a.deprecationMessage = target.deprecationMessage; + } + }); + } + host.attributes.push.apply(host.attributes, target.attributes); + } } else { this.classitems.push(target); target.class = this.get(CURRENT_CLASS); @@ -1436,6 +1537,7 @@

    File: lib/docparser.js

    files = self.files = {}, modules = self.modules = {}, classes = self.classes = {}, + elements = self.elements = {}, classitems = self.classitems = []; self.data = { @@ -1443,6 +1545,7 @@

    File: lib/docparser.js

    files: files, modules: modules, classes: classes, + elements: elements, classitems: classitems }; @@ -1506,6 +1609,19 @@

    File: lib/docparser.js

    } }); + Y.each(elements, function (el, name) { + if (el.module) { + modules[el.module].elements[name] = 1; + } + + if (el.submodule) { + modules[el.submodule].elements[name] = 1; + if (!modules[el.submodule].description) { + modules[el.submodule].description = el.description; + } + } + }); + Y.each(classitems, function (v) { if (!v.itemtype) { self.warnings.push({ diff --git a/output/api/files/lib_docview.js.html b/output/api/files/lib_docview.js.html index c59d3367..92ac4a9b 100644 --- a/output/api/files/lib_docview.js.html +++ b/output/api/files/lib_docview.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/files/lib_files.js.html b/output/api/files/lib_files.js.html index 73f29c55..0a757ba2 100644 --- a/output/api/files/lib_files.js.html +++ b/output/api/files/lib_files.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/files/lib_help.js.html b/output/api/files/lib_help.js.html index 2ee81219..54aea04d 100644 --- a/output/api/files/lib_help.js.html +++ b/output/api/files/lib_help.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/files/lib_index.js.html b/output/api/files/lib_index.js.html index a7b67b9a..0d11d567 100644 --- a/output/api/files/lib_index.js.html +++ b/output/api/files/lib_index.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/files/lib_options.js.html b/output/api/files/lib_options.js.html index 922c36ee..47ef4aa7 100644 --- a/output/api/files/lib_options.js.html +++ b/output/api/files/lib_options.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/files/lib_project.js.html b/output/api/files/lib_project.js.html index ec8e2f6a..a0aadea2 100644 --- a/output/api/files/lib_project.js.html +++ b/output/api/files/lib_project.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/files/lib_server.js.html b/output/api/files/lib_server.js.html index 23e186ba..1a2f66ce 100644 --- a/output/api/files/lib_server.js.html +++ b/output/api/files/lib_server.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/files/lib_utils.js.html b/output/api/files/lib_utils.js.html index e74f406a..2efdce20 100644 --- a/output/api/files/lib_utils.js.html +++ b/output/api/files/lib_utils.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/files/lib_yuidoc.js.html b/output/api/files/lib_yuidoc.js.html index df6fe9a7..fea126ce 100644 --- a/output/api/files/lib_yuidoc.js.html +++ b/output/api/files/lib_yuidoc.js.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/index.html b/output/api/index.html index 158939ac..1d978260 100644 --- a/output/api/index.html +++ b/output/api/index.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + diff --git a/output/api/modules/yuidoc.html b/output/api/modules/yuidoc.html index 3228c5ea..16945aaa 100644 --- a/output/api/modules/yuidoc.html +++ b/output/api/modules/yuidoc.html @@ -17,7 +17,7 @@

    - API Docs for: 0.8.1 + API Docs for: 0.9.0
    @@ -51,6 +51,7 @@

    APIs

  • YUIDoc
  • + @@ -173,6 +174,7 @@

    yuidoc Module

    +
    diff --git a/output/args/index.html b/output/args/index.html index ae55758d..656f1c93 100644 --- a/output/args/index.html +++ b/output/args/index.html @@ -45,7 +45,7 @@

    Running YUIDoc on the Command Line

    YUI Doc generates API documentation from a modified JavaDoc syntax.
     
    -Current version (0.8.1)
    +Current version (0.9.0)
     
     Usage: yuidoc <options> <input path>
     
    diff --git a/output/index.html b/output/index.html
    index e3630883..06f0e76f 100644
    --- a/output/index.html
    +++ b/output/index.html
    @@ -24,7 +24,7 @@ 

    -

    Welcome to YUIDoc 0.8.1!

    +

    Welcome to YUIDoc 0.9.0!

    YUIDoc is a Node.js application that @@ -146,7 +146,7 @@

    Table of Contents

    • -Welcome to YUIDoc 0.8.1! +Welcome to YUIDoc 0.9.0!
    • Installation and Usage diff --git a/output/syntax/index.html b/output/syntax/index.html index 750bc9c7..ee067203 100644 --- a/output/syntax/index.html +++ b/output/syntax/index.html @@ -161,6 +161,32 @@

      Primary Tags

      + + element + +
      /**
      + * This is the foo element description...
      + *
      + * @element x-foo
      + */
      + + + +

      Indicates that the block describes a Custom Element. + The @attribute tag works as a attribute of the element + when you specify a @element tag. You can also specify the + @parents, @contents, + and @interface tag for the element.

      + +

      + See also: + @attribute, + @parents, + @contents, + @interface. +

      + + method @@ -290,8 +316,11 @@

      Primary Tags

      YUI will automatically generate documentation for the attribute's change events throughout the source tree, with no extra YUIDoc comments needed from you.

      +

      If you specify a @element tag, the @attribute tag works as + a attribute of the element.

      +

      - See also: + See also: @element, @property, @default, @class, @@ -1101,6 +1130,72 @@

      Secondary tags

      + + parents + +
      /**
      + * @element x-foo
      + * @parents <body>
      + */
      + + + +

      It's a secondary tag for the @element tag. + Indicates that the parent element of the element you specified.

      + +

      + See also: + @element, + @attribute, + @contents, + @interface. +

      + + + + contents + +
      /**
      + * @element x-foo
      + * @contents <x-bar>
      + */
      + + + +

      It's a secondary tag for the @element tag. + Indicates that the element contains in the element you specified.

      + +

      + See also: + @element, + @attribute, + @parents, + @interface. +

      + + + + interface + +
      /**
      + * @element x-foo
      + * @interface XFooElement
      + */
      + + + +

      It's a secondary tag for the @element tag. + Indicates that the interface for the element you specified.

      + +

      + See also: + @element, + @attribute, + @parents, + @contents. +

      + +

      A * indicates that you can supply multiple tags of that type in the same block.