Skip to content

RapidTransit/intellij-mjml-support

 
 

Repository files navigation

intellij-mjml-support

CircleCI Version Downloads Rating Renovate Quality Gate Status Reliability Rating

MJML support for the IntelliJ Platform.

You are missing something or something is broken? - Feel free to file a PR/issue or open a discussion on GitHub!

What's in the box?

Fore more details please look up the plugin description in the marketplace or directly in the plugin.xml.

How can I use it?

  1. Install it from the plugin repository
  2. You are done, enjoy the magic!

The generated HTML can be viewed by clicking on the "Show HTML" button in the toolbar of the tool window.

You live on the edge?

There is also the channel snapshot (https://plugins.jetbrains.com/plugins/snapshot/list) available, for more details about set up please see JetBrains Marketplace Docs

The versioning used there is not based on semantic versioning, but rather: YYYY.MM.DD-BUILDNUM and is on

Extension

Custom mjml resolution

You want to add custom mjml tags or custom resolving to match your needs?

Simply use the extension point de.timo_reymann.intellij-mjml-support.tagInformationProvider:

<extensions defaultExtensionNs="de.timo_reymann.intellij-mjml-support">
    <tagInformationProvider implementation="my.company.OurCustomTaginformationProvider"/>
</extensions>

Custom rendering

  • Execution context: parent folder for file to render
  • Input from stdin:
      {
        "directory": "absolute path to project root, this might be different from the current file location",
        "content": "file editor content to render",
        "options": {
          "mjmlConfigPath": "mjml config path or empty string"
        }
      }
  • Output to stdout must be in json in this format for:
      {
        "html": "string|null",
        "errors": [
          {
            "line": "integr|null",
            "message":  "string|null",
            "tagName": "string|null",
            "formattedMessage": "string|null"
          } 
        ]
      }
    where errors can be empty, but can never be omitted!

Notes about implementation

  • The preview editor support is adapted from the official markdown plugin
  • Preview uses bundled node_modules for mjml rendering currently, support for custom rendering is currently in development

For architecture decision records please take a look at docs/adr, this will give you an idea why implementations are as they are.

About

MJML support for the IntelliJ Platform.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 97.1%
  • JavaScript 1.8%
  • Other 1.1%