Readmix (readmix v0.3.0)
Readmix is a tool for generating and maintaining documentation with dynamic content.
It allows you to embed special tags in your markdown or other text files that will be processed and replaced with generated content.
Basic Usage
# Create a new Readmix instance
rdmx = Readmix.new([])
# Update a file containing Readmix blocks
Readmix.update_file(rdmx, "README.md")
Block Format
Readmix blocks are defined in HTML comments with a special rdmx
prefix:
<!-- rdmx my_namespace:my_action param1:"value1" param2:$my_var -->
This content will be replaced by the generator.
<!-- rdmx my_namespace:my_action -->
Configuration
You can configure Readmix with custom generators, variables, and context modules:
Readmix.new(
generators: %{my_namespace: MyGeneratorModule},
vars: %{my_var: "hello"},
contexts: [MyContext | Readmix.default_contexts()]
)
Summary
Functions
Renders a block or a list of blocks as iodata without processing.
Returns the default backup directory for updated files.
Returns the default contexts used for built-in generators.
Types
Functions
Renders a block or a list of blocks as iodata without processing.
Returns the default backup directory for updated files.
Readmix will append the otp_app name to the path so it is safe to use the same directory for multiple applications.
Returns the default contexts used for built-in generators.
If you need to configure your own contexts but want to use Readmix generators as well, include those contexts in the configuration:
# config/dev.exs
import Config
config :readmix,
contexts: [MyContext1, MyContext2 | Readmix.default_contexts()]