File tree Expand file tree Collapse file tree 2 files changed +65
-4
lines changed Expand file tree Collapse file tree 2 files changed +65
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ CXXGEN := $(BUILDDIR)/cpp
40
40
PYGEN := $(BUILDDIR ) /python
41
41
42
42
# generated Documentation files
43
+ DOCFORMAT := asciidoc
44
+ DOCEXT := asciidoc
45
+ # DOCFORMAT := markdown
46
+ # DOCEXT := md
47
+
43
48
DOCGEN := $(BUILDDIR ) /doc
44
49
45
50
# pkg-config
@@ -73,7 +78,7 @@ PROTO_CXX_INCS := ${PROTO_SPECS:$(SRCDIR)/%.proto=$(CXXGEN)/%.pb.h}
73
78
PROTO_CXX_SRCS := ${PROTO_SPECS:$(SRCDIR ) /%.proto=$(CXXGEN ) /%.pb.cc}
74
79
75
80
# generated doc file
76
- DOC_TARGET := $(DOCGEN ) /machinetalk-protobuf.md
81
+ DOC_TARGET := $(DOCGEN ) /machinetalk-protobuf.$( DOCEXT )
77
82
78
83
# ---- generate dependcy files for .proto files
79
84
#
@@ -149,16 +154,16 @@ Makefile: $(GENERATED) $(PROTO_DEPS)
149
154
#
150
155
# see https://github.com/estan/protoc-gen-doc
151
156
#
152
- # generate Markdown files from proto files
153
- $(DOC_TARGET ) : $(wildcard $(SRCDIR ) /* .proto)
157
+ # generate $(DOCFORMAT) files from proto files
158
+ $(DOC_TARGET ) : $(wildcard $(SRCDIR ) /* .proto) scripts/ $( DOCFORMAT ) .mustache
154
159
# doc_base:
155
160
$(ECHO) "protoc create $@ from *.proto"
156
161
@mkdir -p $(DOCGEN)
157
162
$(Q)cd $(SRCDIR); \
158
163
$(PROTOC) $(PROTOC_FLAGS) \
159
164
--proto_path=./ \
160
165
--proto_path=$(GPBINCLUDE)/ \
161
- --doc_out=$(SRCDIRINV)/scripts/markdown .mustache,$(SRCDIRINV)/$@:./ \
166
+ --doc_out=$(SRCDIRINV)/scripts/$(DOCFORMAT) .mustache,$(SRCDIRINV)/$@:./ \
162
167
$(NAMESPACEDIR)/*.proto
163
168
164
169
all : $(GENERATED ) $(PROTO_DEPS )
Original file line number Diff line number Diff line change
1
+ # Asciidoc Protocol Documentation
2
+ <a name =" top" />
3
+
4
+ ## Table of Contents
5
+ { {#files} }
6
+ * [{ {file_name} }](#{ {file_name} })
7
+ { {#file_messages} }
8
+ * [{ {message_long_name} }](#{ {message_full_name} })
9
+ { {/file_messages} }
10
+ { {#file_enums} }
11
+ * [{ {enum_long_name} }](#{ {enum_full_name} })
12
+ { {/file_enums} }
13
+ { {/files} }
14
+ * [Scalar Value Types](#scalar-value-types)
15
+
16
+ { {#files} }
17
+ <a name =" { { file_name} } " />
18
+ <p align =" right" ><a href =" #top" >Top</a ></p >
19
+
20
+ ## { {file_name} }
21
+
22
+ { {#file_messages} }
23
+ <a name =" { { message_full_name} } " />
24
+ ### { {message_long_name} }
25
+ { {message_description} }
26
+
27
+ | Field | Type | Label | Description |
28
+ | ----- | ---- | ----- | ----------- |
29
+ { {#message_fields} }
30
+ | <a name =" { { message_full_name} } .{ { field_name} } " /> { {field_name} } | [{ {field_long_type} }](#{ {field_full_type} }) | { {field_label} } | { {#nobr} }{ {field_description} }{ {/nobr} } |
31
+ { {/message_fields} }
32
+
33
+ { {/file_messages} }
34
+
35
+ { {#file_enums} }
36
+ <a name =" { { enum_full_name} } " />
37
+ ### { {enum_long_name} }
38
+ { {enum_description} }
39
+
40
+ | Name | Number | Description |
41
+ | ---- | ------ | ----------- |
42
+ { {#enum_values} }
43
+ | { {value_name} } | { {value_number} } | { {#nobr} }{ {value_description} }{ {/nobr} } |
44
+ { {/enum_values} }
45
+
46
+ { {/file_enums} }
47
+ { {/files} }
48
+
49
+ <a name =" scalar-value-types" />
50
+ ## Scalar Value Types
51
+
52
+ | .proto Type | Notes | C++ Type | Java Type | Python Type |
53
+ | ----------- | ----- | -------- | --------- | ----------- |
54
+ { {#scalar_value_types} }
55
+ | <a name =" { { scalar_value_proto_type} } " /> { {scalar_value_proto_type} } | { {scalar_value_notes} } | { {scalar_value_cpp_type} } | { {scalar_value_java_type} } | { {scalar_value_python_type} } |
56
+ { {/scalar_value_types} }
You can’t perform that action at this time.
0 commit comments