Skip to content

Commit

Permalink
Post example plugin directly in docs.
Browse files Browse the repository at this point in the history
fixes #59.
  • Loading branch information
facelessuser committed May 27, 2017
1 parent db5f791 commit 8da3d49
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/usage.md
Expand Up @@ -495,7 +495,22 @@ Here is some text to test the example on:
# Test 3: 20140101
```
RegReplace comes with a very simple example you can test with found at `/Packages/RegReplace/rr_modules/example.py`. Imported with `RegReplace.rr_modules.example`.
RegReplace comes with a very simple example you can test with found at `/Packages/RegReplace/rr_modules/example.py`. Since package control zips packages, it is hard to view directly without a plugin, so it is posted below as well. Import with `#!js "plugin": "RegReplace.rr_modules.example"`.
```py
"""A simple example plugin."""


def replace(m, **kwargs):
"""Replace with groups."""

# pylint: disable=unused-argument
text = "Here are your groups: "
for group in m.groups():
if group is not None:
text += "(%s)" % group
return text
```
## Regex Module
Expand Down

0 comments on commit 8da3d49

Please sign in to comment.