Skip to content

Commit adfcfb5

Browse files
authored
Update ex_doc, add llms.txt support (#55)
* Update ex_doc, add llms.txt support, update description * Set ex_doc dependency to >= 0.40.0 * Rename prepend_llms_links to append_llms_links
1 parent 616f30a commit adfcfb5

3 files changed

Lines changed: 45 additions & 23 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ sudo apt-get install libmad0-dev
2727
Then, add the following line to your `deps` in `mix.exs`:
2828

2929
```elixir
30-
{:membrane_audio_mix_plugin, "~> 0.16.4"}
30+
{:membrane_audio_mix_plugin, "~> 0.16.5"}
3131
```
3232

3333
and run `mix deps.get`.

mix.exs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Membrane.AudioMix.Mixfile do
22
use Mix.Project
33

4-
@version "0.16.4"
4+
@version "0.16.5"
55
@github_url "https://github.com/membraneframework/membrane_audio_mix_plugin"
66

77
def project do
@@ -23,7 +23,8 @@ defmodule Membrane.AudioMix.Mixfile do
2323
name: "Membrane Audio Mix plugin",
2424
source_url: @github_url,
2525
homepage_url: "https://membraneframework.org",
26-
docs: docs()
26+
docs: docs(),
27+
aliases: [docs: ["docs", &append_llms_links/1]]
2728
]
2829
end
2930

@@ -43,7 +44,7 @@ defmodule Membrane.AudioMix.Mixfile do
4344
{:membrane_raw_audio_format, "~> 0.12.0"},
4445
{:unifex, "~> 1.0"},
4546
{:bunch, "~> 1.3"},
46-
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
47+
{:ex_doc, ">= 0.40.0", only: :dev, runtime: false},
4748
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
4849
{:credo, ">= 0.0.0", only: :dev, runtime: false},
4950
{:membrane_file_plugin, "~> 0.16.0", only: :test},
@@ -82,7 +83,6 @@ defmodule Membrane.AudioMix.Mixfile do
8283
[
8384
main: "readme",
8485
extras: ["README.md", "LICENSE"],
85-
formatters: ["html"],
8686
source_ref: "v#{@version}",
8787
nest_modules_by_prefix: [
8888
Membrane.AudioMixer,
@@ -99,4 +99,26 @@ defmodule Membrane.AudioMix.Mixfile do
9999
]
100100
]
101101
end
102+
103+
defp append_llms_links(_args) do
104+
output_dir = docs()[:output] || "doc"
105+
path = Path.join(output_dir, "llms.txt")
106+
107+
if File.exists?(path) do
108+
existing = File.read!(path)
109+
110+
footer = """
111+
112+
113+
## See Also
114+
115+
- [Membrane Framework AI Skill](https://hexdocs.pm/membrane_core/skill.md)
116+
- [Membrane Core](https://hexdocs.pm/membrane_core/llms.txt)
117+
"""
118+
119+
File.write!(path, String.trim_trailing(existing) <> footer)
120+
else
121+
IO.warn("#{path} not found — llms.txt was not generated, check your ex_doc configuration")
122+
end
123+
end
102124
end

0 commit comments

Comments
 (0)