Conversation
- an edge label naming a Taipei metro line paints that segment and its label in the line's color - add the --mrt-* tokens; blue, green, orange and brown reuse the category colors, red is calibrated to the same lightness - move diagram styling into themeCSS: paper stations, rounded corners, line-strong outlines and markers - mark the destination station with class dest, drawn as a solid ink pill - reserve the block height before mermaid renders so the source no longer flashes - center wide diagrams with an auto margin; justify-content clipped the left edge out of scroll reach - name the platform direction in the transfer tabs - record both diagram conventions in the syntax spec
- the placeholder hid the block until mermaid set data-processed, so a failed import or render left an empty box behind - flag the blocks mermaid never processed and let their source through again
feat(Mermaid): color the metro route diagram by line
Greptile SummaryThis PR adds token-based Taipei MRT line colors and applies them to Mermaid edges after client-side rendering, while improving terminal-node styling and failure/mobile presentation.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable issues identified. The rendering, styling, fallback, documentation, and article changes remain aligned, and the investigated Mermaid integration concerns did not establish a reachable observable failure.
|
| Filename | Overview |
|---|---|
| src/scripts/content.ts | Adds Mermaid theme configuration, MRT label-to-token mapping, post-render edge coloring, and render-failure fallback behavior. |
| src/styles/markdown.css | Improves Mermaid overflow behavior, establishes a mobile minimum width, and hides source only while client rendering is pending. |
| src/styles/tokens.css | Adds centralized color tokens for the six documented Taipei MRT lines. |
| src/content/articles/transportation.md | Clarifies train directions and updates the route diagram to use shaped nodes and destination styling. |
| docs/spec/SPEC.md | Documents the MRT edge-label convention and destination-node class used by the rendering enhancement. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Markdown Mermaid diagram] --> B[Client-side Mermaid rendering]
B --> C[Rendered inline SVG]
C --> D[Match edge labels to MRT tokens]
D --> E[Apply route colors and terminal styling]
B -->|Rendering fails| F[Expose readable Mermaid source]
Reviews (1): Last reviewed commit: "Merge pull request #24 from NTUST-OpenSo..." | Re-trigger Greptile
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request improves the rendering and theming of Taipei MRT line diagrams in the documentation, ensuring consistent use of line colors, better mobile handling, and clearer visual distinction of terminal stations. It introduces a system to automatically color metro lines in Mermaid diagrams based on their names, updates the relevant CSS and JavaScript, and clarifies usage instructions in the documentation.
Metro diagram theming and rendering improvements:
tokens.css, ensuring each line's color matches the site's palette and meets accessibility standards. (src/styles/tokens.css)src/scripts/content.ts)src/scripts/content.ts)src/styles/markdown.css)Documentation and usage clarification:
SPEC.mdto specify that line colors are always applied via tokens incontent.ts, and established conventions for labeling lines and marking terminal stations. (docs/spec/SPEC.md)src/content/articles/transportation.md) [1] [2]