Skip to content

Commit 02ef087

Browse files
authored
Merge pull request #3 from macvim-dev/whatsnew-toc
Add table of contents to What's New page
2 parents edf588e + c446e1b commit 02ef087

File tree

3 files changed

+160
-14
lines changed

3 files changed

+160
-14
lines changed

_includes/releases/r179.html

+22-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
<p>Updated to Vim 9.1.0</p>
22

3+
<nav>
4+
<ul class="toc" id="markdown-toc">
5+
<li><a href="#r179-features" id="markdown-toc-r179-features">Features</a> <ul>
6+
<li><a href="#r179-system-monospace-font-sf-mono" id="markdown-toc-r179-system-monospace-font-sf-mono">System monospace font (SF Mono)</a></li>
7+
<li><a href="#r179-new-vim-features" id="markdown-toc-r179-new-vim-features">New Vim features</a></li>
8+
<li><a href="#r179-misc" id="markdown-toc-r179-misc">Misc</a></li>
9+
</ul>
10+
</li>
11+
<li><a href="#r179-general" id="markdown-toc-r179-general">General</a></li>
12+
<li><a href="#r179-fixes" id="markdown-toc-r179-fixes">Fixes</a></li>
13+
<li><a href="#r179-compatibility" id="markdown-toc-r179-compatibility">Compatibility</a></li>
14+
</ul>
15+
16+
</nav>
17+
318
<p>Happy New Year! See <a href="https://github.com/macvim-dev/macvim/discussions/1472">#1472</a> for a retrospective of 2023 and future roadmap.</p>
419

520
<p>Also, Vim 9.1 is now released! See <a href="https://www.vim.org/vim-9.1-released.php">announcement</a>.</p>
621

7-
<h1 id="features">Features</h1>
22+
<h1 id="r179-features">Features</h1>
823

9-
<h2 id="system-monospace-font-sf-mono">System monospace font (SF Mono)</h2>
24+
<h2 id="r179-system-monospace-font-sf-mono">System monospace font (SF Mono)</h2>
1025

1126
<p>MacVim’s <code>guifont</code> option now supports a new <code>-monospace-</code> value, which instructs it to use the system monospace font, which is SF Mono in recent macOS versions. As mentioned below (New Vim features), you can now use tab-completion to see the available values in cmdline. See <a href="https://macvim.org/docs/redirect.html?tag=macvim-guifont"><code>:h macvim-guifont</code></a> for more details on how to use it (including using different font weights). <a href="https://github.com/macvim-dev/macvim/issues/1463">#1463</a></p>
1227

1328
<p>Note: I’m contemplating changing the MacVim default value for <code>guifont</code> to be <code>-monospace-</code> in the future so MacVim will always use the native monospace font instead of being hard-coded to Menlo. This makes it more consistent with Apple Terminal and Xcode. Feel free to leave a comment on <a href="https://github.com/macvim-dev/macvim/issues/1277">#1277</a> if you have opinions on this.</p>
1429

1530
<p><img width="310" alt="Menlo (default) vs SF Mono" src="https://github.com/macvim-dev/macvim/assets/1217449/56e4a7b7-9f9d-4cfa-9e6a-bb4baffc6d30" /></p>
1631

17-
<h2 id="new-vim-features">New Vim features</h2>
32+
<h2 id="r179-new-vim-features">New Vim features</h2>
1833

1934
<ul>
2035
<li>Command-line tab completion improvements and bug fixes (see <a href="https://macvim.org/docs/redirect.html?tag=cmdline-completion"><code>:h cmdline-completion</code></a> and <a href="https://macvim.org/docs/redirect.html?tag=complete-set-option"><code>:h complete-set-option</code></a>)
@@ -41,7 +56,7 @@ <h2 id="new-vim-features">New Vim features</h2>
4156
<li>Miscellaneous security fixes.</li>
4257
</ul>
4358

44-
<h2 id="misc">Misc</h2>
59+
<h2 id="r179-misc">Misc</h2>
4560

4661
<p>New settings:</p>
4762

@@ -56,7 +71,7 @@ <h2 id="misc">Misc</h2>
5671
<li>MacVim can be launched without loading user defaults for a clean experience via a command-line flag. See <a href="https://macvim.org/docs/redirect.html?tag=macvim-settings"><code>:h macvim-settings</code></a>.</li>
5772
</ul>
5873

59-
<h1 id="general">General</h1>
74+
<h1 id="r179-general">General</h1>
6075

