-
Notifications
You must be signed in to change notification settings - Fork 841
[RFC] Split markdown rendering to a separate package. #595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ditman
wants to merge
39
commits into
google:main
Choose a base branch
from
ditman:inject-markdown-rendering
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,422
−284
Draft
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
539f70e
Make the default markdown renderer noop
ditman 818a807
Introduce lit-markdown-it package
ditman 4d6490b
Add shared markdown renderer for all JS web renderers.
ditman 1386263
Add the markdown-lit facade package
ditman 362317c
Import markdownit from module name, instead of index.js
ditman 5530802
Move the markdown context to the UI library, next to the theme.
ditman b563228
Inject the Context.markdown Directive into the text widget. Default t…
ditman e11a28e
Inject the markdown-it-lit renderer on shell app
ditman 3545acd
Update miscellaneous lockfiles
ditman ede18f1
Fix typo in shell a2ui-surface closing tag
ditman 376ed91
Wire the markdown renderer to the contact app.
ditman decd931
Miscellaneous package-lock.json update
ditman 3396e84
Tweak the contact theme to align the h5 a little bit better
ditman 6b7a477
Refactor build:renderer as a bash for loop so it builds all the lit r…
ditman 2742616
Update lit_samples_build.yml to use the existing build:renderer script.
ditman 0bbcc7e
Make the NoopMarkdownRenderer a MinimalMarkdownRenderer instead.
ditman cffb557
Remove markdown-it dependency from lit renderer
ditman a58b179
Add a base interface for Markdown Renderers in web_core
ditman 887d5c4
Make the Lit default markdown renderer implement the new MarkdownRend…
ditman b12bc69
Make the markdown-it-lit markdown renderer implement the interface
ditman d83c3ff
Remove and gitignore package-lock.json files from the new markdown pa…
ditman e8be402
Add an angular bridge for the markdown-it-shared package
ditman 1539d7d
Export a noop MarkdownRenderer so it can be overridden from apps
ditman aa8f5be
Inject the new markdown-it-angular renderer in the restaurants sample…
ditman 8582013
Share the prettier configuration across all subpackages
ditman c40fbb5
Use the Type from web_core for the shared markdown renderer.
ditman aa8ac06
Add a test to markdown-it-shared
ditman 8430847
Setup tests and formatting for package. Apply formatting and update R…
ditman 8ac9bae
Add test for the markdown integration.
ditman e1832c0
Setup tests and formatting for package. Apply formatting and update R…
ditman 613fdd8
Update prettier configuration and README
ditman 1a5d9ed
Add dist and .wireit directories to gitignore
ditman 79e9809
Improve jsdoc of the MarkdownRendererTagClassMap type
ditman 68b54bd
Update error message of the Minimal Markdown renderer
ditman 4d0d44e
Make the markdown renderer in angular noop.
ditman 118a9a1
Remove the markdown-it dependency from the angular renderer.
ditman 5702a9c
Update the jsdoc of Lit mininal markdown to point to markdown-it-lit
ditman 36d8e07
Use the build:renderer angular sample target to prepare samples.
ditman 98cda53
Do not run ng before installing it
ditman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| Copyright 2025 Google LLC | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
| https://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| import {markdownContext} from "./markdown.js"; | ||
ditman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import {themeContext} from "./theme.js"; | ||
|
|
||
| export { | ||
| markdownContext as markdown, | ||
| themeContext as theme, | ||
| themeContext, // Preserved for backwards compatibility. Prefer using `theme`. | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| Copyright 2025 Google LLC | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| https://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
| import { | ||
| DirectiveResult, | ||
| } from "lit/directive.js"; | ||
| import { createContext } from "@lit/context"; | ||
|
|
||
| /** | ||
| * A Lit Context to override the default (noop) markdown renderer. | ||
| */ | ||
| export const markdownContext = createContext<DirectiveResult>( | ||
| Symbol("a2ui-lit-markdown-renderer") | ||
| ); |
ditman marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.