From fdbe733df35f801479aba12da73f1e461d6da98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 20 Aug 2018 12:39:57 +0300 Subject: [PATCH] C# usage example. Fixes #127 --- CHANGELOG.md | 1 + hc/front/management/commands/pygmentize.py | 1 + templates/front/base_docs.html | 1 + templates/front/docs.html | 4 ++++ templates/front/show_usage_modal.html | 6 ++++++ templates/front/snippets/cs.html | 5 +++++ templates/front/snippets/cs.txt | 4 ++++ templates/front/welcome.html | 6 ++++++ 8 files changed, 28 insertions(+) create mode 100644 templates/front/snippets/cs.html create mode 100644 templates/front/snippets/cs.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a36ee6d..0d76ee2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,3 +6,4 @@ All notable changes to this project will be documented in this file. ### Improvements - A new "Check Details" page. - Updated django-compressor, psycopg2, pytz, requests package versions. +- C# usage example. \ No newline at end of file diff --git a/hc/front/management/commands/pygmentize.py b/hc/front/management/commands/pygmentize.py index 44ce0356..b05077c7 100644 --- a/hc/front/management/commands/pygmentize.py +++ b/hc/front/management/commands/pygmentize.py @@ -31,6 +31,7 @@ class Command(BaseCommand): _process("bash_wget", lexers.BashLexer()) _process("browser", lexers.JavascriptLexer()) _process("crontab", lexers.BashLexer()) + _process("cs", lexers.CSharpLexer()) _process("node", lexers.JavascriptLexer()) _process("python_urllib2", lexers.PythonLexer()) _process("python_requests", lexers.PythonLexer()) diff --git a/templates/front/base_docs.html b/templates/front/base_docs.html index a38f1a18..44187b53 100644 --- a/templates/front/base_docs.html +++ b/templates/front/base_docs.html @@ -14,6 +14,7 @@
  • Ruby
  • Node
  • PHP
  • +
  • C#
  • Browser
  • PowerShell
  • Email
  • diff --git a/templates/front/docs.html b/templates/front/docs.html index efd10454..98bba35b 100644 --- a/templates/front/docs.html +++ b/templates/front/docs.html @@ -169,6 +169,10 @@ thing: they fire off a HTTP GET method.

    PHP

    {% include "front/snippets/php.html" %} + +

    C#

    +{% include "front/snippets/cs.html" %} +

    Browser

    diff --git a/templates/front/show_usage_modal.html b/templates/front/show_usage_modal.html index 8ff46bbb..ce4cf955 100644 --- a/templates/front/show_usage_modal.html +++ b/templates/front/show_usage_modal.html @@ -23,6 +23,9 @@

    + @@ -57,6 +60,9 @@
    {% include "front/snippets/php.html" %}
    +
    + {% include "front/snippets/cs.html" %} +
    {% include "front/snippets/browser.html" %}
    diff --git a/templates/front/snippets/cs.html b/templates/front/snippets/cs.html new file mode 100644 index 00000000..a33d08c6 --- /dev/null +++ b/templates/front/snippets/cs.html @@ -0,0 +1,5 @@ +
    using (var client = new System.Net.WebClient())
    +{
    +       client.DownloadString("{{ ping_url }}");
    +}
    +
    diff --git a/templates/front/snippets/cs.txt b/templates/front/snippets/cs.txt new file mode 100644 index 00000000..dc862693 --- /dev/null +++ b/templates/front/snippets/cs.txt @@ -0,0 +1,4 @@ +using (var client = new System.Net.WebClient()) +{ + client.DownloadString("PING_URL"); +} \ No newline at end of file diff --git a/templates/front/welcome.html b/templates/front/welcome.html index f8fa3c28..072124bf 100644 --- a/templates/front/welcome.html +++ b/templates/front/welcome.html @@ -65,6 +65,9 @@ + @@ -96,6 +99,9 @@
    {% include "front/snippets/php.html" %}
    +
    + {% include "front/snippets/cs.html" %} +
    {% include "front/snippets/browser.html" %}