Browse Source

C# usage example. Fixes #127

pull/193/head
Pēteris Caune 6 years ago
parent
commit
fdbe733df3
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
8 changed files with 28 additions and 0 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -0
      hc/front/management/commands/pygmentize.py
  3. +1
    -0
      templates/front/base_docs.html
  4. +4
    -0
      templates/front/docs.html
  5. +6
    -0
      templates/front/show_usage_modal.html
  6. +5
    -0
      templates/front/snippets/cs.html
  7. +4
    -0
      templates/front/snippets/cs.txt
  8. +6
    -0
      templates/front/welcome.html

+ 1
- 0
CHANGELOG.md View File

@ -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.

+ 1
- 0
hc/front/management/commands/pygmentize.py View File

@ -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())


+ 1
- 0
templates/front/base_docs.html View File

@ -14,6 +14,7 @@
<li><a href="{% url 'hc-docs' %}#ruby">Ruby</a></li>
<li><a href="{% url 'hc-docs' %}#node">Node</a></li>
<li><a href="{% url 'hc-docs' %}#php">PHP</a></li>
<li><a href="{% url 'hc-docs' %}#cs">C#</a></li>
<li><a href="{% url 'hc-docs' %}#browser">Browser</a></li>
<li><a href="{% url 'hc-docs' %}#powershell">PowerShell</a></li>
<li><a href="{% url 'hc-docs' %}#email">Email</a></li>


+ 4
- 0
templates/front/docs.html View File

@ -169,6 +169,10 @@ thing: they fire off a HTTP GET method.</p>
<h3>PHP</h3>
{% include "front/snippets/php.html" %}
<a name="cs"></a>
<h3>C#</h3>
{% include "front/snippets/cs.html" %}
<a name="browser"></a>
<h3>Browser</h3>
<p>


+ 6
- 0
templates/front/show_usage_modal.html View File

@ -23,6 +23,9 @@
<li class="hidden-xs">
<a href="#php" data-toggle="tab">PHP</a>
</li>
<li class="hidden-xs">
<a href="#cs" data-toggle="tab">C#</a>
</li>
<li class="hidden-xs">
<a href="#browser" data-toggle="tab">Browser</a>
</li>
@ -57,6 +60,9 @@
<div role="tabpanel" class="tab-pane" id="php">
{% include "front/snippets/php.html" %}
</div>
<div role="tabpanel" class="tab-pane" id="cs">
{% include "front/snippets/cs.html" %}
</div>
<div class="tab-pane" id="browser">
{% include "front/snippets/browser.html" %}
</div>


+ 5
- 0
templates/front/snippets/cs.html View File

@ -0,0 +1,5 @@
<div class="highlight"><pre><span></span><span class="k">using</span> <span class="p">(</span><span class="kt">var</span> <span class="n">client</span> <span class="p">=</span> <span class="k">new</span> <span class="n">System</span><span class="p">.</span><span class="n">Net</span><span class="p">.</span><span class="n">WebClient</span><span class="p">())</span>
<span class="p">{</span>
<span class="n">client</span><span class="p">.</span><span class="n">DownloadString</span><span class="p">(</span><span class="s">&quot;{{ ping_url }}&quot;</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>

+ 4
- 0
templates/front/snippets/cs.txt View File

@ -0,0 +1,4 @@
using (var client = new System.Net.WebClient())
{
client.DownloadString("PING_URL");
}

+ 6
- 0
templates/front/welcome.html View File

@ -65,6 +65,9 @@
<li class="hidden-xs">
<a href="#php" data-toggle="tab">PHP</a>
</li>
<li class="hidden-xs">
<a href="#cs" data-toggle="tab">C#</a>
</li>
<li class="hidden-xs">
<a href="#browser" data-toggle="tab">Browser</a>
</li>
@ -96,6 +99,9 @@
<div role="tabpanel" class="tab-pane" id="php">
{% include "front/snippets/php.html" %}
</div>
<div role="tabpanel" class="tab-pane" id="cs">
{% include "front/snippets/cs.html" %}
</div>
<div class="tab-pane" id="browser">
{% include "front/snippets/browser.html" %}
</div>


Loading…
Cancel
Save