• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

我可以让JsDoc3忽略其中包含日期的<footer>标签吗?(Can I cause JsDoc3 to omit the ...

原作者: [db:作者] 来自: 网络 收藏 邀请

我可以让JsDoc3忽略其中包含日期的
标签吗?(Can I cause JsDoc3 to omit the
tag with the date in it?)

JSDoc在每个页面的页脚中输出一个日期:

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0</a> on Fri Jan 17 2014 14:30:54 GMT-0800 (PST)
</footer>

所以,无论何时重建我的库,所有文档文件看起来都像是已经更改为Git。 这是不可取的 - 我只想在实际上改变内容时提交这些文档。

我可以让JsDoc 根本不输出这个页脚吗?


JSDoc outputs a date in the footer of each page:

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0</a> on Fri Jan 17 2014 14:30:54 GMT-0800 (PST)
</footer>

So whenever I rebuild my library, all the documentation files look like they've changed to Git. That's not desirable -- I only want to commit these docs when they actually change in content.

Can I cause JsDoc to not output this footer at all?


原文:https://stackoverflow.com/questions/21197492
更新时间:2022-03-21 21:03

最满意答案

我有一些创建jsdoc 3模板的经验,我已经看过代码来检查你在问什么。 这是我发现的:

  • <footer>在默认模板的layout.tmpl文件中被硬编码。 通过硬编码,我的意思是元素本身不是可选的。

  • 我还没有看到默认模板的publish.js文件中的任何代码在处理layout.tmpl时会以某种方式删除<footer>

因此,要删除此页脚,您必须使用自定义模板或对由jsdoc 3生成的文件执行某种后处理。

对于3.3.0之前的版本,从模板中删除<footer>将意味着复制整个默认模板并对layout.tmpl进行更改。 目前版本为3.3.0的版本将提供基本告诉jsdoc 3使用默认模板但具有不同layout.tmpl文件的layout.tmpl ,这将使定制模板更容易。


I have some modest experience with creating jsdoc 3 templates and I've looked at the code to check what you are asking. Here is what I found:

  • <footer> is hardcoded in the default template's layout.tmpl file. By hardcoded, I mean the element itself is not optional.

  • I've not seen any code in the default template's publish.js file that would somehow remove <footer> when processing layout.tmpl.

So to remove this footer you'd have to use a customized template or do some sort of post-processing on the files generated by jsdoc 3.

With versions prior to 3.3.0, removing <footer> from the template would mean copying the whole default template and making the change to layout.tmpl. Version 3.3.0, which is currently in alpha, will provide the possibility to basically tell jsdoc 3 to use the default template but with a different layout.tmpl file, which will make customizing templates much easier.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap