Skip to content

Commit 0c8ac36

Browse files
authored
Update ex_doc, add llms.txt support (#16)
* 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 7c13b0b commit 0c8ac36

3 files changed

Lines changed: 46 additions & 24 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_vpx_plugin` to your list of dep
1515
```elixir
1616
def deps do
1717
[
18-
{:membrane_vpx_plugin, "~> 0.4.3"}
18+
{:membrane_vpx_plugin, "~> 0.4.4"}
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.VPx.Plugin.Mixfile do
22
use Mix.Project
33

4-
@version "0.4.3"
4+
@version "0.4.4"
55
@github_url "https://github.com/membraneframework/membrane_vpx_plugin"
66

77
def project do
@@ -23,7 +23,8 @@ defmodule Membrane.VPx.Plugin.Mixfile do
2323
name: "Membrane VPx 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

@@ -48,7 +49,7 @@ defmodule Membrane.VPx.Plugin.Mixfile do
4849
{:membrane_raw_video_parser_plugin, "~> 0.12.1", only: :test},
4950
{:membrane_file_plugin, "~> 0.17.0", only: :test},
5051
{:membrane_realtimer_plugin, "~> 0.9.0", only: :test},
51-
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
52+
{:ex_doc, ">= 0.40.0", only: :dev, runtime: false},
5253
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
5354
{:credo, ">= 0.0.0", only: :dev, runtime: false}
5455
]
@@ -84,9 +85,30 @@ defmodule Membrane.VPx.Plugin.Mixfile do
8485
[
8586
main: "readme",
8687
extras: ["README.md", "LICENSE"],
87-
formatters: ["html"],
8888
source_ref: "v#{@version}",
8989
nest_modules_by_prefix: [Membrane.VPx]
9090
]
9191
end
92+
93+
defp append_llms_links(_args) do
94+
output_dir = docs()[:output] || "doc"
95+
path = Path.join(output_dir, "llms.txt")
96+
97+
if File.exists?(path) do
98+
existing = File.read!(path)
99+
100+
footer = """
101+
102+
103+
## See Also
104+
105+
- [Membrane Framework AI Skill](https://hexdocs.pm/membrane_core/skill.md)
106+
- [Membrane Core](https://hexdocs.pm/membrane_core/llms.txt)
107+
"""
108+
109+
File.write!(path, String.trim_trailing(existing) <> footer)
110+
else
111+
IO.warn("#{path} not found — llms.txt was not generated, check your ex_doc configuration")
112+
end
113+
end
92114
end

0 commit comments

Comments
 (0)