Skip to content

Commit 15a42bd

Browse files
committed
Fix sitemap within built-in docs
1 parent d9bb649 commit 15a42bd

10 files changed

Lines changed: 129 additions & 17 deletions

File tree

docs/internal_theme/sitemap.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
<h2>Documentation Navigation</h2>
66

7+
<!-- Navigation list -->
78
<ul>
8-
{%- for nav_item in nav %}
9-
{% include "nav.html" %}
10-
{%- endfor %}
9+
{% for nav_item in nav.items %}
10+
{% include "nav.html" %}
11+
{% endfor %}
1112
</ul>
1213

1314
{%- endblock %}

docs/src/markdown/sitemap.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
template: "sitemap.html"
3+
---

docs/theme/nav.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{%- if not nav_item.children %}
2+
<li {% if nav_item.active %}class="active"{% endif %}>
3+
<a href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
4+
</li>
5+
{%- else %}
6+
<li>
7+
{{ nav_item.title }}
8+
<ul>
9+
{%- for nav_item in nav_item.children %}
10+
{% include "nav.html" %}
11+
{%- endfor %}
12+
</ul>
13+
</li>
14+
{%- endif %}

docs/theme/sitemap.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% extends "base.html" %}
2+
3+
{%- block content %}
4+
5+
<h2>Documentation Navigation</h2>
6+
7+
<!-- Navigation list -->
8+
<ul>
9+
{% for nav_item in nav.items %}
10+
{% include "nav.html" %}
11+
{% endfor %}
12+
</ul>
13+
14+
{%- endblock %}

rummage/lib/gui/controls/webview.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ def parse_url(url):
173173
174174
Try to determine if the following is a file path or
175175
(as we will call anything else) a URL.
176+
176177
We return it slightly modified and combine the path parts.
178+
177179
We also assume if we see something like c:/ it is a Windows path.
178180
We don't bother checking if this **is** a Windows system, but
179181
'nix users really shouldn't be creating weird names like c: for their folder.
@@ -207,7 +209,7 @@ def parse_url(url):
207209
is_absolute = True
208210
elif RE_WIN_DRIVE_LETTER.match(scheme):
209211
# c:/path
210-
path = '/%s:%s' % (scheme, path.replace('\\', '/'))
212+
path = '/{}:{}'.format(scheme, path.replace('\\', '/'))
211213
scheme = 'file'
212214
netloc = ''
213215
is_absolute = True
@@ -218,7 +220,7 @@ def parse_url(url):
218220
netloc = ''
219221
is_absolute = True
220222
elif scheme != '' and netloc != '':
221-
# A non file path or strange URL
223+
# A non-file path or strange URL
222224
is_url = True
223225
elif path.startswith(('/', '\\')):
224226
# /root path
@@ -311,7 +313,7 @@ def on_navigate(self, event, obj=None):
311313
event.Veto()
312314
# 'Nix systems treat "blank" (HTML string) pages as root paths most of the time.
313315
# So if we get `file:///` that is not empty and not linking to a target, we are
314-
# Linking outside or page, but not to an external site.
316+
# Linking outside our page, but not to an external site.
315317
elif obj.content_type == HTML_STRING and not (url == 'file:///' or url.startswith('file:///#')):
316318
obj.busy = False
317319
event.Veto()

rummage/lib/gui/data/docs/.dochash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cb1732f123e18d6c121e08ad97182053
1+
2e6db8cd343c0b8582959ee0c10ed9ae

rummage/lib/gui/data/docs/about/contributing.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<div class="__toc_wrapper"><span class="__toc_icon"></span>
3232
<div class="__toc_content">
3333
<ul class="__toc_list">
34-
<li class="__toc_level_2"><a href="#contributing--support">Contributing &amp; Support</a></li>
34+
<li class="__toc_level_2"><a href="#contributing-support">Contributing &amp; Support</a></li>
3535
<ul class="__toc_list_2">
3636

