Skip to content

Commit

Permalink
Release v3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Dec 28, 2023
1 parent 0eeb284 commit d5a95ac
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 33 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Features
--------

* **Clean, intuitive design** — With Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [Paypal's](https://developer.paypal.com/docs/api/overview) API docs. Slate is responsive, so it looks great on tablets, phones, and even in print.
* **Clean, intuitive design** — With Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [PayPal's](https://developer.paypal.com/docs/api/overview) API docs. Slate is responsive, so it looks great on tablets, phones, and even in print.

* **Everything on a single page** — Gone are the days when your users had to search through a million pages to find what they wanted. Slate puts the entire documentation on a single page. We haven't sacrificed linkability, though. As you scroll, your browser's hash will update to the nearest header, so linking to a particular point in the documentation is still natural and easy.

Expand Down Expand Up @@ -86,12 +86,6 @@ Publish your docs to `origin/gh-pages` branch:
npm run deploy
```

Gulp Task
---------

Slate API documentation generation is also available as a Gulp task with the
[gulp-node-slate](https://github.com/center-key/gulp-node-slate) plugin.

<br>

---
Expand Down
2 changes: 1 addition & 1 deletion docs/css/screen.css

Large diffs are not rendered by default.

52 changes: 33 additions & 19 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ <h1 id="authentication">Authentication</h1>
<blockquote>
<p>To authorize, use this code:</p>
</blockquote>
<pre class="highlight ruby"><code><span class="hljs-keyword">require</span> <span class="hljs-string">&#x27;kittn&#x27;</span>
<pre><code class="hljs language-ruby"><span class="hljs-keyword">require</span> <span class="hljs-string">&#x27;kittn&#x27;</span>

api = <span class="hljs-title class_">Kittn</span><span class="hljs-symbol">:</span><span class="hljs-symbol">:APIClient</span>.authorize!(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>)</code></pre><pre class="highlight python"><code><span class="hljs-keyword">import</span> kittn
api = <span class="hljs-title class_">Kittn</span><span class="hljs-symbol">:</span><span class="hljs-symbol">:APIClient</span>.authorize!(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>)
</code></pre><pre><code class="hljs language-python"><span class="hljs-keyword">import</span> kittn

api = kittn.authorize(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>)</code></pre><pre class="highlight bash"><code><span class="hljs-comment"># With shell, you can just pass the correct header with each request</span>
api = kittn.authorize(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>)
</code></pre><pre><code class="hljs language-bash"><span class="hljs-comment"># With shell, you can just pass the correct header with each request</span>
curl <span class="hljs-string">&quot;api_endpoint_here&quot;</span>
-H <span class="hljs-string">&quot;Authorization: meowmeowmeow&quot;</span></code></pre><pre class="highlight javascript"><code><span class="hljs-keyword">import</span> { kittn } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kittn&#x27;</span>;
-H <span class="hljs-string">&quot;Authorization: meowmeowmeow&quot;</span>
</code></pre><pre><code class="hljs language-javascript"><span class="hljs-keyword">import</span> { kittn } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kittn&#x27;</span>;

<span class="hljs-keyword">const</span> api = kittn.<span class="hljs-title function_">authorize</span>(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>);</code></pre>
<span class="hljs-keyword">const</span> api = kittn.<span class="hljs-title function_">authorize</span>(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>);
</code></pre>
<blockquote>
<p>Make sure to replace <code>meowmeowmeow</code> with your API key.</p>
</blockquote>
Expand All @@ -63,21 +67,25 @@ <h1 id="authentication">Authentication</h1>
<aside class=notice> You must replace <code>meowmeowmeow</code> with your personal API key. </aside>
<h1 id="kittens">Kittens</h1>
<h2 id="get-all-kittens">Get All Kittens</h2>
<pre class="highlight ruby"><code><span class="hljs-keyword">require</span> <span class="hljs-string">&#x27;kittn&#x27;</span>
<pre><code class="hljs language-ruby"><span class="hljs-keyword">require</span> <span class="hljs-string">&#x27;kittn&#x27;</span>

api = <span class="hljs-title class_">Kittn</span><span class="hljs-symbol">:</span><span class="hljs-symbol">:APIClient</span>.authorize!(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>)
api.kittens.get</code></pre><pre class="highlight python"><code><span class="hljs-keyword">import</span> kittn
api.kittens.get
</code></pre><pre><code class="hljs language-python"><span class="hljs-keyword">import</span> kittn

api = kittn.authorize(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>)
api.kittens.get()</code></pre><pre class="highlight bash"><code>curl <span class="hljs-string">&quot;https://example.com/api/kittens&quot;</span>
-H <span class="hljs-string">&quot;Authorization: meowmeowmeow&quot;</span></code></pre><pre class="highlight javascript"><code><span class="hljs-keyword">import</span> { kittn } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kittn&#x27;</span>;
api.kittens.get()
</code></pre><pre><code class="hljs language-bash">curl <span class="hljs-string">&quot;https://example.com/api/kittens&quot;</span>
-H <span class="hljs-string">&quot;Authorization: meowmeowmeow&quot;</span>
</code></pre><pre><code class="hljs language-javascript"><span class="hljs-keyword">import</span> { kittn } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kittn&#x27;</span>;

<span class="hljs-keyword">const</span> api = kittn.<span class="hljs-title function_">authorize</span>(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>);
<span class="hljs-keyword">const</span> kittens = api.<span class="hljs-property">kittens</span>.<span class="hljs-title function_">get</span>();</code></pre>
<span class="hljs-keyword">const</span> kittens = api.<span class="hljs-property">kittens</span>.<span class="hljs-title function_">get</span>();
</code></pre>
<blockquote>
<p>The above command returns JSON structured like this:</p>
</blockquote>
<pre class="highlight json"><code><span class="hljs-punctuation">[</span>
<pre><code class="hljs language-json"><span class="hljs-punctuation">[</span>
<span class="hljs-punctuation">{</span>
<span class="hljs-attr">&quot;id&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-number">1</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;name&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;Fluffums&quot;</span><span class="hljs-punctuation">,</span>
Expand All @@ -92,7 +100,8 @@ <h2 id="get-all-kittens">Get All Kittens</h2>
<span class="hljs-attr">&quot;fluffiness&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-number">5</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;cuteness&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-number">10</span>
<span class="hljs-punctuation">}</span>
<span class="hljs-punctuation">]</span></code></pre>
<span class="hljs-punctuation">]</span>
</code></pre>
<p>This endpoint retrieves all kittens.</p>
<h3 id="http-request">HTTP Request</h3>
<p><code>GET https://example.com/api/kittens</code></p>
Expand Down Expand Up @@ -120,27 +129,32 @@ <h3 id="query-parameters">Query Parameters</h3>
</table>
<aside class=success> Remember — a happy kitten is an authenticated kitten! </aside>
<h2 id="get-a-specific-kitten">Get a Specific Kitten</h2>
<pre class="highlight ruby"><code><span class="hljs-keyword">require</span> <span class="hljs-string">&#x27;kittn&#x27;</span>
<pre><code class="hljs language-ruby"><span class="hljs-keyword">require</span> <span class="hljs-string">&#x27;kittn&#x27;</span>

api = <span class="hljs-title class_">Kittn</span><span class="hljs-symbol">:</span><span class="hljs-symbol">:APIClient</span>.authorize!(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>)
api.kittens.get(<span class="hljs-number">2</span>)</code></pre><pre class="highlight python"><code><span class="hljs-keyword">import</span> kittn
api.kittens.get(<span class="hljs-number">2</span>)
</code></pre><pre><code class="hljs language-python"><span class="hljs-keyword">import</span> kittn

api = kittn.authorize(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>)
api.kittens.get(<span class="hljs-number">2</span>)</code></pre><pre class="highlight bash"><code>curl <span class="hljs-string">&quot;https://example.com/api/kittens/2&quot;</span>
-H <span class="hljs-string">&quot;Authorization: meowmeowmeow&quot;</span></code></pre><pre class="highlight javascript"><code><span class="hljs-keyword">import</span> { kittn } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kittn&#x27;</span>;
api.kittens.get(<span class="hljs-number">2</span>)
</code></pre><pre><code class="hljs language-bash">curl <span class="hljs-string">&quot;https://example.com/api/kittens/2&quot;</span>
-H <span class="hljs-string">&quot;Authorization: meowmeowmeow&quot;</span>
</code></pre><pre><code class="hljs language-javascript"><span class="hljs-keyword">import</span> { kittn } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kittn&#x27;</span>;

<span class="hljs-keyword">const</span> api = kittn.<span class="hljs-title function_">authorize</span>(<span class="hljs-string">&#x27;meowmeowmeow&#x27;</span>);
<span class="hljs-keyword">const</span> max = api.<span class="hljs-property">kittens</span>.<span class="hljs-title function_">get</span>(<span class="hljs-number">2</span>);</code></pre>
<span class="hljs-keyword">const</span> max = api.<span class="hljs-property">kittens</span>.<span class="hljs-title function_">get</span>(<span class="hljs-number">2</span>);
</code></pre>
<blockquote>
<p>The above command returns JSON structured like this:</p>
</blockquote>
<pre class="highlight json"><code><span class="hljs-punctuation">{</span>
<pre><code class="hljs language-json"><span class="hljs-punctuation">{</span>
<span class="hljs-attr">&quot;id&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-number">2</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;name&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;Max&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;breed&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;unknown&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;fluffiness&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-number">5</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;cuteness&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-number">10</span>
<span class="hljs-punctuation">}</span></code></pre>
<span class="hljs-punctuation">}</span>
</code></pre>
<p>This endpoint retrieves a specific kitten.</p>
<aside class=warning> Inside HTML code blocks like this one, you can't use Markdown, so use <code>&lt;code&gt;</code> blocks to denote code. </aside>
<h3 id="http-request-with-id">HTTP Request (with ID)</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/js/all.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-slate",
"version": "3.1.3",
"version": "3.2.0",
"description": "Node port of lord/slate",
"license": "Apache-2.0",
"type": "module",
Expand Down
9 changes: 5 additions & 4 deletions task-runner.sh.command
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ setupTools() {

releaseInstructions() {
cd $projectHome
repository=$(grep repository package.json | awk -F'"' '{print $4}' | sed s/github://)
package=https://raw.githubusercontent.com/$repository/main/package.json
org=$(grep git+https package.json | awk -F'/' '{print $4}')
name=$(grep '"name":' package.json | awk -F'"' '{print $4}')
package=https://raw.githubusercontent.com/$org/$name/main/package.json
version=v$(grep '"version"' package.json | awk -F'"' '{print $4}')
pushed=v$(curl --silent $package | grep '"version":' | awk -F'"' '{print $4}')
minorVersion=$(echo ${pushed:1} | awk -F"." '{ print $1 "." $2 }')
released=$(git tag | tail -1)
published=v$(npm view $repository version)
published=v$(npm view $name version)
test $? -ne 0 && echo "NOTE: Ignore error if package is not yet published."
echo "Local changes:"
git status --short
Expand All @@ -56,7 +57,7 @@ releaseInstructions() {
echo "When ready to do the next release:"
echo
echo " === Increment version ==="
echo " Edit pacakge.json to bump $version to next version number"
echo " Edit package.json to bump $version to next version number"
echo " $projectHome/package.json"
}
nextActionCommitTagPub() {
Expand Down

0 comments on commit d5a95ac

Please sign in to comment.