@@ -12,73 +12,83 @@ The Synapse Wiki models include:
1212- ** WikiHistorySnapshot** : Provides access to wiki version history
1313- ** WikiOrderHint** : Manages the order of wiki pages within an entity
1414
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+
1524## Basic Setup
1625``` python
17- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=13 - 28 }
26+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=14 - 29 }
1827```
1928
2029## 1. Create, read, and update wiki pages
2130### Create a new wiki page for the project with plain text markdown
2231``` python
23- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=32 - 36 }
32+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=33 - 37 }
2433```
2534
2635### OR you can create a wiki page with an existing markdown file
2736``` python
28- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=39 - 44 }
37+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=40 - 45 }
2938```
3039
3140### Create a new wiki page with updated content
3241``` python
33- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=47 - 52 }
42+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=48 - 53 }
3443```
3544
3645### Restore the wiki page to the original version
3746``` python
38- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=55 - 63 }
47+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=56 - 64 }
3948```
4049
4150### Create a sub-wiki page
4251``` python
43- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=66 - 71 }
52+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=67 - 72 }
4453```
4554
4655### Get an existing wiki page for the project, now you can see one root wiki page and one sub-wiki page
4756``` python
48- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=74 - 75 }
57+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=75 - 76 }
4958```
5059
5160### Retrieving a Wiki Page
5261Note: You need to know the wiki page ID or wiki page title to retrieve it
5362#### Retrieve a Wiki Page with wiki page ID
5463``` python
55- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=78 - 79 }
64+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=79 - 80 }
5665```
5766
5867#### Retrieve a Wiki Page with wiki page title
5968``` python
60- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=82 - 83 }
69+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=83 - 84 }
6170```
6271
6372#### Check if the retrieved wiki page is the same as the original wiki page
6473``` python
65- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=86 - 91 }
74+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=87 - 92 }
6675```
6776
6877## 2. WikiPage Markdown Operations
6978### Create wiki page from markdown text
7079``` python
71- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=95 - 118 }
80+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=96 - 119 }
7281```
7382
74- ### Create wiki page from a markdown file
83+ ### Create wiki page from a markdown file
7584``` python
76- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=122 - 132 }
85+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=123 - 133 }
7786```
7887
7988### 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.
8090``` python
81- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=136 - 143 }
91+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=137 - 143 }
8292```
8393
8494## 3. WikiPage Attachments Operations
@@ -92,7 +102,7 @@ Note: You need to know the wiki page ID or wiki page title to retrieve it
92102```
93103### Download an attachment
94104``` python
95- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=168 - 175 }
105+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=167 - 175 }
96106```
97107
98108### 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
117127
118128### Accessing Wiki History
119129``` python
120- {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=203 - 207 }
130+ {! docs/ tutorials/ python/ tutorial_scripts/ wiki.py! lines=204 - 208 }
121131```
122132
123133## 6. WikiOrderHint - Managing Wiki Order
0 commit comments