Commit graph

479 commits

Author SHA1 Message Date
omar-almasry11
ad49d489ae fix(docs-infra): improve dark mode button hover contrast for WCAG compliance
The .docs-primary-btn hover state in dark mode had a contrast ratio of 2.18:1,
failing WCAG 2.1 SC 1.4.3. This change reuses the existing
--hot-pink-to-electric-violet-radial-gradient to achieve 4.5:1+ contrast.
2026-01-08 11:21:23 -08:00
Matthieu Riegler
b17f93b6d1 docs(docs-infra): Use category for signal forms guides 2026-01-07 09:35:19 -05:00
Matthieu Riegler
15308149db docs(docs-infra): Add package filter to the API list
This commit also introduces the usage of signal forms on adev
2026-01-05 15:21:33 -05:00
Shuaib Hasan Akib
e6631f0007 docs(docs-infra): sync heading colors between docs and API pages
Aligns documentation heading colors across docs and API pages to ensure
visual consistency and a cohesive reading experience.
2026-01-05 12:36:58 -05:00
SkyZeroZx
c1d72af10d docs(docs-infra): add external link styles to API reference documentation
Adds the missing icon external link styling to the API reference documentation.
2026-01-05 12:14:31 -05:00
Shuaib Hasan Akib
8358e548ce fix(docs-infra): stop auto-linking "state" and "group" to APIs
Prevents common words used in code examples from being incorrectly
linked to API references.

Fixes: #66292
2026-01-05 12:01:51 -05:00
SkyZeroZx
a5ebdd9cd1 docs(docs-infra): Fixes the visibility of the copy link button in CLI headings
Fixes the visibility of the copy link button in CLI documentation headings.
2026-01-05 11:52:24 -05:00
Matthieu Riegler
3a85031dc0 docs(docs-infra): Modernize tests
Remove usages of `detectChanges` and rely on `whenStable`.
This commit also removed the usage of `provideZonelessChangeDetection` which is no longer necessary.
2026-01-05 11:47:08 -05:00
Angular Robot
8fa602176c build: update all non-major dependencies
See associated pull request for more information.
2026-01-02 08:31:03 +01:00
SkyZeroZx
e409757208 docs(docs-infra): fixes copy-to-clipboard icon moves to a new line for long heading text
Fixes an issue where the copy-to-clipboard icon moves to a new line when heading text is long and wraps.
Applies improved text wrapping for headings to keep the icon visually aligned.

Fixes #66239
2026-01-02 08:24:39 +01:00
SkyZeroZx
3b73eff0b4 docs(docs-infra): apply OnPush change detection and remove redundant root provider
Adds OnPush change detection and removes a redundant `providedIn: 'root'` injection token.
2026-01-02 08:23:20 +01:00
Matthieu Riegler
80eb5c4d8a docs(docs-infra): user-select none for buttons
fixes #66214
2026-01-02 08:22:16 +01:00
SkyZeroZx
59c1dcc662 docs(docs-infra): adjust z-index to prevent adev tutorial nav overlapping sidebar
Updated the z-index hierarchy to avoid the adev tutorial navigation bar
overlapping the main sidebar.
2026-01-02 08:10:53 +01:00
Shuaib Hasan Akib
e9d1c6478a docs(docs-infra): clean up TODO comment, unused imports, and helper function 2025-12-17 14:33:58 -08:00
Matthieu Riegler
d23ce76821 docs(docs-infra): leverage the search on 404
This introduces a search result matching the requested url when the page couldn't not be found.
2025-12-17 09:40:42 -08:00
Matthieu Riegler
6270bba056 ci: reformat files
This is after we've slightly changed a rule in #66056
2025-12-16 14:44:19 -08:00
Matthieu Riegler
af77b89e2a ci: reformat files
This is after we've slightly changed a rule in #66056
2025-12-16 09:24:36 -08:00
Shuaib Hasan Akib
3ff20a58d3 refactor(docs-infra): remove deprecated h.JSX.HTMLAttributes usage
Import HTMLAttributes directly from preact to address deprecation warning in header-api.tsx
2025-12-15 17:44:24 -08:00
Alan Agius
2a5c6919d0 build: remove API doc generation for localize/init and add mnemonic to API rendering rule.
The removed target was not used and was generating an empty output which causes `java.io.IOException: mandatory output packages/localize/init/localize_docs_html was not created`
2025-12-15 11:41:43 -08:00
Matthieu Riegler
b5205c7c42 docs(docs-infra): throw when rendering absolute links to adev in our guides
This is to prevent any further regressions in the future
2025-12-15 09:45:04 -08:00
Andrew Xue
ff68806c67 docs(docs-infra): add primary color vars for tutorial button 2025-12-11 17:11:27 -08:00
SkyZeroZx
a8fac4ce3b docs(docs-infra): Fix prefer/avoid rule matching with word boundaries
Improve code block rule detection by adding word-boundary anchors.
Also update indentation for consistency.
2025-12-11 17:08:50 -08:00
Angular Robot
0ef185d015 build: update all non-major dependencies
See associated pull request for more information.
2025-12-10 12:28:42 -08:00
SkyZeroZx
15e3407dab docs(docs-infra): Fixes the visibility of the copy link button in API documentation headings
Fixes the visibility of the copy link button in API documentation headings.
The button now appears on hover, improving the user experience.
2025-12-10 10:15:59 -08:00
Shuaib Hasan Akib
1f29577077 fix(docs-infra): parse linenums attribute from triple backtick metadata
The triple backtick code block parser now extracts the linenums attribute
from metadata and applies it to enable line number display in code examples
2025-12-10 09:31:44 -08:00
Matthieu Riegler
8199945637 refactor(core): add dedicated deprecated signatures for providedIn: any / NgModule.
Those were deprecated by #47616 back in v15.

