documentation.proto 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. // Copyright 2015 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.api;
  16. option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "DocumentationProto";
  19. option java_package = "com.google.api";
  20. option objc_class_prefix = "GAPI";
  21. // `Documentation` provides the information for describing a service.
  22. //
  23. // Example:
  24. // <pre><code>documentation:
  25. // summary: >
  26. // The Google Calendar API gives access
  27. // to most calendar features.
  28. // pages:
  29. // - name: Overview
  30. // content: &#40;== include google/foo/overview.md ==&#41;
  31. // - name: Tutorial
  32. // content: &#40;== include google/foo/tutorial.md ==&#41;
  33. // subpages;
  34. // - name: Java
  35. // content: &#40;== include google/foo/tutorial_java.md ==&#41;
  36. // rules:
  37. // - selector: google.calendar.Calendar.Get
  38. // description: >
  39. // ...
  40. // - selector: google.calendar.Calendar.Put
  41. // description: >
  42. // ...
  43. // </code></pre>
  44. // Documentation is provided in markdown syntax. In addition to
  45. // standard markdown features, definition lists, tables and fenced
  46. // code blocks are supported. Section headers can be provided and are
  47. // interpreted relative to the section nesting of the context where
  48. // a documentation fragment is embedded.
  49. //
  50. // Documentation from the IDL is merged with documentation defined
  51. // via the config at normalization time, where documentation provided
  52. // by config rules overrides IDL provided.
  53. //
  54. // A number of constructs specific to the API platform are supported
  55. // in documentation text.
  56. //
  57. // In order to reference a proto element, the following
  58. // notation can be used:
  59. // <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre>
  60. // To override the display text used for the link, this can be used:
  61. // <pre><code>&#91;display text]&#91;fully.qualified.proto.name]</code></pre>
  62. // Text can be excluded from doc using the following notation:
  63. // <pre><code>&#40;-- internal comment --&#41;</code></pre>
  64. //
  65. // A few directives are available in documentation. Note that
  66. // directives must appear on a single line to be properly
  67. // identified. The `include` directive includes a markdown file from
  68. // an external source:
  69. // <pre><code>&#40;== include path/to/file ==&#41;</code></pre>
  70. // The `resource_for` directive marks a message to be the resource of
  71. // a collection in REST view. If it is not specified, tools attempt
  72. // to infer the resource from the operations in a collection:
  73. // <pre><code>&#40;== resource_for v1.shelves.books ==&#41;</code></pre>
  74. // The directive `suppress_warning` does not directly affect documentation
  75. // and is documented together with service config validation.
  76. message Documentation {
  77. // A short summary of what the service does. Can only be provided by
  78. // plain text.
  79. string summary = 1;
  80. // The top level pages for the documentation set.
  81. repeated Page pages = 5;
  82. // A list of documentation rules that apply to individual API elements.
  83. //
  84. // **NOTE:** All service configuration rules follow "last one wins" order.
  85. repeated DocumentationRule rules = 3;
  86. // The URL to the root of documentation.
  87. string documentation_root_url = 4;
  88. // Specifies the service root url if the default one (the service name
  89. // from the yaml file) is not suitable. This can be seen in any fully
  90. // specified service urls as well as sections that show a base that other
  91. // urls are relative to.
  92. string service_root_url = 6;
  93. // Declares a single overview page. For example:
  94. // <pre><code>documentation:
  95. // summary: ...
  96. // overview: &#40;== include overview.md ==&#41;
  97. // </code></pre>
  98. // This is a shortcut for the following declaration (using pages style):
  99. // <pre><code>documentation:
  100. // summary: ...
  101. // pages:
  102. // - name: Overview
  103. // content: &#40;== include overview.md ==&#41;
  104. // </code></pre>
  105. // Note: you cannot specify both `overview` field and `pages` field.
  106. string overview = 2;
  107. }
  108. // A documentation rule provides information about individual API elements.
  109. message DocumentationRule {
  110. // The selector is a comma-separated list of patterns. Each pattern is a
  111. // qualified name of the element which may end in "*", indicating a wildcard.
  112. // Wildcards are only allowed at the end and for a whole component of the
  113. // qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A
  114. // wildcard will match one or more components. To specify a default for all
  115. // applicable elements, the whole pattern "*" is used.
  116. string selector = 1;
  117. // Description of the selected API(s).
  118. string description = 2;
  119. // Deprecation description of the selected element(s). It can be provided if
  120. // an element is marked as `deprecated`.
  121. string deprecation_description = 3;
  122. }
  123. // Represents a documentation page. A page can contain subpages to represent
  124. // nested documentation set structure.
  125. message Page {
  126. // The name of the page. It will be used as an identity of the page to
  127. // generate URI of the page, text of the link to this page in navigation,
  128. // etc. The full page name (start from the root page name to this page
  129. // concatenated with `.`) can be used as reference to the page in your
  130. // documentation. For example:
  131. // <pre><code>pages:
  132. // - name: Tutorial
  133. // content: &#40;== include tutorial.md ==&#41;
  134. // subpages:
  135. // - name: Java
  136. // content: &#40;== include tutorial_java.md ==&#41;
  137. // </code></pre>
  138. // You can reference `Java` page using Markdown reference link syntax:
  139. // `[Java][Tutorial.Java]`.
  140. string name = 1;
  141. // The Markdown content of the page. You can use <code>&#40;== include {path}
  142. // ==&#41;</code> to include content from a Markdown file.
  143. string content = 2;
  144. // Subpages of this page. The order of subpages specified here will be
  145. // honored in the generated docset.
  146. repeated Page subpages = 3;
  147. }