Merge branch 'sy-gfm-reference-format' into 'master'

Add docs for GFM reference filter recommended format

See merge request gitlab-org/gitlab!42900
parents c3b4e4e5 2ad049e3
...@@ -77,6 +77,22 @@ a minimum implementation of `AbstractReferenceFilter` should define: ...@@ -77,6 +77,22 @@ a minimum implementation of `AbstractReferenceFilter` should define:
and an identifier, find the object. For example, this in a reference filter for and an identifier, find the object. For example, this in a reference filter for
merge requests, this might be `project.merge_requests.where(iid: iid)`. merge requests, this might be `project.merge_requests.where(iid: iid)`.
### Add a new reference prefix and filter
For reference filters for new objects, use a prefix format following the pattern
`^<object_type>#`, because:
1. Varied single-character prefixes are hard for users to track. Especially for
lower-use object types, this can diminish value for the feature.
1. Suitable single-character prefixes are limited.
1. Following a consistent pattern allows users to infer the existence of new features.
To add a reference prefix for a new object `apple`,which has both a name and ID,
format the reference as:
- `^apple#123` for identification by ID.
- `^apple#"Granny Smith"` for identification by name.
### Performance ### Performance
#### Find object optimization #### Find object optimization
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment