Skip to content

Conversation

@nzoschke
Copy link

Fixes #151

Note this was coded with Claude

in @src/wasm_plugin.rs make tag_to_extension also support using the config to map extensions to plugins. An example config to support a new cue tag and plugin is:

  {
    "markdown": {
      "tags": {
        "cue": "cue",
        "cuelang": "cue"
      }
    },
    "plugins": [
      "https://plugins.dprint.dev/typescript-0.95.11.wasm",
      "https://plugins.dprint.dev/json-0.20.0.wasm",
      "https://plugins.dprint.dev/markdown-0.19.0.wasm",
      "https://plugins.dprint.dev/cue-0.1.0.wasm"
    ]
  }

@nzoschke
Copy link
Author

nzoschke commented Oct 25, 2025

I tested this is working with this config:

  • local build of the markdown plugin as markdown-0.20.1.wasm
  • markdown plugin config with tags section
  • exec plugin config with with cue section
{
  "typescript": {},
  "json": {},
  "markdown": {
    "tags": {
      "cue": "cue",
      "cuelang": "cue"
    }
  },
  "toml": {},
  "malva": {},
  "markup": {},
  "yaml": {},
  "excludes": ["**/node_modules", "**/*-lock.json"],
  "exec": {
    "commands": [
      {
        "command": "cue fmt -",
        "exts": ["cue"]
      }
    ]
  },
  "plugins": [
    "https://plugins.dprint.dev/typescript-0.95.11.wasm",
    "https://plugins.dprint.dev/json-0.21.0.wasm",
    "./markdown-0.20.1.wasm",
    "https://plugins.dprint.dev/toml-0.7.0.wasm",
    "https://plugins.dprint.dev/g-plane/malva-v0.14.3.wasm",
    "https://plugins.dprint.dev/g-plane/markup_fmt-v0.24.0.wasm",
    "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
    "https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0"
  ]
}

@nzoschke nzoschke marked this pull request as ready for review October 25, 2025 14:37
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.

Support more code fence formatter plugins

1 participant