diff --git a/templates/zerver/integrations/perforce.html b/templates/zerver/integrations/perforce.html
deleted file mode 100644
index 3e44c002bb..0000000000
--- a/templates/zerver/integrations/perforce.html
+++ /dev/null
@@ -1,71 +0,0 @@
-
- Zulip supports integration with Perforce as a
- trigger
- that fires once a changelist is submitted and committed. To do this:
-
-
-
- -
- Download and install our Python bindings on the
- server that hosts your Perforce depot. The Perforce trigger will be
- installed to a location like
-
/usr/local/share/zulip/integrations/perforce
-
-
- -
- Open
integrations/perforce/zulip_perforce_config.py
in
- your favorite editor, change the ZULIP_USER
and
- ZULIP_API_KEY
variables at the top of the file to the
- credentials for the bot you'd like to use for this integration.
-
-
- - You should also change
ZULIP_SITE
to {{ external_api_path_subdomain }}
-
- -
- If you have a P4Web viewer set up, you may change
P4_WEB
- to point at the base URL of the server. If this is configured, then
- the changelist number of each commit will be converted to a hyperlink
- that displays the commit details on P4Web.
-
-
- -
- Edit your
- trigger table
- with
p4 triggers
and add an entry something like the
- following:
-
- notify_zulip change-commit //depot/... "/usr/local/share/zulip/integrations/perforce/zulip_change-commit.py %change% %changeroot%"
-
-
- - By default, this hook will send to streams of the form
-
depot_subdirectory-commits
. So, a changelist that modifies
- files in //depot/foo/bar/baz
will result in a message to
- stream foo-commits
. Messages about changelists that modify
- files in the depot root or files in multiple direct subdirectories of
- the depot root will be sent to depot-commits
. If you'd
- prefer different behavior, such as all commits across your depot going
- to one stream, change it now in zulip_perforce_config.py
.
- Make sure that everyone interested in getting these post-commit Zulips
- is subscribed to the relevant streams!
-
-
- -
- By default, this hook will send a message to Zulip even if the
- destination stream does not yet exist. Messages to nonexistent
- streams prompt the Zulip Notification Bot to inform the bot's
- owner by private message that they may wish to create the stream.
- If this behaviour is undesirable, for example with a large and busy
- Perforce server, change the
ZULIP_IGNORE_MISSING_STREAM
- variable in zulip_perforce_config.py
to True
.
- This will change the hook's behaviour to first check whether the
- destination stream exists and silently drop messages if it does not.
-
-
-
-
- Congratulations! You're done!
When you commit to your
- Perforce depot the team can see updates in real time in
- Zulip:
-
-
-
diff --git a/templates/zerver/integrations/perforce.md b/templates/zerver/integrations/perforce.md
new file mode 100644
index 0000000000..78fb429d9a
--- /dev/null
+++ b/templates/zerver/integrations/perforce.md
@@ -0,0 +1,49 @@
+Zulip supports integration with Perforce as a [trigger][1]
+that fires once a changelist is submitted and committed.
+To do this:
+
+[1]: http://www.perforce.com/perforce/doc.current/manuals/p4sag/chapter.scripting.html
+
+{!download-python-bindings.md!}
+
+The Perforce trigger will be installed to a location like
+`/usr/local/share/zulip/integrations/perforce`.
+
+{!change-zulip-config-file.md!}
+
+If you have a P4Web viewer set up, you may change `P4_WEB`
+to point at the base URL of the server. If this is configured,
+then the changelist number of each commit will be converted to
+a hyperlink that displays the commit details on P4Web.
+
+Edit your [trigger table][2] with `p4 triggers` and add an entry
+something like the following:
+
+ notify_zulip change-commit //depot/... "/usr/local/share/zulip/integrations/perforce/zulip_change-commit.py %change% %changeroot%"
+
+[2]: http://www.perforce.com/perforce/doc.current/manuals/p4sag/chapter.scripting.html#d0e14583
+
+By default, this hook will send to streams of the form
+`depot_subdirectory-commits`. So, a changelist that modifies
+files in `//depot/foo/bar/baz` will result in a message to
+stream `foo-commits`. Messages about changelists that modify
+files in the depot root or files in multiple direct subdirectories
+of the depot root will be sent to `depot-commits`.
+If you'd prefer different behavior, such as all commits across your
+depot going to one stream, change it now in `zulip_perforce_config.py`.
+Make sure that everyone interested in getting these post-commit Zulips
+is subscribed to the relevant streams!
+
+By default, this hook will send a message to Zulip even if the
+destination stream does not yet exist. Messages to nonexistent
+streams prompt the Zulip Notification Bot to inform the bot's
+owner by private message that they may wish to create the stream.
+If this behaviour is undesirable, for example with a large and busy
+Perforce server, change the `ZULIP_IGNORE_MISSING_STREAM`
+variable in `zulip_perforce_config.py` to `True`.
+This will change the hook's behaviour to first check whether the
+destination stream exists and silently drop messages if it does not.
+
+{!congrats.md!}
+
+![](/static/images/integrations/perforce/001.png)
diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py
index 08cc025838..6de5977df2 100644
--- a/tools/linter_lib/custom_check.py
+++ b/tools/linter_lib/custom_check.py
@@ -458,6 +458,7 @@ def build_custom_checkers(by_lang):
"README.md",
"zerver/webhooks/helloworld/doc.md",
"zerver/webhooks/trello/doc.md",
+ "templates/zerver/integrations/perforce.md",
}
for fn in by_lang['md']:
max_length = None
diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.py
index 7158aa27ff..46fcd18af0 100644
--- a/zerver/lib/integrations.py
+++ b/zerver/lib/integrations.py
@@ -295,7 +295,7 @@ INTEGRATIONS = {
doc='zerver/integrations/openshift.md',
stream_name='deployments',
),
- 'perforce': Integration('perforce', 'perforce', doc='zerver/integrations/perforce.html'),
+ 'perforce': Integration('perforce', 'perforce', doc='zerver/integrations/perforce.md'),
'phabricator': Integration('phabricator', 'phabricator', doc='zerver/integrations/phabricator.md'),
'puppet': Integration('puppet', 'puppet', doc='zerver/integrations/puppet.md'),
'redmine': Integration('redmine', 'redmine', doc='zerver/integrations/redmine.md'),