@writedocs/generator 0.4.6 → 0.4.8
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/astro.config.mjs +37 -3
- package/package.json +1 -1
- package/src/components/Accordion.astro +22 -5
- package/src/components/AppIcon.astro +5 -0
- package/src/components/Callout.astro +15 -5
- package/src/components/Card.astro +64 -13
- package/src/components/Check.astro +13 -0
- package/src/components/Color.astro +61 -0
- package/src/components/ColorItem.astro +93 -0
- package/src/components/ColorRow.astro +39 -0
- package/src/components/Columns.astro +11 -0
- package/src/components/Frame.astro +10 -1
- package/src/components/GitHubRepo.astro +156 -0
- package/src/components/Hint.astro +50 -4
- package/src/components/Panel.astro +11 -0
- package/src/components/ParamField.astro +25 -0
- package/src/components/Parameter.astro +41 -4
- package/src/components/Prompt.astro +143 -0
- package/src/components/ResponseField.astro +18 -0
- package/src/components/Step.astro +22 -3
- package/src/components/Steps.astro +22 -0
- package/src/components/Tab.astro +7 -1
- package/src/components/Tabs.astro +27 -4
- package/src/components/Tile.astro +65 -0
- package/src/components/Tooltip.astro +13 -0
- package/src/components/Tree.astro +213 -0
- package/src/components/TreeFile.astro +17 -0
- package/src/components/TreeFolder.astro +28 -0
- package/src/components/Update.astro +171 -0
- package/src/components/View.astro +214 -0
- package/src/components/Visibility.astro +11 -0
- package/src/components/compound.ts +21 -0
- package/src/components/index.ts +12 -0
- package/src/content.config.ts +68 -2
- package/src/layout/components/NavTree.astro +34 -0
- package/src/layout/styles/base.css +12 -0
- package/src/lib/config.ts +1412 -1306
- package/src/lib/inline-markdown.js +29 -0
- package/src/lib/mdx-inject-builtins.js +20 -2
- package/src/lib/mdx-mintlify.js +99 -0
- package/src/lib/mdx-title-anchor-ids.js +7 -2
- package/src/lib/shiki-code-block.js +140 -26
- package/src/lib/visibility.js +29 -0
- package/src/pages/[...slug].astro +110 -7
- package/src/pages/[...slug].md.ts +7 -1
- package/src/pages/llms-full.txt.ts +5 -1
- package/src/pages/llms.txt.ts +3 -0
- package/src/styles/global.css +10 -0
|
@@ -4,6 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import type { APIRoute } from 'astro';
|
|
5
5
|
import { loadDocsConfig, normalizeEntryId, findAllPages } from '../lib/config';
|
|
6
6
|
import { writedocsTempDir } from '../lib/writedocs-temp-dir.js';
|
|
7
|
+
import { applyVisibilityForAgents } from '../lib/visibility.js';
|
|
7
8
|
|
|
8
9
|
// The "everything, concatenated" half of the llms.txt pair - see
|
|
9
10
|
// llms.txt.ts (right next to this file) for the lightweight index half,
|
|
@@ -49,9 +50,12 @@ export const GET: APIRoute = async () => {
|
|
|
49
50
|
// Same noindex exclusion llms.txt.ts applies to its own listing -
|
|
50
51
|
// see that file's comment.
|
|
51
52
|
.filter((entry) => !entry.data.seo?.noindex)
|
|
53
|
+
// Same `url` exclusion as llms.txt.ts - a redirect, not a page.
|
|
54
|
+
.filter((entry) => !entry.data.url)
|
|
52
55
|
.map((entry: DocsEntry) => {
|
|
53
56
|
const slug = normalizeEntryId(entry.id);
|
|
54
|
-
|
|
57
|
+
// Agents' view of <Visibility> blocks, same as the .md route.
|
|
58
|
+
const body = applyVisibilityForAgents(entry.body ?? '');
|
|
55
59
|
return { slug, title: entry.data.title, body };
|
|
56
60
|
})
|
|
57
61
|
.sort((a, b) => a.slug.localeCompare(b.slug));
|
package/src/pages/llms.txt.ts
CHANGED
|
@@ -85,6 +85,9 @@ export const GET: APIRoute = async () => {
|
|
|
85
85
|
// same reason: llms.txt exists to help external tools discover
|
|
86
86
|
// pages, exactly what `noindex` asked not to happen.
|
|
87
87
|
.filter((entry) => !entry.data.seo?.noindex)
|
|
88
|
+
// A frontmatter `url` page (Mintlify's external link) has no content -
|
|
89
|
+
// its own URL only redirects to the link.
|
|
90
|
+
.filter((entry) => !entry.data.url)
|
|
88
91
|
.map((entry: DocsEntry) => {
|
|
89
92
|
const slug = normalizeEntryId(entry.id);
|
|
90
93
|
// Same URL Astro's own router resolves this entry to - see
|
package/src/styles/global.css
CHANGED
|
@@ -16,3 +16,13 @@
|
|
|
16
16
|
classes available with zero effect on existing unstyled elements. */
|
|
17
17
|
@import "tailwindcss/theme.css";
|
|
18
18
|
@import "tailwindcss/utilities.css";
|
|
19
|
+
|
|
20
|
+
/* Tailwind's `dark:` variant follows the site's own theme toggle
|
|
21
|
+
([data-theme="dark"] on <html>, set by BaseLayout.astro), not the OS
|
|
22
|
+
setting it defaults to - otherwise Mintlify-style light/dark image
|
|
23
|
+
pairs (className="block dark:hidden" / "hidden dark:block") show the
|
|
24
|
+
wrong one whenever the reader's toggle and their OS disagree. The
|
|
25
|
+
site's content directory is added as a Tailwind source at build time
|
|
26
|
+
by astro.config.mjs's contentTailwindSource() plugin, since it lives
|
|
27
|
+
outside this package where Tailwind looks by default. */
|
|
28
|
+
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
|