@@ -23,130 +23,135 @@ This tutorial shows how to:
23
23
24
24
## Basic Setup
25
25
``` python
26
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=14 - 29 }
26
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=14 - 36 }
27
27
```
28
28
29
29
## 1. Create, read, and update wiki pages
30
30
### Create a new wiki page for the project with plain text markdown
31
31
``` python
32
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=33 - 37 }
32
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=40 - 44 }
33
33
```
34
34
35
- ### OR you can create a wiki page with an existing markdown file
35
+ ### OR you can create a wiki page with an existing markdown file. More instructions can be found in section 2.
36
36
``` python
37
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=40 - 45 }
37
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=47 - 52 }
38
38
```
39
39
40
40
### Create a new wiki page with updated content
41
41
``` python
42
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=48 - 53 }
42
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=55 - 60 }
43
43
```
44
44
45
45
### Restore the wiki page to the original version
46
46
``` python
47
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=56 - 64 }
47
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=63 - 74 }
48
48
```
49
49
50
50
### Create a sub-wiki page
51
51
``` python
52
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=67 - 72 }
52
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=77 - 82 }
53
53
```
54
54
55
55
### Get an existing wiki page for the project, now you can see one root wiki page and one sub-wiki page
56
56
``` python
57
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=75 - 76 }
57
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=85 - 86 }
58
58
```
59
59
60
60
### Retrieving a Wiki Page
61
61
Note: You need to know the wiki page ID or wiki page title to retrieve it
62
62
#### Retrieve a Wiki Page with wiki page ID
63
63
``` python
64
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=79 - 80 }
64
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=89 - 90 }
65
65
```
66
66
67
67
#### Retrieve a Wiki Page with wiki page title
68
68
``` python
69
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=83 - 84 }
69
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=93 - 94 }
70
70
```
71
71
72
72
#### Check if the retrieved wiki page is the same as the original wiki page
73
73
``` python
74
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=87 - 92 }
74
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=97 - 102 }
75
75
```
76
76
77
77
## 2. WikiPage Markdown Operations
78
78
### Create wiki page from markdown text
79
79
``` python
80
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=96 - 119 }
80
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=106 - 129 }
81
81
```
82
82
83
83
### Create wiki page from a markdown file
84
84
``` python
85
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=123 - 133 }
85
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=133 - 143 }
86
86
```
87
87
88
88
### Download the markdown file
89
- Note: If the markdown is generated from plain text using the client, the downloaded file will be named wiki_markdown_ <wiki_page_id >.md.gz. If it is generated from an existing markdown file, the downloaded file will retain the original filename with the .gz suffix appended.
89
+ Note: If the markdown is generated from plain text using the client, the downloaded file will be named wiki_markdown_ <wiki_page_title >.md.gz. If it is generated from an existing markdown file, the downloaded file will retain the original filename with the .gz suffix appended.
90
90
``` python
91
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=137 - 143 }
91
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=146 - 173 }
92
92
```
93
93
94
94
## 3. WikiPage Attachments Operations
95
95
### Create a wiki page with attachments
96
96
``` python
97
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=147 - 161 }
97
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=176 - 191 }
98
98
```
99
99
### Get the file handles of all attachments on this wiki page.
100
100
``` python
101
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=164 - 165 }
101
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=194 - 197 }
102
+ ```
103
+
104
+ ### Get attachment URL without downloading
105
+ ``` python
106
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=200 - 206 }
102
107
```
103
108
### Download an attachment
104
109
``` python
105
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=167 - 175 }
110
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=209 - 219 }
106
111
```
107
112
108
- ### Get attachment URL without downloading
113
+ ### Download an attachment preview URL without downloading
114
+ Download an attachment preview. Instead of using the file_name from the attachmenthandle response when isPreview=True, you should use the original file name in the get_attachment_preview request. The downloaded file will still be named according to the file_name provided in the response when isPreview=True.
109
115
``` python
110
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=178 - 182 }
116
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=223 - 229 }
111
117
```
112
118
113
- ### Download an attachment preview (WIP)
119
+ #### Download an attachment preview
114
120
``` python
115
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=185 - 191 }
121
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=232 - 240 }
116
122
```
117
- #### Get attachment preview URL without downloading (WIP)
118
-
119
123
120
124
## 4. WikiHeader - Working with Wiki Hierarchy
121
125
### Getting Wiki Header Tree
122
126
``` python
123
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=197 - 200 }
127
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=244 - 246 }
124
128
```
125
129
126
130
## 5. WikiHistorySnapshot - Version History
127
-
128
131
### Accessing Wiki History
129
132
``` python
130
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=204 - 208 }
133
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=250 - 251 }
131
134
```
132
135
133
136
## 6. WikiOrderHint - Managing Wiki Order
134
- ### Get wiki order hint (No id_list returned, same result getting from direct endpoint calls)
137
+ Note: You need to have order hint set before pulling.
138
+ ### Set the wiki order hint
135
139
``` python
136
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=212 - 213 }
140
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=255 - 266 }
137
141
```
142
+
138
143
### Update wiki order hint
139
144
``` python
140
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=216 - 222 }
145
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=269 - 278 }
141
146
```
142
147
143
148
### Deleting a Wiki Page
144
149
Note: You need to know the owner ID and wiki page ID to delete a wiki page
145
150
``` python
146
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=225 }
151
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=281 }
147
152
```
148
153
149
154
## clean up
150
155
``` python
151
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=228 }
156
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=284 }
152
157
```
0 commit comments