-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
Is there a way to link this into ex_doc such that the message structure is included in the generated documentation?
For example
defmodule Messages do
@moduledoc """
Some documentation
"""
use Protobuf, """
message Msg {
message SubMsg {
required uint32 value = 1;
}
enum Version {
V1 = 1;
V2 = 2;
}
required Version version = 2;
optional SubMsg sub = 1;
}
"""
end
It would be nice if there was a way to trigger behavior that was more like this:
defmodule Messages do
@moduledoc """
Some documentation
"""
@doc """
message Msg {
message SubMsg {
required uint32 value = 1;
}
}
"""
def _submsg do
end
@doc """
enum Version {
V1 = 1;
V2 = 2;
}
"""
def _version do
end
@doc """
required Version version = 2;
"""
def version do
end
@doc """
optional SubMsg sub = 1;
"""
def sub do
end
use Protobuf, """
message Msg {
message SubMsg {
required uint32 value = 1;
}
enum Version {
V1 = 1;
V2 = 2;
}
required Version version = 2;
optional SubMsg sub = 1;
}
"""
end
Or like this:
defmodule Messages do
@moduledoc """
Some documentation
"""
@doc """
message Msg {
message SubMsg {
required uint32 value = 1;
}
enum Version {
V1 = 1;
V2 = 2;
}
{
required Version version = 2;
optional SubMsg sub = 1;
}
}
"""
use Protobuf, """
message Msg {
message SubMsg {
required uint32 value = 1;
}
enum Version {
V1 = 1;
V2 = 2;
}
required Version version = 2;
optional SubMsg sub = 1;
}
"""
end
The last one is where the protobuf source (and any comments) are copied in to serve as their own documentation.
Something like this would be most useful when used to import *.proto files, allowing the built documents to always reflect the version of the .proto files that are in use.
The closest issue that I found to this was #48; however, I have been unable to get my project to show the imported protobufs (making me think that there is some other code difference between these two).
Metadata
Metadata
Assignees
Labels
No labels


