You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -808,6 +820,13 @@ function hoistPropertyAnnotations (property: model.Property, jsDocs: JSDoc[]): v
808
820
if(docUrl!=null){
809
821
property.docUrl=docUrl[1].replace(/\r/g,'')
810
822
}
823
+
}elseif(tag==='ext_doc_id'){
824
+
assert(jsDocs,value.trim()!=='',`Property ${property.name}'s @ext_doc_id is cannot be empty`)
825
+
property.extDocId=value
826
+
constdocUrl=docIds.find(entry=>entry[0]===value)
827
+
if(docUrl!=null){
828
+
property.extDocUrl=docUrl[1].replace(/\r/g,'')
829
+
}
811
830
}elseif(tag==='server_default'){
812
831
assert(jsDocs,property.type.kind==='instance_of'||property.type.kind==='union_of'||property.type.kind==='array_of',`Default values can only be configured for instance_of or union_of types, you are using ${property.type.kind}`)
813
832
assert(jsDocs,!property.required,'Default values can only be specified on optional properties')
For more information about the tags in this example (and other common tags such
61
-
as `@deprecated` and `@doc_id`), refer to the [Modeling Guide](https://github.com/elastic/elasticsearch-specification/blob/main/docs/modeling-guide.md#additional-information).
61
+
as `@deprecated` and `@ext_doc_id`), refer to the [Modeling Guide](https://github.com/elastic/elasticsearch-specification/blob/main/docs/modeling-guide.md#additional-information).
62
62
63
63
## Markup language
64
64
@@ -76,9 +76,9 @@ GFM also has implementations in most languages, meaning that code generators wil
76
76
77
77
**Doc comments are reference material**: they should be as succinct as possible while capturing all the necessary information to use the elements they're documenting. Remember that they will often show up in small IDE autocompletion popups!
78
78
79
-
In particular, doc comments are not the right place for tutorials or examples, which should be in dedicated documentation pages. These pages can of course be linked from the doc comments.
79
+
In particular, doc comments are not the right place for tutorials or extended examples, which should be in dedicated documentation pages. To reduce the risk of broken links, use `@ext_doc_id` to implement a link to additional documentation.
80
80
81
-
API endpoints will also have a `@doc_url` JSDoc tag that links to that API's detailed documentation page.
81
+
API endpoints can also have `@doc_id` or `@doc_url` JSDoc tags that enable clients to link to the API docs, for example.
0 commit comments