简体   繁体   English

JsDoc 呈现整个代码而不是注释块

[英]JsDoc renders whole code instead of commented block

Hey there hope everybody is doing allright so i got the following problem I have a VUE.JS application and we need to documentate it , for .VUE components we decided to go with Vuese but the problem comes for regular JS files such as modules , etc etc we decided to use JsDoc I installed it and everything is allright but when i generate the HTML files of JsDoc it Renders the WHOLE code and not my commented line嘿,希望每个人都做得很好,所以我遇到了以下问题我有一个 VUE.JS 应用程序,我们需要记录它,对于 .VUE 组件,我们决定使用 Vuese,但问题出在常规 JS 文件,例如模块等等我们决定使用 JsDoc 我安装了它,一切都很好,但是当我生成 JsDoc 的 HTML 文件时,它呈现整个代码而不是我的注释行

here's an example这是一个例子

/** This is a description of the foo function. */
    function myfunction() {
  alert('hello world');
}
console.log(myfunction);



and i get this

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: test.js</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: test.js</h1>

    



 <section>
        <article>
            <pre class="prettyprint source linenums"><code>/** This is a description of the foo function */
function myfunction() {
  alert('hello world');
}
console.log(myfunction);
</code></pre>
        </article>
    </section>

    
    
    
</div>

    <nav>
    <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#myfunction">myfunction</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.7</a> on Thu Jun 24 2021 14:28:24 GMT-0300 (hora estándar de Argentina)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>


what could it be ? or what i am doing wrong , thanks you in advance

notes : i installed JsDoc global and i tried both using my jsdocrc.json and using it alone with the command jsdoc -(PathOfMyJsFile)笔记:我安装了 JsDoc global,我尝试使用我的 jsdocrc.json 和单独使用它的命令 jsdoc -(PathOfMyJsFile)

TLTR : Basically it is rendering whole code instead of my JsDoc comment TLTR:基本上它是渲染整个代码而不是我的 JsDoc 注释

As evolutionxbox said the format is wrong ,double check the jsdoc documentation正如evolutionxbox所说的格式错误,请仔细检查jsdoc文档

https://jsdoc.app/tags-description.html https://jsdoc.app/tags-description.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM