Commit graph

386 commits

Author SHA1 Message Date
Joey Perrott
53e0aaba4e refactor(docs-infra): move header id tracking into RendererContext
Move the header id tracking into the renderer context rather than a global state.  Since the RendererContext is
initialized for each execution of the marked parser, we can store the context of which header ids have been seen within
a single page there which allows us to run these parse interactions in parallel.

(cherry picked from commit a16a70ca74)
2025-12-02 12:03:39 +01:00
Joey Perrott
5ec3bd9c55 refactor(docs-infra): transform all headings using the built in transformer
Rather than manually calling the transformer we use for headings from within a render function, we now properly call into the Renderer to do them
via the tokens they are require instead.  This is being done to allow us to have a per Renderer instance of state instead of a global state, which will
allow us to run marked async and hopefully speed up the pipeline

(cherry picked from commit 8b296543ae)
2025-12-02 12:03:38 +01:00
SkyZeroZx
dad3d7900f feat(docs-infra): Adds copy link to anchor functionality
Enables copying a direct link to any section by clicking its anchor. Also updates the aria-label to remove the code tag

(cherry picked from commit 4e89bc6244)
2025-12-01 19:19:35 +01:00
SkyZeroZx
b7ccb308b8 docs(docs-infra): Improves symbol linking for Angular Aria selectors
Improves the symbol linking logic to handle Angular component selectors (e.g., ngCombobox). It attempts to convert Angular selector patterns to their corresponding class names, improving navigation to Angular API documentation.

(cherry picked from commit 2d854e01bc)
2025-12-01 18:47:23 +01:00
Shuaib Hasan Akib
cb2847c8d9 fix(docs-infra): truncate long TOC items and add title tooltips
Long TOC entries now truncate with …, and a title attribute is added to display the full label on hover.

Fixes: #65727
(cherry picked from commit 313454bf17)
2025-12-01 18:43:50 +01:00
Matthieu Riegler
4207d89455 docs(docs-infra): fix visible lines/regions
fixes #65552

(cherry picked from commit 1c3868198e)
2025-11-26 13:43:40 -05:00
SkyZeroZx
10201b6873 docs(docs-infra): renders inline code snippets in docs pills
Improves the rendering of `DocsPillRow` to correctly display inline code snippets (using backticks) within the pill labels.

(cherry picked from commit ef034c15c1)
2025-11-25 18:30:09 -05:00
Joey Perrott
0424a998c9 refactor(docs-infra): make docs-alert an inline token
Migrate docs-alert to be inline instead of block, this ensures that the content is placed within a <p> tag as expected. This is important
for ensuring that the iconography is placed correctly within the wrapper div generated for the alert. Additionally, we refactor the matcher
code to be more efficient, running with fewer loops.

(cherry picked from commit 046501fd33)
2025-11-24 13:26:03 -05:00
Shuaib Hasan Akib
70bc3115c5 docs(docs-infra): keep 'Show code' button aligned right and prevent metadata wrapping
Ensures the example viewer header displays correctly by keeping the "Show code"
button aligned to the right and preventing metadata text from wrapping.
Improves layout consistency across documentation examples.

(cherry picked from commit b26fe73a91)
2025-11-24 12:23:40 -05:00
Matthieu Riegler
1f20b54256 docs(docs-infra): simplify tab selection
Tab selection relied on the tabs being visible whe nthe example is loaded. That didn't work when `hideCode` was used.

fixes #65550

(cherry picked from commit 119c6ddaeb)
2025-11-24 10:24:42 -05:00
Kristiyan Kostadinov
290513f5b6 test: remove unnecessary test calls
Removes calls to `TestBed.configureTestingModule` since they aren't necessary.

(cherry picked from commit 26e2092dd1)
2025-11-24 10:18:21 -05:00
SkyZeroZx
93ef5d410e feat(docs-infra): add docs-image extension for enhanced image handling in markdown
Extends the Markdown parser to support `loading`, `decoding`, and `fetchpriority` attributes for images via curly brace syntax.

(cherry picked from commit 46269be842)
2025-11-21 13:25:02 -05:00
Joey Perrott
d40770fd94 refactor(docs-infra): remove the multiple code example view modes
Rather than using multiple view modes for code examples, we can just treat the previous snippet mode as
as multifile mode that just only has one file in it.

(cherry picked from commit f61e61ac4f)
2025-11-21 13:22:03 -05:00
Joey Perrott
a30fe81ae8 refactor(docs-infra): improve code efficiency for adding line numbers
Only run the code for adding line numbers if line numbers are required, otherwise skip the code block

(cherry picked from commit 88753d6a5a)
2025-11-21 13:20:49 -05:00
Joey Perrott
557cc41ff0 refactor(docs-infra): remove the unnecessary whitespace using shiki
Use a transformer within shiki to remove the unnecessary whitespace between code lines

(cherry picked from commit a873c4eb1a)
2025-11-21 13:20:49 -05:00
Joey Perrott
121997b8c2 refactor(docs-infra): drop support for providing a file diff in docs-code
Drop support for exposing a diff view in the docs-code element as it is unused and costly to even check for

(cherry picked from commit 8ec0a4ee5c)
2025-11-21 13:20:49 -05:00
Joey Perrott
7f7a2187a8 refactor(docs-infra): use shiki for highlighting
Use shiki to perform highlighting instead of a postprocessing action

(cherry picked from commit fee79e37d5)
2025-11-21 13:20:49 -05:00
Joey Perrott
70195636cc fix(docs-infra): link to the snippet location at the proper commit for examples
Within examples, we now link to the github URL using the commit that was made to create adev, rather than
always on main, which may change over time.

(cherry picked from commit a8f46e598a)
2025-11-21 13:19:55 -05:00
Jessica Janiuk
28810e0914 build: bump adev version
Bump adev versions for v21 release

(cherry picked from commit d42d7523ec)
2025-11-19 20:09:29 +00:00
Matthieu Riegler
36784d70c0 docs: fix docs heading alignment
(cherry picked from commit c7424c8f07)
2025-11-19 01:00:29 +00:00
Andrew Seguin
1355edde69 docs: hide temporary prerender tabs and multifile docs sections
(cherry picked from commit d4595791d6)
2025-11-18 14:54:52 -08:00
Amy Sorto
e08a8e2678 docs: update overview page
(cherry picked from commit 111a7644ef)
2025-11-18 14:54:13 -08:00
Cheng-Hsuan Tsai
5e66675bb0 docs(docs-infra): fix broken code tabs
When `<mat-tab-group>` is conditionally removed by `@if` it loses the
`<mat-tab>` projected content somehow.

(cherry picked from commit d104acb286)
2025-11-17 19:45:22 +00:00
Joey Perrott
6551b65172 docs: update examples to latest Angular
Updates the adev examples to use Angular 21.0.0-rc.2

(cherry picked from commit 7e70682f2b)
2025-11-17 19:18:01 +00:00
Cheng-Hsuan Tsai
b5cd4522d9 docs(docs-infra): aria attribute typo
(cherry picked from commit 4dc226231c)
2025-11-17 17:29:29 +00:00
Cheng-Hsuan Tsai
16abc8a0d5 docs(docs-infra): set max-height to code example
(cherry picked from commit 138e65356b)
2025-11-17 17:28:19 +00:00
Shuaib Hasan Akib
70736309f5 docs: improve accessibility with descriptive link and main landmark
- Replaced <a><button></button></a> with a proper <a> containing text and
  aria-label to ensure links have discernible text.

- Added main tag in home page to provide
  a consistent main landmark, improving accessibility for screen readers
  and satisfying WCAG and Lighthouse requirements.

Fixes #65181.

(cherry picked from commit ee5947db38)
2025-11-17 16:32:05 +00:00
Shuaib Hasan Akib
c03b1fa8a0 fix(docs-infra): add bash language support for shell prompt rendering
Code blocks with `bash` language identifier were not rendering the `$`
prefix, while `shell` blocks did.

This ensures consistent command-line prompt rendering across both
`bash` and `shell` code blocks in the documentation.

(cherry picked from commit f462684211)
2025-11-17 16:31:31 +00:00
Cheng-Hsuan Tsai
7020ef6c60 docs(docs-infra): make show code button more discoverable when collapsed
(cherry picked from commit 48cff8c128)
2025-11-17 16:07:06 +00:00
Kristiyan Kostadinov
7ec9f357f4 fix(docs-infra): prevent example resets from affecting CDK
The example viewer has some `::ng-deep` styles that are used to reset global styles that leak into the live examples. It works by applying a style like `.docs-example-viewer-preview * {all: revert;}`.

The problem with this is that depending on when the first example is rendered, the styles will be lower or higher in the cascade, thus making the reset unreliable. Furthermore, it can affect structural styles from the CDK which intentionally have low specificity.

These changes move the resets into the global stylesheet to make them more predictable.

(cherry picked from commit 1ba50caefc)
2025-11-17 16:05:15 +00:00
Cheng-Hsuan Tsai
3228cce727 docs(docs-infra): enable tabs layout
(cherry picked from commit de234def0e)
2025-11-14 20:24:05 +00:00
cexbrayat
f550f4ab4a docs: ExperimentalIsolatedShadowDom mentions
(cherry picked from commit c137f1fe91)
2025-11-14 16:41:16 +00:00
Cheng-Hsuan Tsai
afeba79ac8 docs(docs-infra): hide file tabs when code example is hidden
(cherry picked from commit 6d8c3fc888)
2025-11-13 23:58:14 +00:00
Matthieu Riegler
4f6f9b8e8d docs(docs-infra): Add support for metadata on fenced code blocks
This will help us replace `docs-code` with inline code usages and prevent future indentation issues