fixes #65923
2025-12-09 10:38:09 -08:00
SkyZeroZx
9a6b8e0315 docs(docs-infra): Refactors tutorial generation and updates ng-container docs
Updates the `ng-container` documentation page to use the correct `angular-html` code format and removes an unused CLI documentation file.
2025-12-09 09:25:29 -08:00
Matthieu Riegler
3411638f65 docs(docs-infra): prefer/avoid code block styling
fixes #65866
2025-12-09 09:23:12 -08:00
Joey Perrott
349133374f build: update repository to use node 22.21.1 in bazel
The repository was updated to use node 22.21.1 via nvm, but bazel had not been updated to match
2025-12-09 09:19:13 -08:00
Shuaib Hasan Akib
4b9fffaa79 docs(docs-infra): hide trailing empty line in code examples
Add CSS rule to hide the last empty line in code blocks to prevent displaying
unnecessary empty lines when source files end with a newline character.
The empty line remains in the DOM for proper copy-paste functionality.
2025-12-09 09:17:41 -08:00
Joey Perrott
aa92f19307 build: update to bazel version 8.4.2
Update bazel to use version 8.4.2
2025-12-08 10:21:59 -08:00
Matthieu Riegler
9d1d742f1b build: enable angular formatting on all html files
This should also be safe on any html file that isn't an angular template
2025-12-08 10:19:45 -08:00
Miles Malerba
cda56db20f
test: fix broken adev tests
Fixes a broken adev tests and enables another one that seems to work
fine now
2025-12-08 09:04:50 -08:00
SkyZeroZx
a4563044ad docs(docs-infra): fix hideCopy option to code snippets
Adds the ability to hide the copy button on code snippets.

Updates documentation to use the new `hideCopy` option with the new
markdown code fence syntax.
2025-12-08 08:48:20 -08:00
kirjs
789f91bd4f feat(docs-infra): forward preview error locations
Intercept the WebContainer preview overlay open-in-editor requests and relay them to the editor via postMessage so errors open the matching file.
2025-12-04 11:45:51 -08:00
Shuaib Hasan Akib
7f8ffa3304 fix(docs-infra): prevent readonly TypeScript keyword from being linked
This updates the docs infrastructure to avoid incorrectly linking the `readonly` keyword in TypeScript examples.

