不要怂,就是干,撸起袖子干!

output.md.ejs 3.34 KB
<? docfiles.forEach(function(doc) { ?>
  <? doc.javadoc.forEach(function(comment) { ?>
    <? if (comment.name) { ?>
      <? if (!comment.ignore) { ?>
        <a name="<?= comment.name ?>" />
        <? if (comment.isConstructor) { ?>
            ### `new <?= comment.name ?>(<?= comment.paramStr ?>)`
         <? } else if (comment.isMixin) { ?>
            ### Mixin <?= comment.name ?>
          <? } else if (comment.isClass) { ?>
            ### Class <?= comment.name ?>
         <? } else if (comment.isMethod || comment.isFunction) { ?>
            #### `<?= comment.name ?>(<?= comment.paramStr ?>)`
          <? } else { ?>
            #### `<?= comment.name ?>`
          <? } ?>
        <? } ?>

        <?= comment.description ?>

        <? if (comment.mixes.length) { ?>
          ### Mixes:
          <? comment.mixes.forEach(function (mix) { mix = mix.string ?>
            <? if (mix.indexOf('www') !== -1 || mix.indexOf('http') !== -1) { -?>
              * <a href="<?= mix ?>"><?= mix ?></a>
            <? } else { -?>
              * <a href="https://github.com/sequelize/sequelize/wiki/API-Reference-<?= mix ?>"><?= mix.substring(1, mix.length -1) ?></a>
            <? } ?>
          <? }) ?>
        <? } ?>

        <? if (comment.isClass) { ?>
          ### Members:
          <? doc.members.forEach(function (member) { -?>
            <? var link = member.replace(/\(.*?\)/, '') -?>
            * <a href="#<?= link ?>"><?= member ?></a>
          <? }) -?>
        <? } ?>

        <? if (comment.deprecated) { ?>
          **Deprecated** <? if (typeof comment.deprecated === "string") { ?><?- comment.deprecated ?><? } ?>
        <? } ?>

        <? if (comment.version) { ?>
          Version: <?= comment.version ?>
        <? } ?>

        <? if (comment.see.length) { ?>See:<? } ?>
        <? comment.see.forEach(function (see) { -?>
          <? if (see.url !== false) { -?>
            <? if (see.external) { -?>
              * <a href="<?= see.url ?>"><?= see.url ?></a>
            <? } else { -?>
              * <a href="https://github.com/sequelize/sequelize/wiki/API-Reference-<?= see.url ?>"><?= see.text ?></a>
            <? } -?>
          <? } else { -?>
            * <?= see.text ?>
          <? } -?>
        <? }) -?>

      <? if (comment.paramTags.length > 0) { ?>
        ##### Params: 
        | Name | Type | Description |
        | ---- | ---- | ----------- |
        <? comment.paramTags.forEach(function(paramTag) { -?>
          | <?= paramTag.name ?> | <?= paramTag.joinedTypes ?> | <?= paramTag.description ?> |
        <? }) ?>
      <? } ?>

      <? if (comment.returnTags.length > 0) { ?>
        __Returns:__ *<?= comment.returnTags[0].joinedTypes ?>* <?= comment.returnTags[0].description ?>
      <? } ?>

      <? if (comment.aliases) { ?>
        __Aliases:__ *<?= comment.aliases ?>*
      <? } ?>
    <? } ?>
    ======
  <? }) ?>

  _This document is automatically generated based on source code comments. Please do not edit it directly, as your changes will be ignored. Please write on <a href="irc://irc.freenode.net/#sequelizejs">IRC</a>, open an issue or a create a pull request if you feel something can be improved. For help on how to write source code documentation see [JSDoc](http://usejsdoc.org) and [markdox](https://github.com/cbou/markdox)_

  _This documentation was automagically created on <?= new Date().toString() ?>_

<? }) ?>