6176
<ul>
6277
<li>Sparkle (updater for MacVim) is now updated to 2.5.2. The updater can now show multiple release notes when updating MacVim across multiple versions. <a href="https://github.com/macvim-dev/macvim/issues/1446">#1446</a> <a href="https://github.com/macvim-dev/macvim/issues/1469">#1469</a></li>
@@ -70,14 +85,14 @@ <h1 id="general">General</h1>
7085
<li>Python 2 support: The default location for locating the Python 2 lib in the binary release is now under /Library/Frameworks rather than /usr/local. Note: Python 2 has long been obsolete. If you rely on Python 2 plugins, consider this a warning as it’s only supported as long as it’s feasible and could be removed in the future. <a href="https://github.com/macvim-dev/macvim/issues/1434">#1434</a></li>
7186
</ul>
7287

73-
<h1 id="fixes">Fixes</h1>
88+
<h1 id="r179-fixes">Fixes</h1>
7489

7590
<ul>
7691
<li>Fixed non-native full screen mode when using a MacBook with a notch and having the “Show menu bar in non-native mode” option set. Changing the screen resolution while using non-native full screen also works properly now. <a href="https://github.com/macvim-dev/macvim/issues/1450">#1450</a></li>
7792
<li>Fixed Help menu’s documentation search not working with tags with special characters like <code>&lt;Down&gt;</code>. <a href="https://github.com/macvim-dev/macvim/issues/1455">#1455</a></li>
7893
</ul>
7994

80-
<h1 id="compatibility">Compatibility</h1>
95+
<h1 id="r179-compatibility">Compatibility</h1>
8196

8297
<p>Requires macOS 10.9 or above. (10.9 - 10.12 requires downloading a separate legacy build)</p>
8398

_includes/releases/r180.html

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
<p>Updated to Vim 9.1.0727</p>
22

3+
<nav>
4+
<ul class="toc" id="markdown-toc">
5+
<li><a href="#r180-features" id="markdown-toc-r180-features">Features</a> <ul>
6+
<li><a href="#r180-new-vim-features" id="markdown-toc-r180-new-vim-features">New Vim features</a></li>
7+
<li><a href="#r180-misc" id="markdown-toc-r180-misc">Misc</a></li>
8+
</ul>
9+
</li>
10+
<li><a href="#r180-general" id="markdown-toc-r180-general">General</a></li>
11+
<li><a href="#r180-fixes" id="markdown-toc-r180-fixes">Fixes</a></li>
12+
<li><a href="#r180-compatibility" id="markdown-toc-r180-compatibility">Compatibility</a></li>
13+
</ul>
14+
15+
</nav>
16+
317
<p>This update mostly syncs to new upstream Vim version, along with small fixes.</p>
418

5-
<h1 id="features">Features</h1>
19+
<h1 id="r180-features">Features</h1>
620

7-
<h2 id="new-vim-features">New Vim features</h2>
21+
<h2 id="r180-new-vim-features">New Vim features</h2>
822

923
<ul>
1024
<li>Vim now supports the XDG Base Directory Specification. You can now put your vimrc and plugins in <code>~/.config/vim</code> intsead of <code>~/.vim</code> / <code>~/.vimrc</code>. See <a href="https://macvim.org/docs/redirect.html?tag=xdg-base-dir"><code>:h xdg-base-dir</code></a>. <a href="https://github.com/vim/vim/commit/c9df1fb35a1866901c32df37dd39c8b39dbdb64a">v9.1.0327</a></li>
@@ -49,26 +63,26 @@ <h2 id="new-vim-features">New Vim features</h2>
4963
</li>
5064
</ul>
5165

52-
<h2 id="misc">Misc</h2>
66+
<h2 id="r180-misc">Misc</h2>
5367

5468
<ul>
5569
<li>When resizing MacVim, the title bar’s message looks a little nicer now. <a href="https://github.com/macvim-dev/macvim/issues/1488">#1488</a> by @sfsam</li>
5670
<li>Copyright disclaimer in About MacVim no longer shows a year. <a href="https://github.com/macvim-dev/macvim/issues/1497">#1497</a></li>
5771
</ul>
5872

59-
<h1 id="general">General</h1>
73+
<h1 id="r180-general">General</h1>
6074

6175
<ul>
6276
<li>Sparkle (updater for MacVim) is now updated to 2.6.4. For legacy builds it’s now updated to 1.27.3. <a href="https://github.com/macvim-dev/macvim/issues/1494">#1494</a></li>
6377
</ul>
6478

65-
<h1 id="fixes">Fixes</h1>
79+
<h1 id="r180-fixes">Fixes</h1>
6680

6781
<ul>
6882
<li>Fixed dragging tabs to reorder them resulting in a crash. <a href="https://github.com/macvim-dev/macvim/issues/1499">#1499</a></li>
6983
</ul>
7084

71-
<h1 id="compatibility">Compatibility</h1>
85+
<h1 id="r180-compatibility">Compatibility</h1>
7286

7387
<p>Requires macOS 10.9 or above. (10.9 - 10.12 requires downloading a separate legacy build)</p>
7488

release-notes/whatsnew.html

