@@ -12,73 +12,83 @@ The Synapse Wiki models include:
12
12
- ** WikiHistorySnapshot** : Provides access to wiki version history
13
13
- ** WikiOrderHint** : Manages the order of wiki pages within an entity
14
14
15
+ This tutorial shows how to:
16
+ 1 . Create, read, and update wiki pages
17
+ 2 . Work with WikiPage Markdown
18
+ 3 . Work with WikiPage Attachments
19
+ 4 . Work with WikiHeader
20
+ 5 . Work with WikiHistorySnapshot
21
+ 6 . Work with WikiOrderHint
22
+ 7 . Delete wiki pages
23
+
15
24
## Basic Setup
16
25
``` python
17
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=13 - 28 }
26
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=14 - 29 }
18
27
```
19
28
20
29
## 1. Create, read, and update wiki pages
21
30
### Create a new wiki page for the project with plain text markdown
22
31
``` python
23
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=32 - 36 }
32
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=33 - 37 }
24
33
```
25
34
26
35
### OR you can create a wiki page with an existing markdown file
27
36
``` python
28
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=39 - 44 }
37
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=40 - 45 }
29
38
```
30
39
31
40
### Create a new wiki page with updated content
32
41
``` python
33
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=47 - 52 }
42
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=48 - 53 }
34
43
```
35
44
36
45
### Restore the wiki page to the original version
37
46
``` python
38
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=55 - 63 }
47
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=56 - 64 }
39
48
```
40
49
41
50
### Create a sub-wiki page
42
51
``` python
43
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=66 - 71 }
52
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=67 - 72 }
44
53
```
45
54
46
55
### Get an existing wiki page for the project, now you can see one root wiki page and one sub-wiki page
47
56
``` python
48
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=74 - 75 }
57
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=75 - 76 }
49
58
```
50
59
51
60
### Retrieving a Wiki Page
52
61
Note: You need to know the wiki page ID or wiki page title to retrieve it
53
62
#### Retrieve a Wiki Page with wiki page ID
54
63
``` python
55
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=78 - 79 }
64
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=79 - 80 }
56
65
```
57
66
58
67
#### Retrieve a Wiki Page with wiki page title
59
68
``` python
60
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=82 - 83 }
69
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=83 - 84 }
61
70
```
62
71
63
72
#### Check if the retrieved wiki page is the same as the original wiki page
64
73
``` python
65
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=86 - 91 }
74
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=87 - 92 }
66
75
```
67
76
68
77
## 2. WikiPage Markdown Operations
69
78
### Create wiki page from markdown text
70
79
``` python
71
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=95 - 118 }
80
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=96 - 119 }
72
81
```
73
82
74
- ### Create wiki page from a markdown file
83
+ ### Create wiki page from a markdown file
75
84
``` python
76
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=122 - 132 }
85
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=123 - 133 }
77
86
```
78
87
79
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.
80
90
``` python
81
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=136 - 143 }
91
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=137 - 143 }
82
92
```
83
93
84
94
## 3. WikiPage Attachments Operations
@@ -92,7 +102,7 @@ Note: You need to know the wiki page ID or wiki page title to retrieve it
92
102
```
93
103
### Download an attachment
94
104
``` python
95
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=168 - 175 }
105
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=167 - 175 }
96
106
```
97
107
98
108
### Get attachment URL without downloading
@@ -117,7 +127,7 @@ Note: You need to know the wiki page ID or wiki page title to retrieve it
117
127
118
128
### Accessing Wiki History
119
129
``` python
120
- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=203 - 207 }
130
+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=204 - 208 }
121
131
```
122
132
123
133
## 6. WikiOrderHint - Managing Wiki Order
0 commit comments