diff --git a/docs/2023-09-15-open-an-iex-shell-from-an-elixir-script.md b/docs/2023-09-15-open-an-iex-shell-from-an-elixir-script.md index 20a4aa1..dd80f90 100644 --- a/docs/2023-09-15-open-an-iex-shell-from-an-elixir-script.md +++ b/docs/2023-09-15-open-an-iex-shell-from-an-elixir-script.md @@ -1,6 +1,10 @@ --- title: "Open An IEx Shell From An Elixir Script" -blurb: "We can run an Elixir script with either the elixir or the iex command. Both will execute the code, but the second command opens an interactive IEx shell afterward. What if, we won't know until runtime whether we want a shell or not? How can we start an IEx session even when we use elixir, instead of iex, to run our script?" +blurb: "We can run an Elixir script with either the `elixir` or the +`iex` command. Both will execute the code, but the second command +opens an interactive IEx shell afterward. What if, we won't know until runtime +whether we want a shell or not? How can we start an IEx session even when we +use `elixir`, instead of `iex`, to run our script?" ... I recently had occasion to want to start an IEx session from an Elixir script. Here's how I was able to do it. diff --git a/site.moon b/site.moon index 29e69f1..371be91 100644 --- a/site.moon +++ b/site.moon @@ -17,15 +17,8 @@ Site.config.out_dir = "html/" rend = "renderers.markdown" require(rend).cmd = "pandoc --mathjax >" --- Replace the default markdown renderer with our custom renderer --- TODO we shouldn't remove it because it is still searched for in some places --- example https://github.com/leafo/sitegen/blob/ac9b7c199ed7adb32064b056a438cbaed8c71d23/sitegen/renderers/html.moon#L53 --- Site.default_renderers = for v in *Site.default_renderers - -- if v\find "markdown" then rend else v - -table.insert Site.default_renderers, 1, "renderers.markdown" - -p Site.default_renderers +-- Insert custom renderer in the first position so it will be preferred +table.insert Site.default_renderers, 1, rend -- Remove "pygments" plugin because it conflicts with pandoc syntax highlighting Site.default_plugins = for v in *Site.default_plugins