-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accept path?search and path#hash in the pager and the sidebar. (#370)
* Accept path?search and path#hash in the pager and the sidebar. closes #197. The pager now supports paths containing ?search #hash. However when there are several of them, only the first page is taken into account by the pager, and a warning is logged. The sidebar opens and highlights these pages as necessary. * normalizePath(string) --------- Co-authored-by: Mike Bostock <[email protected]>
- Loading branch information
Showing
27 changed files
with
740 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export default { | ||
pages: [ | ||
{ | ||
name: "Sub", | ||
open: false, | ||
pages: [ | ||
{name: "Page 0", path: "/sub/page0"}, | ||
{name: "Page 1 ?x=1", path: "/sub/page1?x=1"}, | ||
{name: "Page 2", path: "/sub/page2"}, | ||
{name: "Page 3 ?x=1", path: "/sub/page3?x=1"}, | ||
{name: "Page 3 ?x=2", path: "/sub/page3?x=2"}, | ||
{name: "Page 4", path: "/sub/page4"}, | ||
{name: "Page 5 #hello", path: "/sub/page5#hello"}, | ||
{name: "Page 6", path: "/sub/page6"}, | ||
{name: "Page 7", path: "/sub/page7"}, | ||
{name: "Page 7 #hello", path: "/sub/page7#hello"}, | ||
{name: "Page 7 #world", path: "/sub/page7#world"}, | ||
{name: "Page 8", path: "/sub/page8"} | ||
] | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# subindex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 1..10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# page 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<title>index</title> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link rel="preload" as="style" href="./_observablehq/style.css"> | ||
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="stylesheet" type="text/css" href="./_observablehq/style.css"> | ||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="modulepreload" href="./_observablehq/client.js"> | ||
<link rel="modulepreload" href="./_observablehq/runtime.js"> | ||
<link rel="modulepreload" href="./_observablehq/stdlib.js"> | ||
<script type="module"> | ||
|
||
import "./_observablehq/client.js"; | ||
|
||
</script> | ||
<input id="observablehq-sidebar-toggle" type="checkbox" title="Toggle sidebar"> | ||
<label id="observablehq-sidebar-backdrop" for="observablehq-sidebar-toggle"></label> | ||
<nav id="observablehq-sidebar"> | ||
<ol> | ||
<li class="observablehq-link observablehq-link-active"><a href="./">Home</a></li> | ||
</ol> | ||
<ol> | ||
<details> | ||
<summary>Sub</summary> | ||
<ol> | ||
<li class="observablehq-link"><a href="./sub/page0">Page 0</a></li> | ||
<li class="observablehq-link"><a href="./sub/page1?x=1">Page 1 ?x=1</a></li> | ||
<li class="observablehq-link"><a href="./sub/page2">Page 2</a></li> | ||
<li class="observablehq-link"><a href="./sub/page3?x=1">Page 3 ?x=1</a></li> | ||
<li class="observablehq-link"><a href="./sub/page3?x=2">Page 3 ?x=2</a></li> | ||
<li class="observablehq-link"><a href="./sub/page4">Page 4</a></li> | ||
<li class="observablehq-link"><a href="./sub/page5#hello">Page 5 #hello</a></li> | ||
<li class="observablehq-link"><a href="./sub/page6">Page 6</a></li> | ||
<li class="observablehq-link"><a href="./sub/page7">Page 7</a></li> | ||
<li class="observablehq-link"><a href="./sub/page7#hello">Page 7 #hello</a></li> | ||
<li class="observablehq-link"><a href="./sub/page7#world">Page 7 #world</a></li> | ||
<li class="observablehq-link"><a href="./sub/page8">Page 8</a></li> | ||
</ol> | ||
</details> | ||
</ol> | ||
</nav> | ||
<script>{/* redacted init script */}</script> | ||
<aside id="observablehq-toc" data-selector="#observablehq-main h1:not(:first-of-type), #observablehq-main h2:not(h1 + h2)"> | ||
<nav> | ||
</nav> | ||
</aside> | ||
<div id="observablehq-center"> | ||
<main id="observablehq-main" class="observablehq"> | ||
<h1 id="index" tabindex="-1"><a class="observablehq-header-anchor" href="#index">index</a></h1> | ||
</main> | ||
<footer id="observablehq-footer"> | ||
<nav><a rel="next" href="./sub/page0"><span>Page 0</span></a></nav> | ||
<div>© 2024 Observable, Inc.</div> | ||
</footer> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<title>subindex</title> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link rel="preload" as="style" href="../_observablehq/style.css"> | ||
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="stylesheet" type="text/css" href="../_observablehq/style.css"> | ||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="modulepreload" href="../_observablehq/client.js"> | ||
<link rel="modulepreload" href="../_observablehq/runtime.js"> | ||
<link rel="modulepreload" href="../_observablehq/stdlib.js"> | ||
<script type="module"> | ||
|
||
import "../_observablehq/client.js"; | ||
|
||
</script> | ||
<input id="observablehq-sidebar-toggle" type="checkbox" title="Toggle sidebar"> | ||
<label id="observablehq-sidebar-backdrop" for="observablehq-sidebar-toggle"></label> | ||
<nav id="observablehq-sidebar"> | ||
<ol> | ||
<li class="observablehq-link"><a href="../">Home</a></li> | ||
</ol> | ||
<ol> | ||
<details> | ||
<summary>Sub</summary> | ||
<ol> | ||
<li class="observablehq-link"><a href="./page0">Page 0</a></li> | ||
<li class="observablehq-link"><a href="./page1?x=1">Page 1 ?x=1</a></li> | ||
<li class="observablehq-link"><a href="./page2">Page 2</a></li> | ||
<li class="observablehq-link"><a href="./page3?x=1">Page 3 ?x=1</a></li> | ||
<li class="observablehq-link"><a href="./page3?x=2">Page 3 ?x=2</a></li> | ||
<li class="observablehq-link"><a href="./page4">Page 4</a></li> | ||
<li class="observablehq-link"><a href="./page5#hello">Page 5 #hello</a></li> | ||
<li class="observablehq-link"><a href="./page6">Page 6</a></li> | ||
<li class="observablehq-link"><a href="./page7">Page 7</a></li> | ||
<li class="observablehq-link"><a href="./page7#hello">Page 7 #hello</a></li> | ||
<li class="observablehq-link"><a href="./page7#world">Page 7 #world</a></li> | ||
<li class="observablehq-link"><a href="./page8">Page 8</a></li> | ||
</ol> | ||
</details> | ||
</ol> | ||
</nav> | ||
<script>{/* redacted init script */}</script> | ||
<aside id="observablehq-toc" data-selector="#observablehq-main h1:not(:first-of-type), #observablehq-main h2:not(h1 + h2)"> | ||
<nav> | ||
</nav> | ||
</aside> | ||
<div id="observablehq-center"> | ||
<main id="observablehq-main" class="observablehq"> | ||
<h1 id="subindex" tabindex="-1"><a class="observablehq-header-anchor" href="#subindex">subindex</a></h1> | ||
</main> | ||
<footer id="observablehq-footer"> | ||
<div>© 2024 Observable, Inc.</div> | ||
</footer> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<title>page 0</title> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link rel="preload" as="style" href="../_observablehq/style.css"> | ||
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="stylesheet" type="text/css" href="../_observablehq/style.css"> | ||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="modulepreload" href="../_observablehq/client.js"> | ||
<link rel="modulepreload" href="../_observablehq/runtime.js"> | ||
<link rel="modulepreload" href="../_observablehq/stdlib.js"> | ||
<script type="module"> | ||
|
||
import "../_observablehq/client.js"; | ||
|
||
</script> | ||
<input id="observablehq-sidebar-toggle" type="checkbox" title="Toggle sidebar"> | ||
<label id="observablehq-sidebar-backdrop" for="observablehq-sidebar-toggle"></label> | ||
<nav id="observablehq-sidebar"> | ||
<ol> | ||
<li class="observablehq-link"><a href="../">Home</a></li> | ||
</ol> | ||
<ol> | ||
<details open class="observablehq-section-active"> | ||
<summary>Sub</summary> | ||
<ol> | ||
<li class="observablehq-link observablehq-link-active"><a href="./page0">Page 0</a></li> | ||
<li class="observablehq-link"><a href="./page1?x=1">Page 1 ?x=1</a></li> | ||
<li class="observablehq-link"><a href="./page2">Page 2</a></li> | ||
<li class="observablehq-link"><a href="./page3?x=1">Page 3 ?x=1</a></li> | ||
<li class="observablehq-link"><a href="./page3?x=2">Page 3 ?x=2</a></li> | ||
<li class="observablehq-link"><a href="./page4">Page 4</a></li> | ||
<li class="observablehq-link"><a href="./page5#hello">Page 5 #hello</a></li> | ||
<li class="observablehq-link"><a href="./page6">Page 6</a></li> | ||
<li class="observablehq-link"><a href="./page7">Page 7</a></li> | ||
<li class="observablehq-link"><a href="./page7#hello">Page 7 #hello</a></li> | ||
<li class="observablehq-link"><a href="./page7#world">Page 7 #world</a></li> | ||
<li class="observablehq-link"><a href="./page8">Page 8</a></li> | ||
</ol> | ||
</details> | ||
</ol> | ||
</nav> | ||
<script>{/* redacted init script */}</script> | ||
<aside id="observablehq-toc" data-selector="#observablehq-main h1:not(:first-of-type), #observablehq-main h2:not(h1 + h2)"> | ||
<nav> | ||
</nav> | ||
</aside> | ||
<div id="observablehq-center"> | ||
<main id="observablehq-main" class="observablehq"> | ||
<h1 id="page-0" tabindex="-1"><a class="observablehq-header-anchor" href="#page-0">page 0</a></h1> | ||
</main> | ||
<footer id="observablehq-footer"> | ||
<nav><a rel="prev" href="../"><span>Home</span></a><a rel="next" href="./page1?x=1"><span>Page 1 ?x=1</span></a></nav> | ||
<div>© 2024 Observable, Inc.</div> | ||
</footer> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<title>page 1..10</title> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link rel="preload" as="style" href="../_observablehq/style.css"> | ||
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="stylesheet" type="text/css" href="../_observablehq/style.css"> | ||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="modulepreload" href="../_observablehq/client.js"> | ||
<link rel="modulepreload" href="../_observablehq/runtime.js"> | ||
<link rel="modulepreload" href="../_observablehq/stdlib.js"> | ||
<script type="module"> | ||
|
||
import "../_observablehq/client.js"; | ||
|
||
</script> | ||
<input id="observablehq-sidebar-toggle" type="checkbox" title="Toggle sidebar"> | ||
<label id="observablehq-sidebar-backdrop" for="observablehq-sidebar-toggle"></label> | ||
<nav id="observablehq-sidebar"> | ||
<ol> | ||
<li class="observablehq-link"><a href="../">Home</a></li> | ||
</ol> | ||
<ol> | ||
<details> | ||
<summary>Sub</summary> | ||
<ol> | ||
<li class="observablehq-link"><a href="./page0">Page 0</a></li> | ||
<li class="observablehq-link"><a href="./page1?x=1">Page 1 ?x=1</a></li> | ||
<li class="observablehq-link"><a href="./page2">Page 2</a></li> | ||
<li class="observablehq-link"><a href="./page3?x=1">Page 3 ?x=1</a></li> | ||
<li class="observablehq-link"><a href="./page3?x=2">Page 3 ?x=2</a></li> | ||
<li class="observablehq-link"><a href="./page4">Page 4</a></li> | ||
<li class="observablehq-link"><a href="./page5#hello">Page 5 #hello</a></li> | ||
<li class="observablehq-link"><a href="./page6">Page 6</a></li> | ||
<li class="observablehq-link"><a href="./page7">Page 7</a></li> | ||
<li class="observablehq-link"><a href="./page7#hello">Page 7 #hello</a></li> | ||
<li class="observablehq-link"><a href="./page7#world">Page 7 #world</a></li> | ||
<li class="observablehq-link"><a href="./page8">Page 8</a></li> | ||
</ol> | ||
</details> | ||
</ol> | ||
</nav> | ||
<script>{/* redacted init script */}</script> | ||
<aside id="observablehq-toc" data-selector="#observablehq-main h1:not(:first-of-type), #observablehq-main h2:not(h1 + h2)"> | ||
<nav> | ||
</nav> | ||
</aside> | ||
<div id="observablehq-center"> | ||
<main id="observablehq-main" class="observablehq"> | ||
<h1 id="page-1..10" tabindex="-1"><a class="observablehq-header-anchor" href="#page-1..10">page 1..10</a></h1> | ||
</main> | ||
<footer id="observablehq-footer"> | ||
<div>© 2024 Observable, Inc.</div> | ||
</footer> | ||
</div> |
Oops, something went wrong.