mirror of
https://github.com/ash-project/igniter.git
synced 2024-09-19 13:02:51 +12:00
docs: update docs on source code vs values
This commit is contained in:
parent
14552bcef9
commit
927f0d4ae3
1 changed files with 18 additions and 0 deletions
|
@ -8,6 +8,8 @@ defmodule Igniter.Project.Config do
|
|||
@doc """
|
||||
Sets a config value in the given configuration file, if it is not already set.
|
||||
|
||||
See `configure/6` for more.
|
||||
|
||||
## Opts
|
||||
|
||||
* `failure_message` - A message to display to the user if the configuration change is unsuccessful.
|
||||
|
@ -28,6 +30,22 @@ defmodule Igniter.Project.Config do
|
|||
@doc """
|
||||
Sets a config value in the given configuration file, updating it with `updater` if it is already set.
|
||||
|
||||
If the value is source code, pass `{:code, value}`, otherwise pass just the value.
|
||||
|
||||
To produce this source code, we suggest using `Sourceror.parse_string!`. For example:
|
||||
|
||||
```elixir
|
||||
|> Igniter.Project.Config.configure(
|
||||
"fake.exs",
|
||||
:tailwind,
|
||||
[:default, :args],
|
||||
{:code,
|
||||
Sourceror.parse_string!(\"\"\"
|
||||
~w(--config=tailwind.config.js --input=css/app.css --output=../output/assets/app.css)
|
||||
\"\"\")}
|
||||
)
|
||||
```
|
||||
|
||||
## Opts
|
||||
|
||||
* `:updater` - A function that takes a zipper at a currently configured value and returns a new zipper with the value updated.
|
||||
|
|
Loading…
Reference in a new issue