Skip to content

v1.3.0: scorecard + mobile fix, fold in PRs, esbuild + nix flake#29

Merged
gregzuro merged 1 commit into
masterfrom
polish-v1.3.0
May 14, 2026
Merged

v1.3.0: scorecard + mobile fix, fold in PRs, esbuild + nix flake#29
gregzuro merged 1 commit into
masterfrom
polish-v1.3.0

Conversation

@gregzuro
Copy link
Copy Markdown
Owner

v1.3.0: scorecard + mobile fix, fold in PRs, esbuild + nix flake

Polishes the plugin to clear the community-plugin-page scorecard
(60% HealthFair/ReviewCaution) and resolve the open issue/PR backlog.

Rendering

Folded-in PRs

  • @from_file: include keyword (PR add include option and resizing #25), via
    getAbstractFileByPath + instanceof TFile + cachedRead (no
    minAppVersion bump). Missing file -> inline .kroki-error.
  • Per-diagram PNG download + niolesk Edit links (PR add png link and niolesk png button #19 #20), built with
    DOM helpers, styled in styles.css.
  • New diagram types DBML, Symbolator, TikZ (PR Updates #23) + kroki-test.md
    examples; replace the broken UMlet example with a working
    modern-schema one ( / UMLClass).
    Wrap the TikZ example in \documentclass{standalone} + \begin{document}.
  • Browser base64 (PR switch to browser base64 methods #26) -- superseded by the chunk-safe implementation.

Per-type header inputs

  • The legacy single 'header' setting (inherited from upstream
    obsidian-plantuml, never actually applied here) was the wrong shape:
    each of the four languages that accept top-of-source directives
    (PlantUML, C4-PlantUML, Structurizr, Mermaid) has its own syntax,
    and the other ~25 types break on any prelude.
  • Replace it with settings.headers: Record<kroki, string>, populated
    via a dedicated full-width textarea inside each supported diagram
    type's own settings card. Per-type placeholder + help text.
  • Diagram types not in HEADER_SUPPORTED_TYPES show no header field
    and receive no prepend.
  • loadSettings migrates the legacy 'header' value into
    headers.plantuml on first load and drops the old field.

Settings tab

  • Setting.setHeading() instead of raw createEl("h3") /

    .

  • New 'White background' toggle adding .kroki-bg-white (Change background color? #2 -- helps
    with transparent SVGs on dark themes).
  • Per-type inline header textarea (full-width, vertically resizable,
    monospaced) inside each supported diagram type's card.
  • Remove all console.log; remove dead img/useMap code; remove the
    unused 'toggle' field that was being persisted into data.json.

Styles

  • New CSS: .kroki-diagram (centered, max-width:100% -- Scaling #7),
    .kroki-bg-white, .kroki-actions, .kroki-error, .kroki-header-row,
    .setting-item.kroki-with-header (flex-wrap to let the header row
    sit full-width).

Build + dev shell

  • rollup -> esbuild (esbuild.config.mjs); delete rollup.config.js.
  • Bump deps: typescript@5, @types/node@22, eslint@8 +
    @typescript-eslint@7, pako@2, tslib, esbuild, builtin-modules.
  • Modernise tsconfig.json: target ES2018, strictNullChecks,
    isolatedModules, skipLibCheck.
  • Add Nix flake dev shell (flake.nix + flake.lock + .envrc) with
    Node 22 via nix develop.

CI / release workflows

  • main.yml + publish.yml: actions/checkout@v4, actions/setup-node@v4
    with Node 22, npm (not yarn), softprops/action-gh-release@v2.
    Drop the deprecated actions/create-release@v1 +
    actions/upload-release-asset@v1 and the ::set-output usage.
  • publish.yml now uploads only main.js / manifest.json / styles.css
    (no zip -- Obsidian doesn't need it).
  • main.yml also runs npm run build so type errors fail CI.

Docs

  • README: new 'Supported diagram types' table near the top (all 29
    types, linked to their upstream projects, with notes for the three
    default-disabled types).
  • README + kroki-test.md: note that diagramsnet requires a self-hosted
    Kroki with the yuzutech/kroki-diagramsnet companion (public kroki.io
    returns 503), and that mermaid / plantuml are disabled by default to
    avoid clashing with Obsidian / the PlantUML plugin.
  • README: explain the per-type inline header inputs.

Version

  • manifest.json + package.json -> 1.3.0.
  • versions.json adds "1.3.0": "0.13.25" (minAppVersion unchanged).

Closes #2, #7, #8, #9. Supersedes PRs #20, #23, #25, #26.

Polishes the plugin to clear the community-plugin-page scorecard
(60% HealthFair/ReviewCaution) and resolve the open issue/PR backlog.

Rendering
- Drop `Buffer` (Node-only, threw on mobile) for chunk-safe browser
  base64 (0x8000-byte chunks, then btoa). Fixes #8.
- Drop `dest.innerHTML = result` (the headline scorecard flag).
  Desktop now fetches the SVG via `request()`, parses with DOMParser,
  and appends the parsed <svg> so in-SVG links / imagemaps stay
  clickable (#9). On mobile (`Platform.isMobile`) or on any parse
  failure, fall back to <img src=krokiUrl>. If Kroki returns a non-SVG
  body (e.g. a syntax error), the error text is rendered inline in a
  .kroki-error block instead of a broken-image icon.

Folded-in PRs
- @from_file:<vault-relative path> include keyword (PR #25), via
  getAbstractFileByPath + instanceof TFile + cachedRead (no
  minAppVersion bump). Missing file -> inline .kroki-error.
- Per-diagram PNG download + niolesk Edit links (PR #20), built with
  DOM helpers, styled in styles.css.
- New diagram types DBML, Symbolator, TikZ (PR #23) + kroki-test.md
  examples; replace the broken UMlet example with a working
  modern-schema one (<diagram program="umletino"> / <id>UMLClass</id>).
  Wrap the TikZ example in \documentclass{standalone} + \begin{document}.
- Browser base64 (PR #26) -- superseded by the chunk-safe implementation.

Per-type header inputs
- The legacy single 'header' setting (inherited from upstream
  obsidian-plantuml, never actually applied here) was the wrong shape:
  each of the four languages that accept top-of-source directives
  (PlantUML, C4-PlantUML, Structurizr, Mermaid) has its own syntax,
  and the other ~25 types break on any prelude.
- Replace it with settings.headers: Record<kroki, string>, populated
  via a dedicated full-width textarea inside each supported diagram
  type's own settings card. Per-type placeholder + help text.
- Diagram types not in HEADER_SUPPORTED_TYPES show no header field
  and receive no prepend.
- loadSettings migrates the legacy 'header' value into
  headers.plantuml on first load and drops the old field.

Settings tab
- Setting.setHeading() instead of raw createEl("h3") / <p>.
- New 'White background' toggle adding .kroki-bg-white (#2 -- helps
  with transparent SVGs on dark themes).
- Per-type inline header textarea (full-width, vertically resizable,
  monospaced) inside each supported diagram type's card.
- Remove all console.log; remove dead img/useMap code; remove the
  unused 'toggle' field that was being persisted into data.json.

Styles
- New CSS: .kroki-diagram (centered, max-width:100% -- #7),
  .kroki-bg-white, .kroki-actions, .kroki-error, .kroki-header-row,
  .setting-item.kroki-with-header (flex-wrap to let the header row
  sit full-width).

Build + dev shell
- rollup -> esbuild (esbuild.config.mjs); delete rollup.config.js.
- Bump deps: typescript@5, @types/node@22, eslint@8 +
  @typescript-eslint@7, pako@2, tslib, esbuild, builtin-modules.
- Modernise tsconfig.json: target ES2018, strictNullChecks,
  isolatedModules, skipLibCheck.
- Add Nix flake dev shell (flake.nix + flake.lock + .envrc) with
  Node 22 via `nix develop`.

CI / release workflows
- main.yml + publish.yml: actions/checkout@v4, actions/setup-node@v4
  with Node 22, npm (not yarn), softprops/action-gh-release@v2.
  Drop the deprecated actions/create-release@v1 +
  actions/upload-release-asset@v1 and the ::set-output usage.
- publish.yml now uploads only main.js / manifest.json / styles.css
  (no zip -- Obsidian doesn't need it).
- main.yml also runs npm run build so type errors fail CI.

Docs
- README: new 'Supported diagram types' table near the top (all 29
  types, linked to their upstream projects, with notes for the three
  default-disabled types).
- README + kroki-test.md: note that diagramsnet requires a self-hosted
  Kroki with the yuzutech/kroki-diagramsnet companion (public kroki.io
  returns 503), and that mermaid / plantuml are disabled by default to
  avoid clashing with Obsidian / the PlantUML plugin.
- README: explain the per-type inline header inputs.

Version
- manifest.json + package.json -> 1.3.0.
- versions.json adds "1.3.0": "0.13.25" (minAppVersion unchanged).

Closes #2, #7, #8, #9. Supersedes PRs #20, #23, #25, #26.
Copy link
Copy Markdown
Owner Author

@gregzuro gregzuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gregzuro gregzuro merged commit 4dbe95e into master May 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diagrams don’t render on Obsidian mobile Change background color?

1 participant