Skip to content

Commit b147d41

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

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
@@ -18,7 +18,7 @@ Note: `Membrane.H264.FFmpeg.Parser` has been removed. Now you can use our pure E
1818
Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.
1919

2020
```elixir
21-
{:membrane_h264_ffmpeg_plugin, "~> 0.32.6"}
21+
{:membrane_h264_ffmpeg_plugin, "~> 0.32.7"}
2222
```
2323

2424
This package depends on the [ffmpeg](https://www.ffmpeg.org) libraries. The precompiled builds will be pulled and linked automatically. However, should there be any problems, consider installing it manually.

mix.exs

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

4-
@version "0.32.6"
4+
@version "0.32.7"
55
@github_url "https://github.com/membraneframework/membrane_h264_ffmpeg_plugin"
66

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

@@ -46,7 +47,7 @@ defmodule Membrane.H264.FFmpeg.Plugin.MixProject do
4647
{:membrane_common_c, "~> 0.16.0"},
4748
{:membrane_h264_format, "~> 0.6.1"},
4849
{:membrane_raw_video_format, "~> 0.4.1"},
49-
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
50+
{:ex_doc, ">= 0.40.0", only: :dev, runtime: false},
5051
{:credo, ">= 0.0.0", only: :dev, runtime: false},
5152
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
5253
{:membrane_raw_video_parser_plugin, "~> 0.12.2", only: :test},
@@ -73,7 +74,6 @@ defmodule Membrane.H264.FFmpeg.Plugin.MixProject do
7374
[
7475
main: "readme",
7576
extras: ["README.md"],
76-
formatters: ["html"],
7777
source_ref: "v#{@version}",
7878
nest_modules_by_prefix: [
7979
Membrane.H264.FFmpeg
@@ -93,4 +93,26 @@ defmodule Membrane.H264.FFmpeg.Plugin.MixProject do
9393
exclude_patterns: [~r"c_src/.*/_generated.*"]
9494
]
9595
end
96+
97+
defp append_llms_links(_args) do
98+
output_dir = docs()[:output] || "doc"
99+
path = Path.join(output_dir, "llms.txt")
100+
101+
if File.exists?(path) do
102+
existing = File.read!(path)
103+
104+
footer = """
105+
106+
107+
## See Also
108+
109+
- [Membrane Framework AI Skill](https://hexdocs.pm/membrane_core/skill.md)
110+
- [Membrane Core](https://hexdocs.pm/membrane_core/llms.txt)
111+
"""
112+
113+
File.write!(path, String.trim_trailing(existing) <> footer)
114+
else
115+
IO.warn("#{path} not found — llms.txt was not generated, check your ex_doc configuration")
116+
end
117+
end
96118
end

0 commit comments

Comments
 (0)