Skip to content

Commit

Permalink
Version 0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie committed Dec 2, 2016
1 parent a5155b3 commit 89986f6
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion coredocs/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.3'
__version__ = '0.0.4'
2 changes: 1 addition & 1 deletion coredocs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

THEME_CHOICES = ['slate']
PYGMENTS_STYLES = get_all_styles()
DEFAULT_LANGS = ['shell', 'python']
DEFAULT_LANGS = ['shell', 'javascript', 'python']


def get_fields(location, link):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ <h1 id="document-title">{{ document.title }}</h1>
<p>{{ render_markdown(document.description) }}</p>

{% for section_key, section in get_sections(document) %}
{% include "coreapi/section.html" %}
{% include "coredocs/section.html" %}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<pre class="highlight javascript"><code>{% highlight 'javascript' %}var coreapi = window.coreapi

// Initialize a client & load the schema document
var auth = new coreapi.BasicAuth(username='xxx', password='xxx')
var client = new coreapi.Client(auth=auth)
var client = new coreapi.Client()
var document = null
client.get("{{ schema_url }}").then(function(result) {
document = result
})

// Interact with the API endpoint
var action = ["{{ section_key }}", "{{ link_key }}"]
var params = {id: 123}
client.action(document, action, params=params).then(function(result) {
{% if link.fields %}var params = {
{% for field in link.fields %} {{ field.name }}: ...{% if not loop.last %},{% endif %}
{% endfor %}}
{% endif %}client.action(document, action, params=params).then(function(result) {
// Return value is in 'result'
}){% endhighlight %}</code></pre>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h2 id="{{ link_key }}">{{ link.title or link_key }}</h2>

{% if 'shell' in langs %}{% include "languages/shell.html" %}{% endif %}
{% if 'python' in langs %}{% include "languages/python.html" %}{% endif %}
{% if 'javascript' in langs %}{% include "languages/javascript.html" %}{% endif %}
{% if 'shell' in langs %}{% include "coredocs/languages/shell.html" %}{% endif %}
{% if 'python' in langs %}{% include "coredocs/languages/python.html" %}{% endif %}
{% if 'javascript' in langs %}{% include "coredocs/languages/javascript.html" %}{% endif %}

<p>{{ render_markdown(link.description) }}</p>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 id="{{ section_key }}">{{ section_key }}</h1>

{% for link_key, link in get_links(section) %}
{% include "coreapi/link.html" %}
{% include "coredocs/link.html" %}
{% endfor %}
2 changes: 1 addition & 1 deletion coredocs/templates/slate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div class="dark-box"></div>
{% endif %}
<div class="content">
{% include "coreapi/document.html" %}
{% include "coredocs/document.html" %}
</div>
{% if langs %}
<div class="dark-box">
Expand Down

0 comments on commit 89986f6

Please sign in to comment.