Commit bc19ffe
authored
Code snippets (#84)
* refactor: unify portal code-block component across skills/terraform/mcp
Skills, Terraform, and MCP install snippets now share a single code-block
component with consistent wrapper (gray header + copy button), tokens
palette (Mulesoft-style for keywords/tags/strings, Postman-style for
JSON keys/values), and Prism inclusion.
- Extract Prism includes into partials/prism_head.html (4 dupes -> 1).
- Rename terraform-code-wrapper/header/btn-copy to neutral
code-block-wrapper/header/copy-btn.
- Generalize wrapper JS via wrapCodeBlocksWithCopyHeader(selector); add
wrapMcpCodeBlocks for MCP install snippets.
- Replace MCP legacy mcp-install-block + btn-copy-install with the unified
wrapper to remove duplicated copy buttons.
- Consolidate token palette under .code-block-wrapper; JSON keeps Postman
red/blue via :not(.language-json) negation.
- Drop duplicated pre/code rules in step-prose, terraform-view-markdown,
and mcp-install-block (~80 lines removed).
APIs (Ace editors) intentionally out of scope; MCP config blocks keep
their existing in-line copy button to avoid changing modal UX.
* fix: resolve copyMcpCurlCommand collision and unify Ace editor palette
- Rename duplicate copyMcpCurlCommand (x-origin modal) to
copyXOriginMcpCurl, fixing silent failure on MCP try-it Copy cURL.
- Apply Postman JSON palette to Ace editors: red keys, blue string
values, dark blue for null/true/false.
- Remove active-line and gutter gray backgrounds from Ace editors.
- Unify Prism JSON boolean/keyword to same dark blue (#014486).
- Wrap .skill-view-markdown pre blocks (3 previously missed).
* chore: trigger CI rebuild
* fix: add skill-view-markdown class to step prose and remove max-width
- Add skill-view-markdown class to step_unified.html prose_before and
prose_after divs so code blocks in steps get wrapped by
wrapSkillCodeBlocks.
- Remove max-width from .skill-view-markdown to allow full-width content.
* fix: consistent white bg and borders for all code blocks and Ace editors
- Ace editors: force white bg on gutter/scroller/editor, add consistent
border and radius, remove active-line gray highlight.
- Response body/headers: white bg instead of gray-50, matching border
and radius with request editors.
- Code block snippets: switch to pre-wrap to eliminate horizontal scroll
on long lines (XML options, CLI commands).
- Add skill-view-markdown class to step_unified prose divs for wrapper
coverage.
- Remove max-width from .skill-view-markdown.
* feat: add skill.yaml metadata for prose skill type with full content rendering
- Create skills/mule-development/skill.yaml with type:prose — covers all
child skills via hierarchical resolution.
- Add _resolve_skill_type() to discovery.py: reads skill.yaml from skill
dir then parent dir, falls back to heuristic when absent.
- Add prose heading extraction and anchor injection to skill_parser.py:
_extract_prose_headings(), _inject_heading_ids(), shared _slugify().
- Generator uses explicit skill_type when present, heuristic fallback
otherwise — zero change for skills without metadata.
- skill_detail.html: prose branch renders full_content_html; JTBD branch
unchanged.
- skill_sidebar.html: prose skills show ## headings as nav links with
matching anchor hrefs.
* feat: on-demand skill ZIP download via JSZip and manifest
- Replace "Open Skill Markdown" with "Download Skill" button that
generates a ZIP on-demand in the browser using JSZip.
- Generator creates manifest.json per skill listing all files, and
copies full skill directory contents to portal output.
- Excludes node_modules, __pycache__, .git, .DS_Store from manifests.
- No pre-generated ZIP files — scales better as skill count grows.
* fix: exclude overview from prose sidebar, hide step badge, linkify related jobs
- skill_sidebar.html: exclude heading with id 'overview' from prose nav
(already shown as fixed link above).
- skill_card.html: hide step count badge for skills with type 'prose'.
- skill_parser.py: add _linkify_related_jobs() to convert **slug**:
patterns into clickable links in full_content_html.
* fix: skip code-block wrapper for mermaid diagrams
Exclude <pre> containing <code class="language-mermaid"> from
wrapCodeBlocksWithCopyHeader so Mermaid can replace them with SVG
without being trapped inside the code-block wrapper.
* feat: add skill-prose-content class and fix prose rendering
- Add .skill-prose-content CSS class with styles matching skill-subsection
(h2 = 24px bold, proper spacing, scroll-margin). Isolated from
.skill-view-markdown to avoid side-effects on JTBD skills.
- Use skill.skill_type == 'prose' (explicit) instead of prose_only
(heuristic) for full_content_html rendering — prose-by-fallback skills
keep section-based render.
- Hide h1 inside prose content (already shown in page header).
- Hide overview/prerequisites sections for explicit prose (already in
full_content_html).
- Add skill.yaml to anypoint-platform-operations with type: prose.
- Add .skill-prose-content pre to wrapSkillCodeBlocks selector.
* fix: remove skill-view-markdown class from step-prose in step_unified
Reverts the addition of skill-view-markdown to step-prose divs — it was
causing unintended margin-bottom on li elements in JTBD steps. The
code-block wrapping already works via .step-prose pre selector.
* fix: PR feedback - rename metadata, restore view markdown, fix copy, show H1
- Rename skill.yaml to skills-metadata.yaml (less confusing, supports
hierarchical override at any level).
- Restore "View Markdown" link alongside "Download Skill" in dropdown.
- Fix "Copy Skill" by passing skill_rel_path instead of slug (fixes
nested skills like mule-development/*).
- Show H1 title in prose skills (was hidden with display:none).1 parent 6f6b9fb commit bc19ffe
19 files changed
Lines changed: 536 additions & 195 deletions
File tree
- scripts
- portal_generator
- assets
- parsers
- templates
- homepage
- mcp
- partials
- skills
- tests
- skills
- anypoint-platform-operations
- mule-development
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
921 | | - | |
| 921 | + | |
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
| |||
4107 | 4107 | | |
4108 | 4108 | | |
4109 | 4109 | | |
4110 | | - | |
| 4110 | + | |
4111 | 4111 | | |
4112 | 4112 | | |
4113 | 4113 | | |
| |||
8450 | 8450 | | |
8451 | 8451 | | |
8452 | 8452 | | |
8453 | | - | |
8454 | | - | |
| 8453 | + | |
| 8454 | + | |
| 8455 | + | |
| 8456 | + | |
| 8457 | + | |
| 8458 | + | |
| 8459 | + | |
| 8460 | + | |
| 8461 | + | |
| 8462 | + | |
| 8463 | + | |
| 8464 | + | |
| 8465 | + | |
| 8466 | + | |
| 8467 | + | |
| 8468 | + | |
| 8469 | + | |
| 8470 | + | |
| 8471 | + | |
8455 | 8472 | | |
8456 | | - | |
| 8473 | + | |
8457 | 8474 | | |
8458 | | - | |
| 8475 | + | |
8459 | 8476 | | |
8460 | | - | |
| 8477 | + | |
8461 | 8478 | | |
8462 | 8479 | | |
8463 | 8480 | | |
| |||
8468 | 8485 | | |
8469 | 8486 | | |
8470 | 8487 | | |
8471 | | - | |
| 8488 | + | |
8472 | 8489 | | |
8473 | 8490 | | |
8474 | 8491 | | |
| |||
8604 | 8621 | | |
8605 | 8622 | | |
8606 | 8623 | | |
| 8624 | + | |
| 8625 | + | |
| 8626 | + | |
| 8627 | + | |
| 8628 | + | |
| 8629 | + | |
| 8630 | + | |
| 8631 | + | |
| 8632 | + | |
| 8633 | + | |
| 8634 | + | |
| 8635 | + | |
| 8636 | + | |
| 8637 | + | |
| 8638 | + | |
| 8639 | + | |
| 8640 | + | |
| 8641 | + | |
| 8642 | + | |
| 8643 | + | |
| 8644 | + | |
| 8645 | + | |
| 8646 | + | |
| 8647 | + | |
| 8648 | + | |
| 8649 | + | |
| 8650 | + | |
| 8651 | + | |
| 8652 | + | |
| 8653 | + | |
| 8654 | + | |
0 commit comments