3737
<li class="__toc_level_3"><a href="#overview">Overview</a></li>
@@ -70,7 +70,7 @@
7070
</ul>
7171
</div>
7272
</div>
73-
<h1 id="contributing--support">Contributing &amp; Support</h1>
73+
<h1 id="contributing-support">Contributing &amp; Support</h1>
7474
<h2 id="overview">Overview</h2>
7575
<p>Contribution from the community is encouraged and can be done in a variety of ways:</p>
7676
<ul>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<!-- Base HTML template -->
2+
<!DOCTYPE html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="x-ua-compatible" content="ie=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
8+
<!-- Title -->
9+
<title>Sitemap - Rummage</title>
10+
11+
<!-- Theme CSS -->
12+
<link rel="stylesheet" href="css/theme.css">
13+
14+
<!-- Extra CSS -->
15+
</style>
16+
17+
<!-- JavaScript -->
18+
19+
</head>
20+
21+
<body>
22+
23+
<!-- Content -->
24+
<div class="markdown">
25+
26+
<!-- Table of Content (Don't show for static sites) -->
27+
28+
<h2>Documentation Navigation</h2>
29+
30+
<!-- Navigation list -->
31+
<ul>
32+
33+
34+
<li >
35+
<a href="index.html">Rummage</a>
36+
</li>
37+
38+
39+
<li >
40+
<a href="installation.html">Installation</a>
41+
</li>
42+
43+
44+
<li >
45+
<a href="usage.html">Basic Usage</a>
46+
</li>
47+
48+
49+
<li >
50+
<a href="search.html">Search Features</a>
51+
</li>
52+
53+
54+
<li >
55+
<a href="preferences.html">Settings</a>
56+
</li>
57+
58+
59+
<li >
60+
<a href="extras.html">Extras</a>
61+
</li>
62+
63+
64+
<li >
65+
<a href="about/contributing.html">Contributing &amp; Support</a>
66+
</li>
67+
68+
</ul>
69+
</div>
70+
71+
<!-- Navigation -->
72+
73+
</body>
74+
</html>

rummage/lib/gui/data/docs/usage.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<ul class="__toc_list_3">
4343

4444
</ul>
45-
<li class="__toc_level_3"><a href="#searching--replacing">Searching &amp; Replacing</a></li>
45+
<li class="__toc_level_3"><a href="#searching-replacing">Searching &amp; Replacing</a></li>
4646
<ul class="__toc_list_3">
4747

4848
<li class="__toc_level_4"><a href="#configuring-text-search">Configuring Text Search</a></li>
@@ -114,7 +114,7 @@ <h2 id="running">Running</h2>
114114
<a href="./installation.html#running-in-anaconda">Running in Anaconda</a>).</p>
115115
<div class="highlight"><pre><span></span><code>pythonw<span class="w"> </span>-m<span class="w"> </span>rummage
116116
</code></pre></div>
117-
<h2 id="searching--replacing">Searching &amp; Replacing</h2>
117+
<h2 id="searching-replacing">Searching &amp; Replacing</h2>
118118
<p><img alt="Search Tab" src="images/search_tab.png" /></p>
119119
<p>Search and replaces are configured in the <strong>Search</strong> tab. The search tab can essentially be broken up into two sections:
120120
text search configuration and file search configuration.</p>

rummage/lib/gui/dialogs/rummage_dialog.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,12 +2431,16 @@ def on_check_update(self, event):
24312431
def on_documentation(self, event):
24322432
"""Open documentation site."""
24332433

2434-
if self.doc_dlg is None:
2435-
self.doc_dlg = html_dialog.HTMLDialog(None, 'sitemap.html', self.MENU_DOCUMENTATION)
2436-
self.doc_dlg.Show()
2437-
else:
2438-
self.doc_dlg.load('sitemap.html', self.MENU_DOCUMENTATION)
2439-
self.doc_dlg.Show()
2434+
dlg = html_dialog.HTMLDialog(self, 'sitemap.html', self.MENU_CHANGELOG)
2435+
dlg.ShowModal()
2436+
dlg.Destroy()
2437+
2438+
# if self.doc_dlg is None:
2439+
# self.doc_dlg = html_dialog.HTMLDialog(None, 'sitemap.html', self.MENU_DOCUMENTATION)
2440+
# self.doc_dlg.Show()
2441+
# else:
2442+
# self.doc_dlg.load('sitemap.html', self.MENU_DOCUMENTATION)
2443+
# self.doc_dlg.Show()
24402444

24412445
def on_changelog(self, event):
24422446
"""Open documentation site."""

0 commit comments

Comments
 (0)