Skip to content

Commit ad298b4

Browse files
committed
add wechat minapp docset
1 parent e7c30f5 commit ad298b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+97
-25094
lines changed

README.md

Lines changed: 97 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,91 @@
1+
# 关于
2+
3+
生成 Dash 格式的微信小程序的离线文档。
4+
5+
# 直接使用
6+
7+
下载我编译好的 minapp.docset ,添加到 Dash 里即可。如果你不知道 Dash 是什么,去了解一下绝对赚到。在 Linux/Windows 下也有相应的替代品。在此不赘述。
8+
9+
# 自己生成微信小程序离线文档
10+
11+
## 下载微信小程序文档
12+
13+
我们使用 wget 把微信小程序的开发文档全部下载下来。
14+
15+
```shell
16+
$ mkdir -p ~/temp/wxadoc
17+
$ cd ~/temp/wxadoc
18+
$ wget -r -p -k -np https://mp.weixin.qq.com/debug/wxadoc/dev/
19+
```
20+
21+
成功下载后的目录树大概长这样子:
22+
23+
```shell
24+
$ tree -L 2
25+
.
26+
├── dev
27+
│   ├── api
28+
│   ├── component
29+
│   ├── demo
30+
│   ├── demo.html
31+
│   ├── demo.html?t=2017117.html
32+
│   ├── devtools
33+
│   ├── framework
34+
│   ├── image
35+
│   ├── index.html
36+
│   ├── index.html?t=2017117.html
37+
│   ├── index.html?t=2017119.html
38+
│   ├── qa.html
39+
│   └── qa.html?t=2017117.html
40+
└── gitbook
41+
├── fonts
42+
├── gitbook-plugin-highlight
43+
├── gitbook-plugin-lunr
44+
├── gitbook-plugin-search
45+
├── gitbook.js?t=2017117
46+
├── gitbook.js?t=2017119
47+
├── images
48+
├── style.css?t=2017117.css
49+
├── style.css?t=2017119.css
50+
├── theme.js?t=2017117
51+
└── theme.js?t=2017119
52+
53+
13 directories, 13 files
54+
```
55+
56+
## 转换成 Dash 格式的 docset
57+
58+
```shell
59+
$ python html2dash.py -n minapp -d ./ -i ~/temp/wxadoc/mp.weixin.qq.com/debug/wxadoc/gitbook/images/icon_note_logo@2x.png -p dev/framework/MINA.html ~/temp/wxadoc/mp.weixin.qq.com/debug/wxadoc
60+
61+
Create the Docset Folder!
62+
Copy the HTML Documentation!
63+
Create the SQLite Index
64+
Create the Info.plist File
65+
Create the Icon for the Docset!
66+
Generate Docset Successfully!
67+
```
68+
69+
运行之前需要安装 Python,另外还需要安装 beautifulsoap4。
70+
71+
```shell
72+
$ pip install beautifulsoup4==4.3.2
73+
```
74+
75+
运行成功后,会在当前目录生成 minapp.docset 目录。直接导入 Dash 即可使用。
76+
77+
-------------------------------------------------------------------------------
78+
Below is original document.
79+
/-------------------------------------------------------------------------------
80+
181
# html2Dash
282

383
html2Dash is an Documentation Set generator intended to be used with the [Dash.app](http://kapeli.com/dash/) API browser for OS X or one of its many clones. html2Dash is just like [doc2dash](https://github.com/hynek/doc2dash) but generating docset from any HTML documentations.
484

585
If you’ve never heard of Dash.app, you’re missing out: together with html2Dash it’s all your API documentation at your fingertips!
686

787
Third part library required:
8-
88+
989
beautifulsoup4==4.3.2
1090

1191
It’s tested on Python 2.7, OS X 10.9.
@@ -22,46 +102,46 @@ html2dash will create a new directory called `<htmldir>.docset` in `~/Library/Ap
22102

23103
The full usage is:
24104

25-
$ doc2dash [OPTIONS] SOURCE
105+
$ doc2dash [OPTIONS] SOURCE
26106

27107
The `SOURCE` is a directory containing the HTML documents you would like to convert.
28108

29109
Valid `OPTIONS` are the following:
30110

31-
* -n, --name
111+
* -n, --name
32112

33113
Name the docset explicitly instead of letting doc2dash guess the correct name from the directory name of the source.
34114

35-
* -d PATH, --destination PATH
115+
* -d PATH, --destination PATH
36116

37-
Put the resulting docset into PATH. Default is the directory `~/Library/Application Support/html2dash/DocSets`
117+
Put the resulting docset into PATH. Default is the directory `~/Library/Application Support/html2dash/DocSets`
38118

39119
* -i FILENAME, --icon FILENAME
40120

41121
Add PNG icon FILENAME to docset that is used within Dash.app to represent the docset.
42-
122+
43123
* -p INDEX_PAGE, --index-page INDEX_PAGE
44-
124+
45125
Set the file that is shown when the docset is clicked within Dash.app.
46-
126+
47127
* -h, --help
48128

49129
Show a brief usage summary and exit.
50130

51-
DEPENDENCIES:
52-
131+
DEPENDENCIES:
132+
53133
* BeautifulSoup HTML parsing library
54134

55135
# Demo
56136

57137
Generate the Docset for requests: `requests.docset`. Command:
58138

59-
$ ./html2dash.py -n requests -i ~/Documents/requests-sidebar.png ~/Documents/requests
60-
Create the Docset Folder!
61-
Copy the HTML Documentation!
62-
Create the SQLite Index
63-
Create the Info.plist File
64-
Create the Icon for the Docset!
65-
Generate Docset Successfully!
139+
$ ./html2dash.py -n requests -i ~/Documents/requests-sidebar.png ~/Documents/requests
140+
Create the Docset Folder!
141+
Copy the HTML Documentation!
142+
Create the SQLite Index
143+
Create the Info.plist File
144+
Create the Icon for the Docset!
145+
Generate Docset Successfully!
66146

67147

Binary file not shown.

0 commit comments

Comments
 (0)