Skip to content

Commit

Permalink
Add examples for autolink plugin
Browse files Browse the repository at this point in the history
I'm aware that some of these are in the usage list above, but I want to start a list of examples that we share with communities and build it out over time.
  • Loading branch information
jasonblais committed Apr 4, 2019
1 parent 436ac13 commit b08ee50
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -89,3 +89,17 @@ Below is an example of regexp patterns used for autolinking, modified in the `co
}
},
```

## Examples

1. Autolinking `Ticket ####:text with alphanumberic characters and spaces` to a ticket link. Use:
- Pattern: `(?i)(ticket )(?P<ticket_id>)( : )(?P<ticket_info>.*)`
- Template: `(ticket ${ticket_id}:${ticket_info})`

2. Autolinking a link to a GitHub PR to a link with format "pr-repo-id". Use:
- Pattern: `https://github\\.com/mattermost/(?P<repo>.+)/pull/(?P<id>\\d+)`
- Template: `[pr-${repo}-${id}](https://github.com/mattermost/${repo}/pull/${id})`

3. Using autolinking to create group mentions. Use:
- Pattern: `@customgroup*`
- Template: `[@customgroup]( \\* @user1 @user2 @user3 \\* )`

0 comments on commit b08ee50

Please sign in to comment.