Skip to content

Commit 9732be5

Browse files
committed
docs: Clarify Siblings block as Previous/Next navigation
- Update description: Siblings is for Previous/Next navigation, not same-level docs - Typically placed at bottom of page for sequential navigation - Perfect for tutorial series (Part 1 → Part 2 → Part 3) - Update examples to show bottom placement - Add visual layout diagram to example output
1 parent 82c71d3 commit 9732be5

5 files changed

Lines changed: 114 additions & 62 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
- Shows backlinks (documents linking to this one)
1717
- Visualizes knowledge graph connections
1818

19-
- **📄 Siblings Block**: Same-level document navigation
20-
- `siblings_block()` - Shows sibling documents
21-
- Displays documents in same folder/collection
22-
- Helps navigate series of related pages
23-
- Useful for guides and tutorials
19+
- **📄 Siblings Block**: Previous/Next document navigation
20+
- `siblings_block()` - Creates Previous/Next navigation buttons
21+
- Shows Previous and Next documents in sequence
22+
- Typically placed at the bottom of the page
23+
- Perfect for tutorial series and sequential guides
24+
- Maintains document order in branch
2425

2526
- **💻 Code Block**: Syntax-highlighted code snippets
2627
- `code_block(code, language)` - Display code with highlighting

docs-site/docs/api-reference/document-structure.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ client.replace_json_document(document_id, content)
970970

971971
### Siblings Block
972972

973-
Displays documents at the same hierarchical level.
973+
Previous/Next navigation between documents in a sequence.
974974

975975
**Structure:**
976976
```json
@@ -992,23 +992,32 @@ Displays documents at the same hierarchical level.
992992

993993
**Using Helper:**
994994
```python
995-
from vaiz import siblings_block, heading, paragraph
995+
from vaiz import siblings_block, heading, paragraph, horizontal_rule
996996

997997
content = [
998-
siblings_block(),
998+
heading(1, "Tutorial Part 2: Advanced Features"),
999+
paragraph("Main content here..."),
9991000

1000-
heading(1, "Tutorial Part 2"),
1001-
paragraph("See related parts above...")
1001+
horizontal_rule(),
1002+
1003+
# Navigation at the bottom
1004+
siblings_block() # Shows "← Part 1" and "Part 3 →"
10021005
]
10031006

10041007
client.replace_json_document(document_id, content)
10051008
```
10061009

1007-
**Useful for:**
1008-
- Tutorial series navigation
1009-
- Multi-part guides
1010-
- Documentation pages at same level
1011-
- Folder/collection browsing
1010+
**Features:**
1011+
- Shows Previous and Next documents in sequence
1012+
- Creates navigation buttons (Back/Forward)
1013+
- Typically placed at page bottom
1014+
- Maintains document order in branch
1015+
1016+
**Best for:**
1017+
- Tutorial series (Part 1 → Part 2 → Part 3)
1018+
- Multi-chapter guides
1019+
- Sequential documentation
1020+
- Step-by-step workflows
10121021

10131022
---
10141023

docs-site/docs/guides/document-structure-helpers.md

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -712,28 +712,37 @@ client.replace_json_document(document_id, content)
712712
- Related documents from the space
713713
- Knowledge graph connections
714714

715-
### Siblings Block - Same-Level Documents
715+
### Siblings Block - Previous/Next Navigation
716716

717-
Display documents at the same hierarchical level:
717+
Display Previous/Next navigation between documents in a sequence:
718718

719719
```python
720-
from vaiz import siblings_block, heading, paragraph
720+
from vaiz import siblings_block, heading, paragraph, horizontal_rule
721721

722722
content = [
723-
siblings_block(), # Shows sibling documents
723+
heading(1, "Tutorial Part 2: Advanced Features"),
724+
paragraph("Main tutorial content here..."),
724725

725-
heading(1, "Current Page"),
726-
paragraph("Sibling pages shown above...")
726+
horizontal_rule(),
727+
728+
# Navigation at the bottom
729+
siblings_block() # Shows "← Previous" and "Next →" buttons
727730
]
728731

729732
client.replace_json_document(document_id, content)
730733
```
731734

735+
**Features:**
736+
- Shows Previous and Next documents in sequence
737+
- Creates navigation buttons (Back/Forward)
738+
- Typically placed at page bottom
739+
- Perfect for linear document flows
740+
732741
**Useful for:**
733-
- Series of tutorial pages
734-
- Multi-part guides
735-
- Related documentation pages
736-
- Folder/collection navigation
742+
- Tutorial series (Part 1 → Part 2 → Part 3)
743+
- Multi-chapter guides
744+
- Documentation sequences
745+
- Step-by-step workflows
737746

738747
### Code Block - Syntax Highlighting
739748

@@ -775,22 +784,23 @@ client.replace_json_document(document_id, content)
775784

776785
### Complete Navigation Example
777786

778-
Combine all navigation blocks:
787+
Combine all navigation blocks for optimal user experience:
779788

780789
```python
781790
from vaiz import (
782791
toc_block, anchors_block, siblings_block,
783-
heading, paragraph, code_block, bullet_list
792+
heading, paragraph, code_block, bullet_list, horizontal_rule
784793
)
785794

786795
content = [
787-
# All navigation blocks at the top
796+
# Top navigation: TOC and related documents
788797
toc_block(),
789798
anchors_block(),
790-
siblings_block(),
799+
800+
horizontal_rule(),
791801

792802
# Main content
793-
heading(1, "API Documentation"),
803+
heading(1, "API Documentation - Part 2"),
794804

795805
paragraph("This guide explains how to use our API."),
796806

@@ -805,12 +815,22 @@ content = [
805815
code_block(
806816
code='client = VaizClient(api_key="...")',
807817
language="python"
808-
)
818+
),
819+
820+
horizontal_rule(),
821+
822+
# Bottom navigation: Previous/Next pages
823+
siblings_block() # Shows "← Part 1" and "Part 3 →"
809824
]
810825

