documentation.proto 6.1 KB

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