Mozilla附加SDK文档下载 [英] Mozilla Add-on SDK documentation download

查看:134
本文介绍了Mozilla附加SDK文档下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法下载加载项SDK的文档



在以前的版本中,您可以键入

  cfx docs 

浏览本地副本,但 cfx已被弃用,并且文档选项已被删除。



https://github.com/neiesc/dochub 看起来像是要走的路,但是在nodejs 0.12上失败。






不工作:




  • 最后一次使用 cfx docs 命令的提交是 97d77223 。该文档位于存储库中的markdown文件中,因此已过时。


  • 附加SDK 不包含足够的注释来生成文档。有f.ex.在 lib / sdk 中的文件中没有关于 page-mod 的信息。


  • http://devdocs.io/ 有建议导入,但它是投票中的提案。



解决方案

天真的wget方法是样式表,它的URL包含一个,可能不被wget识别。要修复


  1. 通过

    下载所有文档

      wget --continue --adjust-extension --recursive --page-requisites --convert-links --level = inf --no-parent --wait = 1'https://开发人员.mozilla.org / en-US / Add-ons / SDK'


  2. 下载样式表手动

      wget https://developer.cdn.mozilla.net/media/css/mdn-min.css?build= 0e7ce0f 


  3. 重命名

      mv mdn-min.css?build = 0e7ce0f mdn-min.css 


  4. 复制到每个子目录

     查找。 -type d -exec cp mdn-min.css {} \; 


  5. 并更改所有文件以使用本地样式表:

      find。 -fcexec sed -i的!https:\\\\\\\\\\\\,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, !mdn-min.css!g'{} \; 



Is there a way to download the documentation for the Add-on SDK?

In previous versions, you could type

cfx docs

to browse a local copy, yet cfx is deprecated and the docs option was removed even before that.

https://github.com/neiesc/dochub seems like a way to go, but fails on nodejs 0.12.


Not working:

  • The last commit with the cfx docs command is 97d77223. The documentation is in markdown files in the repository, and thus, obsolete.

  • The Add-on SDK does not contain enough comments to generate the documentation from it. There is f.ex. no info about page-mod in its files in lib/sdk.

  • http://devdocs.io/ has a proposal to import, but it is in the middle of the proposals vote-wise.

解决方案

The problem with the naive wget approach is the stylesheet, which has a URL with a ? and is probably not recognized by wget. To fix, after

  1. downloading all docs via

    wget --continue --adjust-extension --recursive --page-requisites --convert-links --level=inf --no-parent --wait=1 'https://developer.mozilla.org/en-US/Add-ons/SDK'
    

  2. download the stylesheet manually

    wget https://developer.cdn.mozilla.net/media/css/mdn-min.css?build=0e7ce0f
    

  3. rename

    mv mdn-min.css?build=0e7ce0f mdn-min.css
    

  4. copy to every sub-directory

    find . -type d -exec cp mdn-min.css {} \;
    

  5. and alter all files to use the local stylesheet:

    find . -type f -exec sed -i 's!https\:\/\/developer\.cdn\.mozilla\.net\/media\/css\/mdn-min.css!mdn-min.css!g' {} \;
    

这篇关于Mozilla附加SDK文档下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