Readmix (readmix v0.4.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 scope modules:
Readmix.new(
generators: %{my_namespace: MyGeneratorModule},
vars: %{my_var: "hello"},
env: [MyScope | Readmix.default_scopes()]
)
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 scopes 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 scopes used for built-in generators.
If you need to configure your own scopes but want to use default Readmix scopes as well, include these in the configuration:
# config/dev.exs
import Config
config :readmix,
scopes: [MyScope1, MyScope2 | Readmix.default_scopes()]