Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions navigation/plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,11 @@ Packages:
up: status/README.md
up_label: Package status
menu_changes:
- pages:
- README.md
label: Start
target: '#quick-start'
remove: true
- pages:
- docs/installation/debian.md
- docs/installation/ubuntu.md
Expand Down
11 changes: 11 additions & 0 deletions tests/test_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ def test_control_repository_uses_declared_navigation(self):
self.assertIn('One physical prose paragraph.', guide)
self.assertEqual(page_headers(repo, check=True), [])

def test_packages_root_removes_start_button(self):
repo = self.fixture('Packages')
root = repo / 'README.md'
root.write_text(root.read_text() + '\n<a href="#quick-start"><img src="docs/media/menu/start.svg" alt="Start"></a>\n')
(repo / 'docs/media/menu/start.svg').write_text(_menu_svg('Start', 160))
page_headers(repo)
self.assertNotIn('href="#quick-start"', root.read_text())
self.assertNotIn('alt="Start"', root.read_text())
self.assertIn('href="docs/README.md#page-overview"', root.read_text())
self.assertEqual(page_headers(repo, check=True), [])

def test_plan_chains_and_label_limit(self):
validate_plan(self.plan)
invalid = copy.deepcopy(self.plan)
Expand Down
2 changes: 1 addition & 1 deletion tools/snodec_sync/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def validate_plan(plan):
seen.add(path)
path = active[path]['up']
for change in config.get('menu_changes', []):
if any(p not in active for p in change['pages']):
if any(p != 'README.md' and p not in active for p in change['pages']):
raise ValueError(f'{name}: menu change references an undeclared page')


Expand Down