@waveso/docs 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -59,6 +59,19 @@ interface DocFrontmatter {
59
59
  * Lower sorts first; pages without an order sort last, alphabetically.
60
60
  */
61
61
  order?: number | undefined;
62
+ /**
63
+ * "Where to go next": a question, and the page that answers it.
64
+ *
65
+ * Declaring it renders a block at the foot of the page, above the pager. The
66
+ * two are not the same thing and both belong there — this is the *semantic*
67
+ * answer ("what do you want to know?"), the pager is the *linear* one ("what
68
+ * comes after this page?").
69
+ *
70
+ * A table would do the same job and does it worse: a screen reader announces
71
+ * "table, 2 columns, 7 rows" for what is a list of links with descriptions,
72
+ * and two columns of sentence-length questions are cramped on a phone.
73
+ */
74
+ explore?: DocExploreLink[] | undefined;
62
75
  /**
63
76
  * Sidebar marker for this page, as a name the *consumer* resolves.
64
77
  *
@@ -130,6 +143,23 @@ interface DocFile<TFrontmatter extends DocFrontmatter = DocFrontmatter> {
130
143
  */
131
144
  frontmatterLines?: number | undefined;
132
145
  }
146
+ /**
147
+ * One row of a page's "where to go next" block.
148
+ *
149
+ * ⚠️ `title` IS OPTIONAL BECAUSE THE NAVIGATION ALREADY KNOWS IT. An `href`
150
+ * pointing at a page in the tree takes that page's own name, so renaming it
151
+ * updates every block that points at it — the same reasoning as the pager's
152
+ * ordering. Name it here only where the tree cannot answer: an external link,
153
+ * or a page kept out of the navigation.
154
+ */
155
+ interface DocExploreLink {
156
+ /** What the reader might want to know. The row's left half. */
157
+ question: string;
158
+ /** Where the answer is. */
159
+ href: string;
160
+ /** The link's text. Defaults to the destination's title in the navigation. */
161
+ title?: string | undefined;
162
+ }
133
163
  /** A link to a documentation page. */
134
164
  interface DocNavPage {
135
165
  type: 'page';
@@ -507,4 +537,4 @@ interface ResolvedDocsConfig<TFrontmatter extends DocFrontmatter = DocFrontmatte
507
537
  frontmatterSchema?: StandardSchemaV1<unknown, TFrontmatter> | undefined;
508
538
  }
509
539
  //#endregion
510
- export { DocAction, DocFile, DocFrontmatter, DocLinkContext, DocNavGroup, DocNavLink, DocNavNode, DocNavPage, DocNavSeparator, DocsConfig, DocsLinkSeverity, DocsMeta, ImageResolver, LinkResolver, RenderedDoc, ResolvedDocsConfig, SearchRecord, TocEntry };
540
+ export { DocAction, DocExploreLink, DocFile, DocFrontmatter, DocLinkContext, DocNavGroup, DocNavLink, DocNavNode, DocNavPage, DocNavSeparator, DocsConfig, DocsLinkSeverity, DocsMeta, ImageResolver, LinkResolver, RenderedDoc, ResolvedDocsConfig, SearchRecord, TocEntry };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waveso/docs",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Zero parser bytes in the browser: markdown docs for Next.js, built to hast in Node and rendered as your components",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -111,6 +111,10 @@
111
111
  "./react/pager": {
112
112
  "types": "./dist/react/pager.d.ts",
113
113
  "default": "./dist/react/pager.js"
114
+ },
115
+ "./react/explore": {
116
+ "types": "./dist/react/explore.d.ts",
117
+ "default": "./dist/react/explore.js"
114
118
  }
115
119
  },
116
120
  "files": [