(cherry picked from commit f737a9dd5c)
2025-11-13 17:36:17 +00:00
hawkgs
c133f48902 docs(docs-infra): improve playground layout
Improve the layout and optimize the empty space; Introduce some minor improvements to the code editor

(cherry picked from commit 7ab1b3a32a)
2025-11-13 17:07:58 +00:00
SkyZeroZx
31ca56aa20 docs: Fixed mermaid diagram node label contrast in dark mode
(cherry picked from commit b6a91d4c39)
2025-11-12 23:01:40 +00:00
Matthieu Riegler
5e86299ec4 docs(docs-infra): Add support for experimental enum entries
(cherry picked from commit 16e61f5dd0)
2025-11-11 08:46:09 -08:00
Alan Agius
3bed9f0f16
build: format md files
This commit configures prettier to format markdown files.
2025-11-06 10:07:13 -08:00
Miles Malerba
4bdd317596 docs: improve docs generation for namespaces (#64747)
Improves docs epxerience for interfaces / type aliases that are merged
with a namespace.

PR Close #64747
2025-11-05 22:42:59 +00:00
Matthieu Riegler
01c5ba50d2 docs(docs-infra): fix heading layout on mobile
Long code blocks overflow the headings on narrow screen (like mobiles), this messes up the global layout of the page. With the ellipsis with fix that.

fixes #64845

(cherry picked from commit 7f44345db3)
2025-11-05 09:49:53 -08:00
marktechson
fcd5f9f0ef docs: add v21 landing page
Adds a new landing page for developer events, starting with the v21 page. It also includes an ICS file link for calendar invites. Also updated the tests for the docs-pill to support two new attributes so developers can add the event to their calendars.

(cherry picked from commit 7a422c209a)
2025-11-03 15:59:31 -08:00
Miles Malerba
981fabc9b6 feat(docs-infra): add support for namespaces
Adds support for generating docs for namespaces (and merged declarations
of namespace + type)

(cherry picked from commit 662f0e5c00)
2025-10-29 13:22:26 -07:00
SkyZeroZx
207a26c125 docs(docs-infra): Prevent empty extends clause in interface documentation
Interfaces with no extends clause were incorrectly rendered with a trailing extends keyword followed by nothing, resulting in invalid TypeScript syntax

(cherry picked from commit f3d056a065)
2025-10-29 18:48:35 +01:00
Shuaib Hasan Akib
ed500e42e6 fix(docs-infra): extract header attribute as title in multifile code snippets
The DocViewer component's getCodeSnippetsFromMultifileWrapper method was not
extracting the header attribute from nested <docs-code> elements, causing the
ExampleViewer to fall back to displaying file paths instead of custom headers
in tab labels.

This change adds title extraction from the header attribute when processing
multifile code snippets, ensuring that custom headers are properly displayed
in the code viewer tabs.

Fixes #64760

(cherry picked from commit 5d8b76b4fa)
2025-10-29 18:48:05 +01:00
Shuaib Hasan Akib
c0a50bf18f fix(docs-infra): update guide navigation to remain active with query params
The navigation list component was using `routerLinkActive` with
`{ exact: true }`, which required an exact URL match including query
parameters. When visiting `/update-guide?v=19.0-20.0&l=1`, the link
`/update-guide` didn't match, so the active class wasn't applied.

Updated `routerLinkActiveOptions` to ignore query parameters while
maintaining exact path matching so the navigation item stays highlighted
when interacting with the update guide form.

(cherry picked from commit 33a872d90a)
2025-10-28 15:58:29 +01:00
Shuaib Hasan Akib
e62da0d1c7 fix(docs-infra): preserve shell class for multifile code blocks
The ExampleViewer component was extracting only innerHTML from code
blocks in multifile examples, which lost the shell class applied by
the formatCode function. This caused the $ prompt to not appear for
shell commands in multifile blocks even when language="shell" was set.

Modified the Snippet interface to track shell language state and
updated getCodeSnippetsFromMultifileWrapper and getStandaloneCodeSnippet
methods to preserve the shell class. Updated example-viewer template
to conditionally apply the shell class to the code wrapper element.

Fixes inconsistency between standalone and multifile shell code blocks.

(cherry picked from commit 27e183330e)
2025-10-27 09:29:42 +01:00
Matthieu Riegler
d8388b210a docs(docs-infra): Support linking to individual playground templates
(cherry picked from commit 6e7b3c2aa6)
2025-10-24 18:47:14 +02:00
Matthieu Riegler
c89062b130 docs(docs-infra): enable strict templates
(cherry picked from commit 57af0d7e1b)
2025-10-24 15:23:32 +02:00
Matthieu Riegler
9126d0d616 docs(docs-infra): fix example viewer (#64580)
It was a regression introduced by #63915

PR Close #64580
2025-10-22 14:35:03 +00:00
SkyZeroZx
22270492f5 docs(docs-infra): Add OnPush change detection for components (#64570)
Improves Angular's OnPush change detection strategy for main and search history components

PR Close #64570
2025-10-22 14:34:26 +00:00