0%

html转Docset

软件使用

  • 安装Python

    macOS自带python,这里就不需要再安装了。

  • 安装beautifulsoup4.3.2

    下载地址

    https://pypi.python.org/pypi/beautifulsoup4/4.3.2

    解压下载好的beautifulsoup4-4.3.2.tar.gz
    然后终端进入beautifulsoup4-4.3.2文件夹
    执行安装命令:

      sudo python setup.py install
    
  • 下载html2Dash

    下载地址

    https://github.com/xuelangZF/html2Dash#fork-destination-box

  • html转Docset

    • 材料清单

      准备好的需要转为docset的网页(需要有一个名为index.html的网页)
      html2Dash工具

    • 转换命令

      ./html2dash.py /Users/ux/0_API/linux

      注: /Users/ux/0_API/linux 是需要转换为docset的网页的文件夹路径

    • 作者原文档

        The full usage is:
      
            $ doc2dash [OPTIONS] SOURCE  
        
        The `SOURCE` is a directory containing the HTML documents you would like to convert.
        
        Valid `OPTIONS` are the following:
        
        * -n, --name  
        
            Name the docset explicitly instead of letting doc2dash guess the correct name from the directory name of the source.
        
        * -d PATH, --destination PATH  
        
            Put the resulting docset into PATH. Default is the directory `~/Library/Application Support/html2dash/DocSets` 
        
        * -i FILENAME, --icon FILENAME
        
            Add PNG icon FILENAME to docset that is used within Dash.app to represent the docset.
            
        * -p INDEX_PAGE, --index-page INDEX_PAGE
            
            Set the file that is shown when the docset is clicked within Dash.app.
            
        * -h, --help
        
            Show a brief usage summary and exit.
        
        DEPENDENCIES:  
            
        * BeautifulSoup HTML parsing library
      

参考链接