diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..68cd3dfad --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "guides/membrane_tutorials"] + path = guides/membrane_tutorials + url = https://github.com/membraneframework/membrane_tutorials.git diff --git a/guides/membrane_tutorials b/guides/membrane_tutorials new file mode 160000 index 000000000..1ecc2ad2e --- /dev/null +++ b/guides/membrane_tutorials @@ -0,0 +1 @@ +Subproject commit 1ecc2ad2ecf6d2ae2425bfc16a86503e49efc2bf diff --git a/guides/components_lifecycle.md b/guides/useful_concepts/components_lifecycle.md similarity index 100% rename from guides/components_lifecycle.md rename to guides/useful_concepts/components_lifecycle.md diff --git a/guides/timer.md b/guides/useful_concepts/timer.md similarity index 100% rename from guides/timer.md rename to guides/useful_concepts/timer.md diff --git a/mix.exs b/mix.exs index 41de45678..cb471a592 100644 --- a/mix.exs +++ b/mix.exs @@ -59,21 +59,19 @@ defmodule Membrane.Mixfile do defp docs do [ main: "readme", - extras: [ - "README.md", - "CHANGELOG.md", - "CONTRIBUTING.md", - "guides/upgrading/v0.11.md", - "guides/upgrading/v0.12.md", - "guides/upgrading/v1.0.0-rc0.md", - "guides/upgrading/v1.0.0-rc1.md", - "guides/upgrading/v1.0.0.md", - "guides/components_lifecycle.md", - "guides/timer.md", - LICENSE: [title: "License"] - ], + extras: extras(), formatters: ["html"], source_ref: @source_ref, + assets: %{ + "guides/membrane_tutorials/get_started_with_membrane/assets" => "assets", + "guides/membrane_tutorials/basic_pipeline/assets" => "assets", + "guides/membrane_tutorials/basic_pipeline_extension/assets" => "assets", + "guides/membrane_tutorials/create_new_plugin/assets" => "assets", + "guides/membrane_tutorials/digital_video_introduction/assets" => "assets", + "guides/membrane_tutorials/h264/assets" => "assets", + "guides/membrane_tutorials/broadcasting/assets" => "assets", + "guides/membrane_tutorials/glossary/assets" => "assets" + }, nest_modules_by_prefix: [ Membrane.Bin, Membrane.Element, @@ -89,47 +87,93 @@ defmodule Membrane.Mixfile do Membrane.RCPipeline, Membrane.RCMessage ], - groups_for_modules: [ - Pipeline: [~r/^Membrane\.Pipeline($|\.)/], - "RC Pipeline": [ - ~r/^Membrane\.(RCPipeline)($|\.)/, - ~r/^Membrane\.(RCMessage)($|\.)/ - ], - Bin: [~r/^Membrane\.Bin($|\.)/], - Element: [ - ~r/^Membrane\.Filter($|\.)/, - ~r/^Membrane\.Endpoint($|\.)/, - ~r/^Membrane\.Sink($|\.)/, - ~r/^Membrane\.Source($|\.)/, - ~r/^Membrane\.Element($|\.)/ - ], - "Helper Elements": [ - ~r/^Membrane\.Connector($|\.)/, - ~r/^Membrane\.Fake($|\.)/, - ~r/^Membrane\.Debug($|\.)/, - ~r/^Membrane\.Tee($|\.)/, - ~r/^Membrane\.Funnel($|\.)/, - ~r/^Membrane\.FilterAggregator($|\.)/ - ], - Parent: [~r/^Membrane\.(Parent|ChildrenSpec)($|\.)/], - Child: [~r/^Membrane\.(Child|ChildEntry)($|\.)/], - Communication: [ - ~r/^Membrane\.(Buffer|Payload|StreamFormat|Event|EventProtocol|ChildNotification|ParentNotification|Pad|KeyframeRequestEvent|RemoteStream)($|\.)/ - ], - Logging: [~r/^Membrane\.Logger($|\.)/], - Telemetry: [~r/^Membrane\.Telemetry($|\.)/], - Testing: [~r/^Membrane\.Testing($|\.)/], - Utils: [ - ~r/^Membrane\.Clock($|\.)/, - ~r/^Membrane\.Sync($|\.)/, - ~r/^Membrane\.Time($|\.)/, - ~r/^Membrane\.Playback($|\.)/, - ~r/^Membrane\.ComponentPath($|\.)/, - ~r/^Membrane\.ResourceGuard($|\.)/, - ~r/^Membrane\.UtilitySupervisor($|\.)/ - ], - Errors: [~r/Error$/] - ] + groups_for_modules: groups_for_modules(), + groups_for_extras: groups_for_extras() + ] + end + + defp extras do + [ + "README.md", + "CHANGELOG.md", + "CONTRIBUTING.md", + Path.wildcard("guides/**/*.md") + |> Enum.reject(&(Path.basename(&1) in ["README.md", "index.md", "1_preface.md"])) + |> Enum.map(&{String.to_atom(&1), [title: reformat_tutorial_title(&1)]}), + LICENSE: [title: "License"] + ] + |> List.flatten() + end + + defp reformat_tutorial_title(filename) do + {first_letter, rest} = + filename + |> Path.basename() + |> String.replace(~r/^\d+_/, "") + |> String.replace("_", " ") + |> String.trim_trailing(".md") + |> String.next_grapheme() + + String.upcase(first_letter) <> rest + end + + defp groups_for_modules do + [ + Pipeline: [~r/^Membrane\.Pipeline($|\.)/], + "RC Pipeline": [ + ~r/^Membrane\.(RCPipeline)($|\.)/, + ~r/^Membrane\.(RCMessage)($|\.)/ + ], + Bin: [~r/^Membrane\.Bin($|\.)/], + Element: [ + ~r/^Membrane\.Filter($|\.)/, + ~r/^Membrane\.Endpoint($|\.)/, + ~r/^Membrane\.Sink($|\.)/, + ~r/^Membrane\.Source($|\.)/, + ~r/^Membrane\.Element($|\.)/ + ], + "Helper Elements": [ + ~r/^Membrane\.Connector($|\.)/, + ~r/^Membrane\.Fake($|\.)/, + ~r/^Membrane\.Debug($|\.)/, + ~r/^Membrane\.Tee($|\.)/, + ~r/^Membrane\.Funnel($|\.)/, + ~r/^Membrane\.FilterAggregator($|\.)/ + ], + Parent: [~r/^Membrane\.(Parent|ChildrenSpec)($|\.)/], + Child: [~r/^Membrane\.(Child|ChildEntry)($|\.)/], + Communication: [ + ~r/^Membrane\.(Buffer|Payload|StreamFormat|Event|EventProtocol|ChildNotification|ParentNotification|Pad|KeyframeRequestEvent|RemoteStream)($|\.)/ + ], + Logging: [~r/^Membrane\.Logger($|\.)/], + Telemetry: [~r/^Membrane\.Telemetry($|\.)/], + Testing: [~r/^Membrane\.Testing($|\.)/], + Utils: [ + ~r/^Membrane\.Clock($|\.)/, + ~r/^Membrane\.Sync($|\.)/, + ~r/^Membrane\.Time($|\.)/, + ~r/^Membrane\.Playback($|\.)/, + ~r/^Membrane\.ComponentPath($|\.)/, + ~r/^Membrane\.ResourceGuard($|\.)/, + ~r/^Membrane\.UtilitySupervisor($|\.)/ + ], + Errors: [~r/Error$/] + ] + end + + defp groups_for_extras do + [ + "Get started with Membrane": + Path.wildcard("guides/membrane_tutorials/get_started_with_membrane/*.md"), + "Intro to pipelines": Path.wildcard("guides/membrane_tutorials/basic_pipeline/*.md"), + "Intro to pipelines - advanced concepts": + Path.wildcard("guides/membrane_tutorials/basic_pipeline_extension/*.md"), + "Creating plugins": Path.wildcard("guides/membrane_tutorials/create_new_plugin/*.md"), + "Useful concepts": Path.wildcard("guides/useful_concepts/*.md"), + H264: Path.wildcard("guides/membrane_tutorials/h264/*.md"), + Broadcasting: Path.wildcard("guides/membrane_tutorials/broadcasting/*.md"), + Glossary: Path.wildcard("guides/membrane_tutorials/glossary/*.md"), + Upgrading: Path.wildcard("guides/upgrading/*.md") ] end