811826
client.replace_json_document(document_id, content)
812827
```
813828

829+
**Navigation Layout:**
830+
- **Top**: TOC (internal navigation) + Anchors (related docs)
831+
- **Content**: Your document content
832+
- **Bottom**: Siblings (Previous/Next in sequence)
833+
814834
## Supported Elements
815835

816836
All helper functions create nodes compatible with the document editor:

examples/document_navigation_blocks.py

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Example demonstrating all document navigation blocks: TOC, Anchors, and Siblings.
33
44
This example shows how to create a document with automatic navigation features:
5-
- Table of Contents (TOC) for internal document navigation
6-
- Anchors for displaying related documents and backlinks
7-
- Siblings for showing documents at the same hierarchical level
5+
- Table of Contents (TOC) for internal document navigation (top)
6+
- Anchors for displaying related documents and backlinks (top)
7+
- Siblings for Previous/Next navigation between documents (bottom)
88
"""
99

1010
from config import get_client
@@ -31,15 +31,10 @@
3131

3232
# Create document content with all navigation blocks
3333
content = [
34-
# Automatic table of contents
34+
# Top navigation: TOC and related documents
3535
toc_block(),
36-
37-
# Related documents and backlinks
3836
anchors_block(),
3937

40-
# Sibling documents navigation
41-
siblings_block(),
42-
4338
horizontal_rule(),
4439

4540
# Main content
@@ -81,18 +76,19 @@
8176
"Related documents from the same space"
8277
),
8378

84-
heading(2, "Siblings Block - Same Level Documents"),
79+
heading(2, "Siblings Block - Previous/Next Navigation"),
8580

8681
paragraph(
8782
"The ",
8883
text("siblings_block()", code=True),
89-
" shows documents at the same hierarchical level:"
84+
" provides Previous/Next navigation between documents in a sequence:"
9085
),
9186

9287
bullet_list(
93-
"Documents in the same folder/collection",
94-
"Documents at the same level in structure",
95-
"Useful for series of related pages (guides, tutorials)"
88+
"Shows Previous and Next documents in the sequence",
89+
"Creates navigation buttons (Back/Forward)",
90+
"Typically placed at the bottom of the page",
91+
"Perfect for tutorial series and sequential guides"
9692
),
9793

9894
horizontal_rule(),
@@ -119,15 +115,23 @@
119115
heading(2, "All Navigation Blocks Together"),
120116

121117
paragraph(text(
122-
'''from vaiz import toc_block, anchors_block, siblings_block
118+
'''from vaiz import toc_block, anchors_block, siblings_block, horizontal_rule
123119
124120
content = [
121+
# Top navigation
125122
toc_block(), # Table of contents
126123
anchors_block(), # Related documents
127-
siblings_block(), # Sibling documents
128124
129-
heading(1, "Main Content"),
130-
paragraph("Your content here...")
125+
horizontal_rule(),
126+
127+
# Your content
128+
heading(1, "Tutorial Part 2"),
129+
paragraph("Main content here..."),
130+
131+
horizontal_rule(),
132+
133+
# Bottom navigation
134+
siblings_block() # Previous/Next buttons
131135
]
132136
133137
client.replace_json_document(document_id, content)''',
@@ -139,9 +143,10 @@
139143
heading(1, "Best Practices"),
140144

141145
bullet_list(
142-
"Place TOC block at the document start for better accessibility",
146+
"Place TOC and Anchors blocks at the document start for better accessibility",
147+
"Place Siblings block at the document end for Previous/Next navigation",
143148
"Use Anchors block for documentation with cross-references",
144-
"Use Siblings block for series of related pages",
149+
"Use Siblings block for tutorial series and sequential guides",
145150
"For short documents (< 3 sections), TOC may be redundant"
146151
),
147152

@@ -151,17 +156,32 @@
151156
text("mention_document()", code=True),
152157
" to create links between documents and populate the Anchors block!"
153158
),
159+
160+
horizontal_rule(),
161+
162+
# Bottom navigation - demonstrate siblings placement
163+
siblings_block(),
154164
]
155165

156166
try:
157167
response = client.replace_json_document(DOCUMENT_ID, content)
158168
print("✅ Document created successfully!")
159169
print()
160170
print("What was added:")
161-
print(" • TOC block - automatic table of contents")
162-
print(" • Anchors block - related documents and backlinks")
163-
print(" • Siblings block - same-level documents")
164-
print(" • Headings with UIDs for navigation")
171+
print(" • TOC block (top) - automatic table of contents")
172+
print(" • Anchors block (top) - related documents and backlinks")
173+
print(" • Siblings block (bottom) - Previous/Next navigation")
174+
print(" • Headings with UIDs for TOC navigation")
175+
print()
176+
print("Navigation layout:")
177+
print(" ┌─────────────────────────┐")
178+
print(" │ TOC Block │ ← Internal navigation")
179+
print(" │ Anchors Block │ ← Related docs")
180+
print(" ├─────────────────────────┤")
181+
print(" │ Content... │")
182+
print(" ├─────────────────────────┤")
183+
print(" │ Siblings Block │ ← Previous/Next")
184+
print(" └─────────────────────────┘")
165185
print()
166186
print(f"Open document in Vaiz: {DOCUMENT_ID}")
167187
print()

vaiz/helpers/document_structure.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,21 +1135,23 @@ def anchors_block() -> DocSiblingsNode:
11351135

11361136
def siblings_block() -> DocSiblingsNode:
11371137
"""
1138-
Create a Siblings block that displays sibling documents (documents at the same level).
1138+
Create a Siblings block for Previous/Next document navigation.
11391139
1140-
This block automatically shows documents that are siblings in the document hierarchy:
1141-
- Documents in the same folder/collection
1142-
- Documents at the same level in the structure
1140+
This block provides navigation between documents in the same branch/sequence:
1141+
- Shows Previous and Next documents in the sequence
1142+
- Typically placed at the bottom of the page
1143+
- Perfect for tutorial series, guides, and documentation chapters
1144+
- Creates "Back" and "Forward" navigation buttons
11431145
11441146
Returns:
11451147
DocSiblingsNode: A valid Siblings block node
11461148
11471149
Example:
11481150
>>> from vaiz import siblings_block, heading, paragraph
11491151
>>> content = [
1150-
... siblings_block(),
1151-
... heading(1, "Current Document"),
1152-
... paragraph("Sibling documents will be shown above")
1152+
... heading(1, "Tutorial Part 2"),
1153+
... paragraph("Main content here..."),
1154+
... siblings_block() # Navigation at the bottom
11531155
... ]
11541156
>>> client.replace_json_document(document_id, content)
11551157
"""

0 commit comments

Comments
 (0)