Skip to content

Commit e32da1b

Browse files
committed
reorder and fill in details for tutorial md
1 parent cef775b commit e32da1b

File tree

1 file changed

+37
-32
lines changed

1 file changed

+37
-32
lines changed

docs/tutorials/python/wiki.md

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,130 +23,135 @@ This tutorial shows how to:
2323

2424
## Basic Setup
2525
```python
26-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=14-29}
26+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=14-36}
2727
```
2828

2929
## 1. Create, read, and update wiki pages
3030
### Create a new wiki page for the project with plain text markdown
3131
```python
32-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=33-37}
32+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=40-44}
3333
```
3434

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.
3636
```python
37-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=40-45}
37+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=47-52}
3838
```
3939

4040
### Create a new wiki page with updated content
4141
```python
42-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=48-53}
42+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=55-60}
4343
```
4444

4545
### Restore the wiki page to the original version
4646
```python
47-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=56-64}
47+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=63-74}
4848
```
4949

5050
### Create a sub-wiki page
5151
```python
52-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=67-72}
52+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=77-82}
5353
```
5454

5555
### Get an existing wiki page for the project, now you can see one root wiki page and one sub-wiki page
5656
```python
57-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=75-76}
57+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=85-86}
5858
```
5959

6060
### Retrieving a Wiki Page
6161
Note: You need to know the wiki page ID or wiki page title to retrieve it
6262
#### Retrieve a Wiki Page with wiki page ID
6363
```python
64-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=79-80}
64+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=89-90}
6565
```
6666

6767
#### Retrieve a Wiki Page with wiki page title
6868
```python
69-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=83-84}
69+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=93-94}
7070
```
7171

7272
#### Check if the retrieved wiki page is the same as the original wiki page
7373
```python
74-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=87-92}
74+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=97-102}
7575
```
7676

7777
## 2. WikiPage Markdown Operations
7878
### Create wiki page from markdown text
7979
```python
80-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=96-119}
80+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=106-129}
8181
```
8282

8383
### Create wiki page from a markdown file
8484
```python
85-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=123-133}
85+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=133-143}
8686
```
8787

8888
### 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.
9090
```python
91-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=137-143}
91+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=146-173}
9292
```
9393

9494
## 3. WikiPage Attachments Operations
9595
### Create a wiki page with attachments
9696
```python
97-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=147-161}
97+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=176-191}
9898
```
9999
### Get the file handles of all attachments on this wiki page.
100100
```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}
102107
```
103108
### Download an attachment
104109
```python
105-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=167-175}
110+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=209-219}
106111
```
107112

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.
109115
```python
110-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=178-182}
116+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=223-229}
111117
```
112118

113-
### Download an attachment preview (WIP)
119+
#### Download an attachment preview
114120
```python
115-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=185-191}
121+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=232-240}
116122
```
117-
#### Get attachment preview URL without downloading (WIP)
118-
119123

120124
## 4. WikiHeader - Working with Wiki Hierarchy
121125
### Getting Wiki Header Tree
122126
```python
123-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=197-200}
127+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=244-246}
124128
```
125129

126130
## 5. WikiHistorySnapshot - Version History
127-
128131
### Accessing Wiki History
129132
```python
130-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=204-208}
133+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=250-251}
131134
```
132135

133136
## 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
135139
```python
136-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=212-213}
140+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=255-266}
137141
```
142+
138143
### Update wiki order hint
139144
```python
140-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=216-222}
145+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=269-278}
141146
```
142147

143148
### Deleting a Wiki Page
144149
Note: You need to know the owner ID and wiki page ID to delete a wiki page
145150
```python
146-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=225}
151+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=281}
147152
```
148153

149154
## clean up
150155
```python
151-
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=228}
156+
{!docs/tutorials/python/tutorial_scripts/wiki.py!lines=284}
152157
```

0 commit comments

Comments
 (0)