Skip to content

Commit 9fed5ac

Browse files
authored
Group modules in hex docs (#110)
1 parent 1b47735 commit 9fed5ac

File tree

8 files changed

+78
-19
lines changed

8 files changed

+78
-19
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Onvif
22

3+
[![Hex.pm](https://img.shields.io/hexpm/v/onvif.svg)](https://hex.pm/packages/onvif)
4+
[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/onvif)
5+
36
**Elixir interface for Onvif functions**
47

58
## Installation

lib/discovery.ex

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,19 @@ defmodule Onvif.Discovery do
2323
@onvif_scope_prefix "onvif://www.onvif.org/"
2424

2525
defmodule Probe do
26-
@type t :: %__MODULE__{}
26+
@moduledoc """
27+
A struct representing a discovered device.
28+
"""
29+
30+
@type t :: %__MODULE__{
31+
types: [String.t()],
32+
scopes: [String.t()],
33+
request_guid: String.t(),
34+
address: [String.t()],
35+
device_ip: String.t(),
36+
device_port: pos_integer()
37+
}
38+
2739
@derive Jason.Encoder
2840
defstruct [:types, :scopes, :request_guid, :address, :device_ip, :device_port]
2941
end

lib/factory.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
defmodule Onvif.Factory do
2+
@moduledoc false
3+
24
def device do
35
%Onvif.Device{
46
address: "http://192.168.254.89",

lib/middleware/digest_auth.ex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
defmodule Onvif.Middleware.DigestAuth do
2-
@moduledoc """
3-
This is a direct fork of the `Tesla.Middleware.DigestAuth`, which, does not build the
4-
[digest-response](https://datatracker.ietf.org/doc/html/rfc2617#section-3.2.2) in the order that
5-
the UniView LAPI accepts/understands.
6-
"""
2+
@moduledoc false
73

84
@behaviour Tesla.Middleware
95

lib/middleware/no_auth.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
defmodule Onvif.Middleware.NoAuth do
2-
@moduledoc """
3-
"""
2+
@moduledoc false
43

54
@behaviour Tesla.Middleware
65
import XmlBuilder

lib/middleware/plain_auth.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
defmodule Onvif.Middleware.PlainAuth do
2-
@moduledoc """
3-
"""
2+
@moduledoc false
43

54
@behaviour Tesla.Middleware
65
import XmlBuilder

lib/middleware/xml_auth.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
defmodule Onvif.Middleware.XmlAuth do
2-
@moduledoc """
3-
"""
2+
@moduledoc false
43

54
@behaviour Tesla.Middleware
65
import XmlBuilder

mix.exs

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
defmodule Onvif.MixProject do
22
use Mix.Project
33

4+
@github_url "https://github.com/hammeraj/onvif"
5+
46
def project do
57
[
68
app: :onvif,
@@ -11,16 +13,14 @@ defmodule Onvif.MixProject do
1113

1214
# ex_doc / hex
1315
name: "Onvif",
14-
source_url: "https://github.com/hammeraj/onvif",
16+
source_url: @github_url,
1517
description: "Elixir interface for Onvif functions",
16-
docs: [
17-
# The main page in the docs
18-
main: "Onvif",
19-
extras: ["README.md"]
20-
],
18+
docs: docs(),
2119
package: [
2220
licenses: ["BSD-3-Clause"],
23-
links: []
21+
links: %{
22+
"GitHub" => @github_url
23+
}
2424
]
2525
]
2626
end
@@ -46,4 +46,53 @@ defmodule Onvif.MixProject do
4646
{:mimic, "~> 1.7.4", only: :test}
4747
]
4848
end
49+
50+
defp docs do
51+
[
52+
main: "Onvif",
53+
extras: ["README.md"],
54+
nest_modules_by_prefix: [
55+
Onvif.Device,
56+
Onvif.Devices,
57+
Onvif.Devices.Schemas,
58+
Onvif.Media.Ver10,
59+
Onvif.Media.Ver10.Schemas,
60+
Onvif.Media.Ver20,
61+
Onvif.Media.Ver20.Schemas,
62+
Onvif.Recording,
63+
Onvif.Recording.Schemas,
64+
Onvif.Replay,
65+
Onvif.Replay.Schemas,
66+
Onvif.Search,
67+
Onvif.Search.Schemas
68+
],
69+
groups_for_modules: [
70+
Core: [
71+
Onvif,
72+
~r/^Onvif.Discovery.*/,
73+
Onvif.Device,
74+
Onvif.MacAddress,
75+
Onvif.Request
76+
],
77+
"Device Management": [
78+
~r/^Onvif.Devices.*/
79+
],
80+
Media10: [
81+
~r/^Onvif.Media.Ver10.*/
82+
],
83+
Media20: [
84+
~r/^Onvif.Media.Ver20.*/
85+
],
86+
Recording: [
87+
~r/^Onvif.Recording.*/
88+
],
89+
Replay: [
90+
~r/^Onvif.Replay.*/
91+
],
92+
Search: [
93+
~r/^Onvif.Search.*/
94+
]
95+
]
96+
]
97+
end
4998
end

0 commit comments

Comments
 (0)