+118-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
1515
Use ?from=<rev_exclusive>&to=<rev_inclusive> to list a range of releases.
1616
Use ?version=<rev> to list a single release from its revision number.
17+
Use ?all to just show all of them.
1718
-->
1819

1920
<style>
@@ -71,9 +72,101 @@
7172
display: block;
7273
}
7374

75+
/* TOC */
76+
html {
77+
scroll-behavior: smooth;
78+
}
79+
.toc {
80+
display: none;
81+
border-left: 1px solid darkgray;
82+
}
83+
.toc a {
84+
color: inherit;
85+
text-decoration: none;
86+
}
87+
.toc a:hover {
88+
color: #599A42;
89+
text-decoration: underline;
90+
}
91+
@media (prefers-color-scheme: dark) {
92+
.toc {
93+
border-left: 1px solid dimgray;
94+
}
95+
.toc a:hover {
96+
color: rgb(48,209,88);
97+
}
98+
}
99+
#hidetoc-btn {
100+
display: none;
101+
}
102+
#hidetoc-toggle {
103+
display: none;
104+
}
105+
@media (min-width:50em) {
106+
section {
107+
width: 72%;
108+
}
109+
.toc {
110+
display: inherit;
111+
position: fixed;
112+
top: 0;
113+
right: 0;
114+
width: 24%;
115+
max-height: 100%;
116+
overflow: auto;
117+
padding-left: 1em;
118+
margin-left: 1em;
119+
120+
line-height: 150%;
121+
font-size:110%;
122+
123+
transition: 0.3s;
124+
}
125+
.toc ul {
126+
list-style-type: none;
127+
padding-left: 1em;
128+
}
129+
.toc li {
130+
list-style-type: none;
131+
}
132+
133+
#hidetoc-toggle:checked ~ section {
134+
width: 95%;
135+
}
136+
#hidetoc-toggle:checked ~ * .toc {
137+
right: -28%;
138+
border: none;
139+
}
140+
#hidetoc-btn {
141+
display: inherit;
142+
position: fixed;
143+
right: 1.5em;
144+
z-index: 1;
145+
opacity: 0.2;
146+
}
147+
#hidetoc-btn:hover {
148+
opacity: 1.0;
149+
}
150+
#hidetoc-btn > svg {
151+
transition: 0.3s;
152+
}
153+
#hidetoc-toggle:checked ~ nav > #hidetoc-btn > svg {
154+
transform: rotate(180deg);
155+
}
156+
}
74157
</style>
75158
</head>
76159
<body>
160+
<!-- show/hide TOC control -->
161+
<input type="checkbox" id="hidetoc-toggle" />
162+
<nav>
163+
<label for="hidetoc-toggle" id="hidetoc-btn">
164+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">
165+
<path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"/>
166+
</svg>
167+
</label>
168+
</nav>
169+
77170
{% for release in site.data.releases.prereleases %}
78171
<section id={{ release }}>
79172
<header> <h1>MacVim r{{ release }} (prerelease)</h1></header>
@@ -104,9 +197,15 @@
104197
<script>
105198
const params = new URLSearchParams(document.location.search);
106199

200+
let tocs = [];
201+
107202
let fromRev = NaN;
108203
let toRev = NaN;
109-
if (params.has('from') && params.has('to')) {
204+
if (params.has('all')) {
205+
fromRev = -Infinity;
206+
toRev = Infinity;
207+
}
208+
else if (params.has('from') && params.has('to')) {
110209
fromRev = parseFloat(params.get('from'));
111210
toRev = parseFloat(params.get('to'));
112211
}
@@ -125,13 +224,31 @@
125224
else {
126225
sections[i].style.display = 'block';
127226
foundOne = true;
227+
228+
let toc = sections[i].querySelector('.toc');
229+
if (toc)
230+
tocs.push({elem: toc, sectionId: sections[i].id});
128231
}
129232
}
130233
}
131234
if (!foundOne) {
132235
document.getElementsByClassName('item-0')[0].style.display = 'block'; // Just show the latest if the input range is not valid so we don't show an empty page
133236
}
134237
}
238+
// We have multiple TOCs. We patch it by making a new master list and put every TOC under it.
239+
if (tocs.length > 1) {
240+
let parentNode = tocs[0].elem.parentNode;
241+
let newToc = document.createElement('ul');
242+
newToc.className = 'toc';
243+
for (var i = 0; i < tocs.length; i++) {
244+
tocs[i].elem.className = '';
245+
let newTocItem = document.createElement('li');
246+
newTocItem.innerHTML = `<a href=#${tocs[i].sectionId}>r${tocs[i].sectionId}</a>`;
247+
newTocItem.appendChild(tocs[i].elem);
248+
newToc.appendChild(newTocItem);
249+
}
250+
parentNode.appendChild(newToc);
251+
}
135252
</script>
136253
</body>
137254
</html>

0 commit comments

Comments
 (0)