Readmix.Generators.BuiltIn (readmix v0.3.0)
Implements the built-in generators for Readmix.
Readmix Actions
app_dep
Generates a fenced code block for the deps
function in mix.exs
, pulling a
package from hex.pm.
Parameters
:otp_app
(String.t/0
) - The OTP application to use in the dependency tuple. Defaults to the current application.:vsn
(String.t/0
) - The version number to use. Defaults to the current version of the OTP application.:comma
(boolean/0
) - Include a comma after the dependency tuple. The default value istrue
.:patch
(boolean/0
) - Include the patch in the version number in the dependency tuple. The default value isfalse
.:only
(String.t/0
) - Adds the:only
option to the dependency tuple. Multiple environments can be separated with commas.:runtime
(boolean/0
) - Whenfalse
, adds theruntime: false
option to the dependency tuple.
badges
Generates badges with img.shields.io
.
Badges are generated in the order of the action params.
Parameters
:hexpm
(String.t/0
) - Generates a badge linking to hex.pm.Requires a package name and an optional query string for customization.
Example:
"readmix?color=4e2a8e"
.:github_action
(String.t/0
) - Generates a badge linking to the latest Github Action.Requires a package name and an optional query string for customization and limiting to a branch name.
Example:
"lud/readmix/elixir.yaml?label=CI&branch=main"
.:license
(String.t/0
) - Generates a badge linking to a license for an Elixir package.Requires an hex.pm package name.
Example:
"readmix"
.
section
Defines a named section for extraction with Readmix.Docs.extract_section/2
.
The section itself doesn't transform content but allows nested blocks to be processed.
Note that uniqueness of names is not enforced.
Parameters
:name
(String.t/0
) - Required. The name of the section