tldraw/apps/docs/components
alex 012e54959d
Inline documentation links in type excerpts (#3931)
Before: 
<img width="667" alt="Screenshot 2024-06-12 at 15 54 38"
src="https://github.com/tldraw/tldraw/assets/1489520/3a5fc43c-fa2e-4b08-8e8b-c1c66decf7fa">

After: 
<img width="654" alt="Screenshot 2024-06-12 at 15 55 10"
src="https://github.com/tldraw/tldraw/assets/1489520/8c8abcaa-f156-4be4-a5e9-d1a4eff39ff4">

Previously, when items in our documentation referred to each other in
code snippets, we'd put the links to their documentation pages in a
separate "references" section at the bottom of the docs. Generally I
find that this makes links harder to find (they're not in-context) and
adds a fair bit of visual noise to our API documentation.

This diff moves those links inline by adding a post-processing step to
our highlighted code. This is slightly more involved than I wanted it to
be (see the comments in code.tsx for an explanation of why) but it gets
the job done. I've added small link icons next to linked code items - i
experimented with underlines and a 🔗 icon too, but this seemed to look
the best.

### Change Type

- [x] `docs` — Changes to the documentation, examples, or templates.
- [x] `improvement` — Improving existing features
2024-06-13 13:47:13 +00:00
..
article-components Add docs (#2470) 2024-01-15 12:33:15 +00:00
mdx-components Inline documentation links in type excerpts (#3931) 2024-06-13 13:47:13 +00:00
ArticleDetails.tsx Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
ArticleDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
ArticleHeadingLinks.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
ArticleNavLinks.tsx Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
ArticleReferenceDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Autocomplete.css [docs] Small style changes (#2805) 2024-02-13 10:07:29 +00:00
Autocomplete.tsx Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
AutoRefresh.tsx children: any -> children: ReactNode (#3061) 2024-03-04 14:48:40 +00:00
Breadcrumb.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
CategoryDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
ExampleCodeBlock.tsx tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
ExampleDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
FancyBox.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Footer.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Header.tsx security: enforce use of our fetch function and its default referrerpolicy (#3884) 2024-06-11 13:59:25 +00:00
HeroImage.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
Icon.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
Icons.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Mdx.tsx Add editor notes to the docs (#3832) 2024-06-04 12:01:10 +00:00
Search.tsx fix docs build (#3201) 2024-03-18 15:59:29 +00:00
SectionDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Sidebar.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
SidebarCloseButton.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
Spinner.tsx [docs] Autocomplete styling tweaks (#2732) 2024-02-05 20:46:07 +00:00
ThemeSwitcher.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
ToggleMenuButton.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00