Closed dalewking closed 4 years ago
Since this generates multiple instances of the markdownToHtml task it is a little more work to configure them. You will likely want to add something like this to do configuration:
tasks.withType(MarkdownToHtmlTask).all { task ->
task.inputEncoding = "utf8"
task.configuration =
[
hardWraps: true,
autoLinks: true,
]
}
Since I just spent a couple hours figuring out how to use your plugin to generate HTML to be used in an Android app, I thought I would pass it along so that you could document it in your readme.
The scheme I am detailing here will place the output as resource directories in the application. Some people will think that the generated HTML should go in the assets directory, but that is not a good practice because the assets directory cannot be translated. The proper place to store them on Android is as raw resources so you can provide different languages and possibly even different versions for different screen sizes.
To add markdown you create a markdown folder in the src directory of the source set. For example, src/main/markdown. Because this is for android resources you will want to put your markdown in a raw forlder inside that directory (src/main/markdown/raw)
Then you will need to add these lines to the build.gradle for the module: