duanke6057 2018-03-18 19:55
浏览 110
已采纳

如何使用godoc为文件夹中的所有软件包生成HTML文档

godoc -html generates documents for only one package. However, I want to ship the project with all documents for all packages, just like when I run godoc -http. With that, I could find all packages and navigate through them from the browser.

Is it possible to generate HTML pages for all packages linked together through godoc -html?

  • 写回答

1条回答 默认 最新

  • dongrendang6566 2018-08-09 13:00
    关注

    You have two questions here:

    Is it possible to generate HTML pages for all packages linked together through godoc -html?

    No. Because it is not implemented into godoc (https://godoc.org/golang.org/x/tools/cmd/godoc).

    The other question:

    How can I generate HTML documents for all packages inside a folder using godoc

    I think the simplest way is to start godoc with the http flag: godoc -http=:6060

    Then you navigate to the folder you want to get the docs. For that url you can use a webcrawler for getting the html documentation. There are already some crawler in Go (https://godoc.org/?q=crawler), if you don't want to write a crawler by your own.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?