-
Notifications
You must be signed in to change notification settings - Fork 17.3k
UI: Improve doc_md rendering in Dag Documentation #66809
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
Open
minyeamer
wants to merge
38
commits into
apache:main
Choose a base branch
from
minyeamer:ui/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.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
247d1f7
UI: Improve markdown rendering with code highlighting, math, and diag…
minyeamer 20a7f9d
UI: Add horizontal scroll for code blocks and fix container overflow
minyeamer 8621c77
Fix markdown code block language parsing for hyphenated identifiers
minyeamer 599d547
UI: Apply markdown review feedback and fix FAB compat CI
minyeamer f49cfa7
UI: Fix markdown test typing and sync FAB provider docs
minyeamer 1114cde
Remove direct PyJWT dependency from FAB provider
minyeamer 3a20a82
Merge branch 'main' into ui/markdown-rendering
minyeamer 2b0d38e
UI: Restore PrismLight and fix markdown code block framing
minyeamer c952f38
UI: Reduce markdown rendering tests to smoke coverage
minyeamer f7a7a97
UI: Drop inline markdown math and lazy-load KaTeX
minyeamer dbf3a19
docs: Add third-party license notices for markdown deps
minyeamer 92eb8e1
fix: restore Link component props and align with library contract
minyeamer 1f1f198
Merge branch 'main' into ui/markdown-rendering
minyeamer 1c453b7
Merge branch 'main' into ui/markdown-rendering
minyeamer 31782bb
Update airflow-core/src/airflow/ui/src/components/ReactMarkdownBlocks…
minyeamer c48a7ba
Update airflow-core/src/airflow/ui/src/components/ReactMarkdown.tsx
minyeamer 3016c2b
UI: Simplify ReactMarkdown code rendering helpers
minyeamer 8ce7637
UI: Move markdown Mermaid rendering into provider
minyeamer 0d96f1f
Merge branch 'main' into ui/markdown-rendering
minyeamer a20e95f
fix: Rename KatexStyleLoader to PascalCase and update imports
minyeamer 37616bf
UI: Remove redundant syntax language resolution logic
minyeamer c352c8f
Merge branch 'main' into ui/markdown-rendering
minyeamer 3b78469
Merge branch 'main' into ui/markdown-rendering
minyeamer ef322b6
Merge branch 'main' into ui/markdown-rendering
minyeamer 2e518bc
Merge branch 'main' into ui/markdown-rendering
minyeamer 0f5d3fb
Merge branch 'main' into ui/markdown-rendering
minyeamer cccc286
chore: remove pnpm.minimumReleaseAge
minyeamer 1c93cb3
Merge branch 'main' into ui/markdown-rendering
minyeamer b7cfacd
remove extractText & extractTextContent in ReactMarkdown
minyeamer f328e09
UI: Simplify MermaidProvider by removing redundant hooks and state tr…
minyeamer d436b76
fix typeof guards in `ReactMarkdown` to resolve no-base-to-string lin…
minyeamer 6d7eb14
restore pnpm minimumReleaseAge setting
minyeamer ea53d86
UI: Fix markdown override behavior and Mermaid initialization
minyeamer 241ec23
Merge branch 'main' into ui/markdown-rendering
minyeamer 44c6acf
remove 3rd party licenses for markdown rendering
minyeamer 39dc0f1
UI: Move Mermaid markdown rendering from context provider to util
minyeamer 0f5935d
Docs: Add documentation hints for Markdown rendering support in the t…
minyeamer a3045a4
Merge branch 'main' into ui/markdown-rendering
minyeamer 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
Some comments aren't visible on the classic Files Changed page.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
78 changes: 78 additions & 0 deletions
78
airflow-core/src/airflow/example_dags/example_markdown_doc.py
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,78 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you 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 | ||
| # | ||
| # http://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. | ||
| """ | ||
| # Markdown Rendering Demo | ||
|
|
||
| Dag documentation is rendered from `doc_md` in the Airflow UI. | ||
|
|
||
| ## Features | ||
|
|
||
| - Inline code such as `task_id="extract"` | ||
| - Fenced code blocks with syntax highlighting | ||
| - Display math blocks delimited by `$$` | ||
| - Mermaid diagrams | ||
| - Markdown tables | ||
|
|
||
| ### Code | ||
|
|
||
| ```python | ||
| extract >> transform >> load | ||
| ``` | ||
|
|
||
| ### Math | ||
|
|
||
| $$ | ||
| y = \\beta_0 + \\beta_1 x_1 + \\beta_2 x_2 + \\epsilon | ||
| $$ | ||
|
|
||
| ### Mermaid | ||
|
|
||
| ```mermaid | ||
| flowchart LR | ||
| A[extract] --> B[transform] | ||
| B --> C[load] | ||
| ``` | ||
|
|
||
| ### Table | ||
|
|
||
| | Task | Purpose | | ||
| | --- | --- | | ||
| | `extract` | Read the source data | | ||
| | `transform` | Normalize the records | | ||
| | `load` | Publish the result | | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import pendulum | ||
|
|
||
| from airflow.providers.standard.operators.empty import EmptyOperator | ||
| from airflow.sdk import DAG | ||
|
|
||
| with DAG( | ||
| dag_id="example_markdown_doc", | ||
| schedule="@once", | ||
| start_date=pendulum.datetime(2021, 1, 1, tz="UTC"), | ||
| catchup=False, | ||
| tags=["example"], | ||
| doc_md=__doc__, | ||
| ) as dag: | ||
| extract = EmptyOperator(task_id="extract") | ||
| transform = EmptyOperator(task_id="transform") | ||
| load = EmptyOperator(task_id="load") | ||
|
|
||
| extract >> transform >> load |
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
|
minyeamer marked this conversation as 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.