我正在尝试使用JSDoc(3)来记录Javascript文件,如下所示:
/** 1 if gnome-bluetooth is available, 0 otherwise
* @type {boolean}
* @const
*/
const HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
Run Code Online (Sandbox Code Playgroud)
现在文件(被叫config.js.in)不是自己的有效Javascript; 该文件通过Makefile运行,该文件替换适当的值@HAVE_BLUETOOTH@.
当我尝试在这上面运行JSdoc时,由于文件中的语法错误,它(可以理解)很糟糕.
有没有办法告诉JSDoc忽略此文件中的所有代码,只是考虑到注释?(我可能需要为@name每个doclet 添加标签,以便将文档与代码完全分开;这很好).
就像是:
/** 1 if gnome-bluetooth is available, 0 otherwise
* @name HAVE_BLUETOOTH
* @type {boolean}
* @const
*/
/** @ignore */ // somehow ignore from here onwards
const HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
/** !@ignore */ // somehow don't ignore from here onwards (although I'd be happy
// to …Run Code Online (Sandbox Code Playgroud) jsdoc ×1