diff --git a/Makefile b/Makefile index 5b4d6903..7e19fbaf 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ build/examples: bin/protoc build tmp/googleapis examples/proto/*.proto examples/ @$(EXAMPLE_CMD) --doc_opt=html,example.html:Ignore* examples/proto/*.proto @$(EXAMPLE_CMD) --doc_opt=json,example.json:Ignore* examples/proto/*.proto @$(EXAMPLE_CMD) --doc_opt=markdown,example.md:Ignore* examples/proto/*.proto - @$(EXAMPLE_CMD) --doc_opt=examples/templates/asciidoc.tmpl,example.txt:Ignore* examples/proto/*.proto + @$(EXAMPLE_CMD) --doc_opt=examples/templates/asciidoc.tmpl,example.adoc:Ignore* examples/proto/*.proto ##@: Dev diff --git a/examples/doc/example.txt b/examples/doc/example.adoc similarity index 93% rename from examples/doc/example.txt rename to examples/doc/example.adoc index db07a128..baa22ac7 100644 --- a/examples/doc/example.txt +++ b/examples/doc/example.adoc @@ -7,6 +7,7 @@ +[[com.example.Booking]] === Booking Represents the booking of a vehicle. @@ -26,12 +27,13 @@ Vehicles are some cool shit. But drive carefully! |payment_received | <> | |Has payment been received? -|color_preference | <> | |Color preference of the customer. +|color_preference | <> | |**Deprecated.** Color preference of the customer. |=========================================== +[[com.example.BookingStatus]] === BookingStatus Represents the status of a vehicle booking. @@ -47,6 +49,7 @@ Represents the status of a vehicle booking. +[[com.example.BookingStatusID]] === BookingStatusID Represents the booking status ID. @@ -60,6 +63,7 @@ Represents the booking status ID. +[[com.example.EmptyBookingMessage]] === EmptyBookingMessage An empty message for testing @@ -73,6 +77,7 @@ An empty message for testing +[[com.example.Address]] === Address Represents a mail address. @@ -96,6 +101,7 @@ Represents a mail address. +[[com.example.Customer]] === Customer Represents a customer. @@ -128,6 +134,7 @@ Represents a customer. +[[com.example.Manufacturer]] === Manufacturer Represents a manufacturer of cars. @@ -141,12 +148,13 @@ Represents a manufacturer of cars. |details | <> |optional |Manufacturer details (minimum orders et.c.). -|category | <> |optional |Manufacturer category. +|category | <> |optional |Manufacturer category. Default: CATEGORY_EXTERNAL |=========================================== +[[com.example.Model]] === Model Represents a vehicle model. @@ -168,6 +176,7 @@ Represents a vehicle model. +[[com.example.Vehicle]] === Vehicle Represents a vehicle that can be hired. @@ -185,7 +194,7 @@ Represents a vehicle that can be hired. |category | <> |optional |Vehicle category. -|daily_hire_rate_dollars | <> |optional |Dollars per day. +|daily_hire_rate_dollars | <> |optional |Dollars per day. Default: 50 |daily_hire_rate_cents | <> |optional |Cents per day. @@ -193,6 +202,7 @@ Represents a vehicle that can be hired. +[[com.example.Vehicle.Category]] === Vehicle.Category Represents a vehicle category. E.g. "Sedan" or "Truck". @@ -210,7 +220,7 @@ Represents a vehicle category. E.g. "Sedan" or "Truck". -[[Manufacturer.Category]] +[[com.example.Manufacturer.Category]] === Manufacturer.Category Manufacturer category. A manufacturer may be either inhouse or external. diff --git a/examples/templates/asciidoc.tmpl b/examples/templates/asciidoc.tmpl index be1424c3..f345f3b2 100644 --- a/examples/templates/asciidoc.tmpl +++ b/examples/templates/asciidoc.tmpl @@ -7,6 +7,7 @@ {{range .Messages}} +[[{{.FullName}}]] === {{.LongName}} {{nobr .Description}} @@ -14,7 +15,7 @@ |=========================================== |*Field* |*Type* |*Label* |*Description* {{range .Fields}} -|{{.Name}} | <<{{.FullType}},{{.LongType}}>> |{{.Label}} |{{.Description}} +|{{.Name}} | <<{{.FullType}},{{.LongType}}>> |{{.Label}} |{{if (index .Options "deprecated"|default false)}}**Deprecated.** {{end}}{{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} {{end}} |=========================================== {{end}} @@ -22,7 +23,7 @@ {{range .Enums}} -[[{{.LongName}}]] +[[{{.FullName}}]] === {{.LongName}} {{.Description}}