Fixes #65632
2025-12-03 16:30:51 +01:00
Joey Perrott
34bedae101 docs: rename visibleRegion to region
Use the attribute region instead of visibleRegion
2025-12-03 10:06:01 +01:00
Joey Perrott
9b3b5fb4cf refactor(docs-infra): extract only the visibleRegion
Previously we extracted the regions and only made the visible region visible on the page, but since there is not a need for the
non-visible code to be presented, we don't need to include it in the generated code snippets.
2025-12-03 10:06:01 +01:00
Matthieu Riegler
a784995a98 docs(docs-infra): Show examples on function overloads 2025-12-02 12:13:11 +01:00
Joey Perrott
a16a70ca74 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.
2025-12-02 12:03:34 +01:00
Joey Perrott
8b296543ae 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
2025-12-02 12:03:34 +01:00
SkyZeroZx
4e89bc6244 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
2025-12-01 19:19:31 +01:00
SkyZeroZx
2d854e01bc 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.
2025-12-01 18:47:19 +01:00
Shuaib Hasan Akib
313454bf17 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
2025-12-01 18:43:46 +01:00
Angular Robot
42e73ff9ce build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-26 15:50:56 -05:00
Matthieu Riegler
1c3868198e docs(docs-infra): fix visible lines/regions
fixes #65552
2025-11-26 13:43:37 -05:00
SkyZeroZx
ef034c15c1 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.
2025-11-25 18:30:05 -05:00
Joey Perrott
046501fd33 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.
2025-11-24 13:25:59 -05:00
Shuaib Hasan Akib
b26fe73a91 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.
2025-11-24 12:23:36 -05:00
Matthieu Riegler
119c6ddaeb 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
2025-11-24 10:24:39 -05:00
Kristiyan Kostadinov
26e2092dd1 test: remove unnecessary test calls
Removes calls to `TestBed.configureTestingModule` since they aren't necessary.
2025-11-24 10:18:18 -05:00
SkyZeroZx
46269be842 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.
2025-11-21 13:24:59 -05:00
Joey Perrott
f61e61ac4f 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.
2025-11-21 13:22:00 -05:00
Joey Perrott
88753d6a5a 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
2025-11-21 13:20:46 -05:00
Joey Perrott
a873c4eb1a refactor(docs-infra): remove the unnecessary whitespace using shiki
Use a transformer within shiki to remove the unnecessary whitespace between code lines
2025-11-21 13:20:46 -05:00
Joey Perrott
8ec0a4ee5c 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
2025-11-21 13:20:46 -05:00
Joey Perrott
fee79e37d5 refactor(docs-infra): use shiki for highlighting
Use shiki to perform highlighting instead of a postprocessing action
2025-11-21 13:20:46 -05:00
Joey Perrott
a8f46e598a 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.
2025-11-21 13:19:53 -05:00
Jessica Janiuk
d42d7523ec build: bump adev version
Bump adev versions for v21 release
2025-11-19 12:09:26 -08:00
Matthieu Riegler
c7424c8f07 docs: fix docs heading alignment 2025-11-18 17:00:24 -08:00
Andrew Seguin
d4595791d6 docs: hide temporary prerender tabs and multifile docs sections 2025-11-18 14:54:48 -08:00
Amy Sorto
111a7644ef docs: update overview page 2025-11-18 14:54:08 -08:00
Cheng-Hsuan Tsai
d104acb286 docs(docs-infra): fix broken code tabs
When `<mat-tab-group>` is conditionally removed by `@if` it loses the
`<mat-tab>` projected content somehow.
2025-11-17 11:45:19 -08:00
Joey Perrott
7e70682f2b docs: update examples to latest Angular
Updates the adev examples to use Angular 21.0.0-rc.2
2025-11-17 11:17:58 -08:00
Cheng-Hsuan Tsai
4dc226231c docs(docs-infra): aria attribute typo 2025-11-17 09:29:26 -08:00
Cheng-Hsuan Tsai
138e65356b docs(docs-infra): set max-height to code example 2025-11-17 09:28:14 -08:00
Shuaib Hasan Akib
ee5947db38 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.
2025-11-17 08:32:00 -08:00
Shuaib Hasan Akib
f462684211 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.
2025-11-17 08:31:26 -08:00
Cheng-Hsuan Tsai
48cff8c128 docs(docs-infra): make show code button more discoverable when collapsed 2025-11-17 08:07:01 -08:00
Kristiyan Kostadinov
1ba50caefc 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.
2025-11-17 08:05:12 -08:00
Cheng-Hsuan Tsai
de234def0e docs(docs-infra): enable tabs layout 2025-11-14 12:24:01 -08:00
Angular Robot
5552707a97 build: update all non-major dependencies
See associated pull request for more information.
2025-11-14 08:54:51 -08:00
cexbrayat
c137f1fe91 docs: ExperimentalIsolatedShadowDom mentions 2025-11-14 08:41:13 -08:00
Cheng-Hsuan Tsai
6d8c3fc888 docs(docs-infra): hide file tabs when code example is hidden 2025-11-13 15:58:09 -08:00
Matthieu Riegler
f737a9dd5c 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
2025-11-13 09:36:13 -08:00
hawkgs
7ab1b3a32a docs(docs-infra): improve playground layout
Improve the layout and optimize the empty space; Introduce some minor improvements to the code editor
2025-11-13 09:07:53 -08:00
SkyZeroZx
b6a91d4c39 docs: Fixed mermaid diagram node label contrast in dark mode 2025-11-12 15:01:35 -08:00
Matthieu Riegler
16e61f5dd0 docs(docs-infra): Add support for experimental enum entries 2025-11-11 08:46:06 -08:00
Angular Robot
47f6f71fc4 build: update dependency marked to v17
See associated pull request for more information.
2025-11-10 07:54:08 -08:00
Alan Agius
26fed34e0e
build: format md files
This commit configures prettier to format markdown files.
2025-11-06 10:03:05 -08:00
Angular Robot
2b71181288 build: update all non-major dependencies
See associated pull request for more information.
2025-11-05 15:13:37 -08:00
Miles Malerba
59635bba34 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
7f44345db3 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
2025-11-05 17:49:43 +00:00
marktechson
7a422c209a 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.
2025-11-03 23:59:20 +00:00
Miles Malerba
662f0e5c00
feat(docs-infra): add support for namespaces
Adds support for generating docs for namespaces (and merged declarations
of namespace + type)
2025-10-29 20:22:21 +00:00
SkyZeroZx
f3d056a065 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
2025-10-29 18:48:30 +01:00
Shuaib Hasan Akib
5d8b76b4fa 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
2025-10-29 18:48:00 +01:00
Shuaib Hasan Akib
33a872d90a 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.
2025-10-28 15:58:25 +01:00
Shuaib Hasan Akib
27e183330e 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.
2025-10-27 09:29:37 +01:00
Matthieu Riegler
6e7b3c2aa6 docs(docs-infra): Support linking to individual playground templates 2025-10-24 18:47:09 +02:00
Matthieu Riegler
57af0d7e1b docs(docs-infra): enable strict templates 2025-10-24 15:23:26 +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
SkyZeroZx
5e55b87202 docs(docs-infra): Improves navigation list readability by balancing text wrapping (#64512)
Balances text wrapping for navigation items to enhance readability

PR Close #64512
2025-10-21 15:14:35 +00:00
Matthieu Riegler
54636eacca docs(docs-infra): Extract multiple extends statements for interfaces (#64539)
fixes #64528

PR Close #64539
2025-10-20 21:18:13 +00:00
SkyZeroZx
ecb2507c8b docs(docs-infra): Corrects repo name typo in entry parsing logic (#64487)
Ensures the repository reference uses the correct name to prevent confusion and maintain consistency across generated documentation entries.

PR Close #64487
2025-10-17 14:52:24 +00:00
Matthieu Riegler
ae4880f5fd docs(docs-infra): fix mobile banner layout (#64408)
PR Close #64408
2025-10-15 10:41:04 -07:00
Angular Robot
002481b27b build: update all non-major dependencies (#64399)
See associated pull request for more information.

PR Close #64399
2025-10-14 09:25:42 -07:00
Matthieu Riegler
3e3b6e8134 docs(docs-infra): Fix animation bug on iPhones (#64342)
PR Close #64342
2025-10-13 08:25:47 -07:00
Matthieu Riegler
59c152833e docs: add check for non-existing anchor (#64309)
This is only for the anchors on the same document for now.
Commit also includes some reformating.

fixes #64303

PR Close #64309
2025-10-10 06:43:51 -07:00