diff --git a/README.md b/README.md index 589fb03..bf23dcd 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The code is based on the following projects: Most of the mj-* tags are supported. It's currently missing: - - mj-include: will be implemented + - ~~mj-include: will be implemented~~ implemented in 1.1.1 - mj-style: the inline attribute will be ignored - mj-html-attributes: will not be supported, as it requires a css selector @@ -38,14 +38,14 @@ maven: ch.digitalfondue.mjml4j mjml4j - 1.0.3 + 1.1.1 ``` gradle: ``` -implementation 'ch.digitalfondue.mjml4j:mjml4j:1.0.3' +implementation 'ch.digitalfondue.mjml4j:mjml4j:1.1.1' ``` # Use @@ -86,16 +86,25 @@ public class App { The `render` static method accept as a parameters: 1) a string which will be then parsed and processed by the [html5 parser (jfiveparse)](https://github.com/digitalfondue/jfiveparse), or it can accept a `org.w3c.dom.Document` -2) a configuration object with language and optionally direction +2) a configuration object with language, optionally a direction and an [IncludeResolver](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.IncludeResolver.html) + + +## mj-include support + +By default, mjml4j don't have an [IncludeResolver](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.IncludeResolver.html) configured, thus `mj-include` will not work out of the box, you must implement or specify yourself. +mjml4j offer 2 implementations: + - [FileSystemResolver](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.FileSystemResolver.html) if your resources are present on the filesystem + - [SimpleResourceResolver](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.SimpleResourceResolver.html) a resolver that need a [ResourceLoader](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.ResourceLoader.html) to be implemented # TODO: - - mj-include + - ~~mj-include~~ implemented in 1.1.1 - check https://github.com/mjmlio/mjml/compare/v4.14.1...v4.15.3 , printing especially - validation api: - add "parent element" check - attribute unit type check - improve the renderer - cleanup/rewrite the box model, kinda hacky + - more robust handling of invalid input (check mjml behaviour)