Skip to content

Commit ce5eda3

Browse files
authored
Update ex_doc, add llms.txt support (#71)
* 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 ff1326c commit ce5eda3

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
@@ -15,7 +15,7 @@ The package can be installed by adding `membrane_opus_plugin` to your list of de
1515
```elixir
1616
def deps do
1717
[
18-
{:membrane_opus_plugin, "~> 0.20.7"}
18+
{:membrane_opus_plugin, "~> 0.20.8"}
1919
]
2020
end
2121
```

mix.exs

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

4-
@version "0.20.7"
4+
@version "0.20.8"
55
@github_url "https://github.com/membraneframework/membrane_opus_plugin"
66

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

@@ -45,7 +46,7 @@ defmodule Membrane.Opus.Plugin.Mixfile do
4546
{:bundlex, "~> 1.2"},
4647
{:membrane_precompiled_dependency_provider, "~> 0.2.0"},
4748
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
48-
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
49+
{:ex_doc, ">= 0.40.0", only: :dev, runtime: false},
4950
{:credo, ">= 0.0.0", only: :dev, runtime: false},
5051
{:membrane_file_plugin, "~> 0.16.0", only: :test},
5152
{:membrane_raw_audio_parser_plugin, "~> 0.4.0", only: :test}
@@ -82,10 +83,31 @@ defmodule Membrane.Opus.Plugin.Mixfile do
8283
defp docs do
8384
[
8485
main: "readme",
85-
formatters: ["html"],
8686
extras: ["README.md", "LICENSE"],
8787
source_ref: "v#{@version}",
8888
nest_modules_by_prefix: [Membrane.Opus]
8989
]
9090
end
91+
92+
defp append_llms_links(_args) do
93+
output_dir = docs()[:output] || "doc"
94+
path = Path.join(output_dir, "llms.txt")
95+
96+
if File.exists?(path) do
97+
existing = File.read!(path)
98+
99+
footer = """
100+
101+
102+
## See Also
103+
104+
- [Membrane Framework AI Skill](https://hexdocs.pm/membrane_core/skill.md)
105+
- [Membrane Core](https://hexdocs.pm/membrane_core/llms.txt)
106+
"""
107+
108+
File.write!(path, String.trim_trailing(existing) <> footer)
109+
else
110+
IO.warn("#{path} not found — llms.txt was not generated, check your ex_doc configuration")
111+
end
112+
end
91113
end

0 commit comments

Comments
 (0)