Commit 0a6ad4ef authored by Simon Bartlett's avatar Simon Bartlett

Ported from Ruby to Node.js

parent 19d651a6
*.gem build
*.rbc node_modules
.bundle
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
*.DS_STORE
build/
.cache
.vagrant
.sass-cache
# YARD artifacts
.yardoc
_yardoc
doc/
.idea/
sudo: false
language: ruby
rvm:
- 2.0.0
- 2.1.0
cache: bundler
script: bundle exec middleman build
# Before You Submit an Issue
- Are you using Windows? We unfortunately don't support Windows. You could try using Docker, as outlined in the `README`.
- Is your version of Slate out of date? We have [upgrade instructions](https://github.com/tripit/slate/wiki/Updating-Slate) in the wiki. You could also try seeing if your problem is reproducible on the latest version of Slate.
If you answered "no" to each of the questions above, feel free to submit an issue! It's also helpful if you include a code example of your problem (if applicable), we can't help you if you just say "Slate stopped loading for me once I added my documentation" without telling us the problematic documentation.
# Before You Submit a Pull Request
Thanks for contributing to Slate! A couple of quick guidelines for submitting pull requests:
- **Please point your pull requests at the `dev` branch.** We don't accept pull requests to `master`.
- Please make sure your contributions work in the most recent version of Chrome, Firefox, and IE.
- If you're implementing a new feature, even if it's relatively small, it's nice to open an issue before you start so that others know what you're working on and can help make sure you're on the right track.
Thanks again! Happy coding.
\ No newline at end of file
source 'https://rubygems.org'
# Middleman
gem 'middleman', '~>4.0.0'
gem 'middleman-gh-pages', '~> 0.0.3'
gem 'middleman-syntax', '~> 2.1.0'
gem 'middleman-autoprefixer', '~> 2.7.0'
gem "middleman-sprockets", "~> 4.0.0.rc"
gem 'rouge', '~> 1.10.1'
gem 'redcarpet', '~> 3.3.2'
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.5.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
autoprefixer-rails (6.3.1)
execjs
json
backports (3.6.7)
capybara (2.5.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
concurrent-ruby (0.9.2)
contracts (0.12.0)
erubis (2.7.0)
execjs (2.6.0)
fastimage (1.8.1)
addressable (~> 2.3, >= 2.3.5)
ffi (1.9.10)
haml (4.0.7)
tilt
hamster (2.0.0)
concurrent-ruby (~> 0.8)
hashie (3.4.3)
i18n (0.7.0)
json (1.8.3)
kramdown (1.9.0)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
middleman (4.0.0)
coffee-script (~> 2.2)
compass-import-once (= 1.0.5)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-cli (= 4.0.0)
middleman-core (= 4.0.0)
sass (>= 3.4.0, < 4.0)
middleman-autoprefixer (2.7.0)
autoprefixer-rails (>= 6.3.1, < 7.0.0)
middleman-core (>= 3.3.3)
middleman-cli (4.0.0)
thor (>= 0.17.0, < 2.0)
middleman-core (4.0.0)
activesupport (~> 4.2)
addressable (~> 2.4.0)
backports (~> 3.6)
bundler (~> 1.1)
capybara (~> 2.5.0)
contracts (~> 0.12.0)
erubis
execjs (~> 2.0)
fastimage (~> 1.8)
hamster (~> 2.0)
hashie (~> 3.4)
i18n (~> 0.7.0)
listen (~> 3.0)
padrino-helpers (~> 0.13.0)
rack (>= 1.4.5, < 2.0)
sass (>= 3.4)
tilt (~> 1.4.1)
uglifier (~> 2.6)
middleman-gh-pages (0.0.3)
rake (> 0.9.3)
middleman-sprockets (4.0.0.rc.1)
middleman-core (>= 4.0.0.rc.1)
sprockets (~> 3.0)
middleman-syntax (2.1.0)
middleman-core (>= 3.2)
rouge (~> 1.0)
mime-types (3.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2015.1120)
mini_portile2 (2.0.0)
minitest (5.8.4)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
padrino-helpers (0.13.1)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.13.1)
tilt (~> 1.4.1)
padrino-support (0.13.1)
activesupport (>= 3.1)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redcarpet (3.3.4)
rouge (1.10.1)
sass (3.4.21)
sprockets (3.4.1)
rack (> 1, < 3)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
xpath (2.0.0)
nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
middleman (~> 4.0.0)
middleman-autoprefixer (~> 2.7.0)
middleman-gh-pages (~> 0.0.3)
middleman-sprockets (~> 4.0.0.rc)
middleman-syntax (~> 2.1.0)
redcarpet (~> 3.3.2)
rouge (~> 1.10.1)
BUNDLED WITH
1.10.6
Copyright 2015 SD Elements, Inc.
Copyright 2008-2013 Concur Technologies, Inc. Copyright 2008-2013 Concur Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may Licensed under the Apache License, Version 2.0 (the "License"); you may
......
<p align="center"> <p align="center">
<img src="https://raw.githubusercontent.com/lord/img/master/logo-slate.png" alt="Slate: API Documentation Generator" width="226"> <img src="https://raw.githubusercontent.com/lord/img/master/logo-slate.png" alt="Slate: API Documentation Generator" width="226">
<br>
<a href="https://travis-ci.org/tripit/slate"><img src="https://travis-ci.org/tripit/slate.svg?branch=master" alt="Build Status"></a>
</p> </p>
<p align="center"><i>A Node.js port of <a href="https://github.com/tripit/slate">tripit/slate</a></i></p>
<p align="center">Slate helps you create beautiful, intelligent, responsive API documentation.</p> <p align="center">Slate helps you create beautiful, intelligent, responsive API documentation.</p>
<p align="center"><img src="https://dl.dropboxusercontent.com/u/95847291/github%20images/slate/slate_screenshot_new.png" width=700 alt="Screenshot of Example Documentation created with Slate"></p> <p align="center"><img src="https://dl.dropboxusercontent.com/u/95847291/github%20images/slate/slate_screenshot_new.png" width=700 alt="Screenshot of Example Documentation created with Slate"></p>
...@@ -21,7 +21,7 @@ Features ...@@ -21,7 +21,7 @@ Features
* **Write code samples in multiple languages** — If your API has bindings in multiple programming languages, you can easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown. * **Write code samples in multiple languages** — If your API has bindings in multiple programming languages, you can easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown.
* **Out-of-the-box syntax highlighting** for [almost 60 languages](http://rouge.jayferd.us/demo), no configuration required. * **Out-of-the-box syntax highlighting** for [150 languages](https://highlightjs.org/), no configuration required.
* **Automatic, smoothly scrolling table of contents** on the far left of the page. As you scroll, it displays your current position in the document. It's fast, too. We're using Slate at TripIt to build documentation for our new API, where our table of contents has over 180 entries. We've made sure that the performance remains excellent, even for larger documents. * **Automatic, smoothly scrolling table of contents** on the far left of the page. As you scroll, it displays your current position in the document. It's fast, too. We're using Slate at TripIt to build documentation for our new API, where our table of contents has over 180 entries. We've made sure that the performance remains excellent, even for larger documents.
...@@ -38,70 +38,39 @@ Getting Started with Slate ...@@ -38,70 +38,39 @@ Getting Started with Slate
You're going to need: You're going to need:
- **Linux or OS X** — Windows may work, but is unsupported. - **Node.js**
- **Ruby, version 1.9.3 or newer**
- **Bundler** — If Ruby is already installed, but the `bundle` command doesn't work, just run `gem install bundler` in a terminal.
### Getting Set Up ### Getting Set Up
1. Fork this repository on Github. 1. Fork this repository on Github.
2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git` 2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/node-slate.git`
3. `cd slate` 3. `cd node-slate`
4. Initialize and start Slate. You can either do this locally, or with Vagrant: 4. Initialize and start Slate:
```shell ```shell
# either run this to run locally npm install
bundle install npm run build
bundle exec middleman server npm start
# OR run this to run with vagrant
vagrant up
``` ```
You can now see the docs at http://localhost:4567. Whoa! That was fast! You can now see the docs at http://localhost:4567. Whoa! That was fast!
Now that Slate is all set up your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/tripit/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/tripit/slate/wiki/Deploying-Slate). ### Commands
If you'd prefer to use Docker, instructions are available [in the wiki](https://github.com/tripit/slate/wiki/Docker).
Companies Using Slate
---------------------------------
* [NASA](https://api.nasa.gov)
* [IBM Cloudant](https://docs.cloudant.com/api.html)
* [Travis-CI](https://docs.travis-ci.com/api/)
* [Mozilla](http://mozilla.github.io/localForage/)
* [Appium](http://appium.io/slate/en/master)
* [Dwolla](https://docs.dwolla.com/)
* [Clearbit](https://clearbit.com/docs)
* [Coinbase](https://developers.coinbase.com/api)
* [Parrot Drones](http://developer.parrot.com/docs/bebop/)
* [Fidor Bank](http://docs.fidor.de/)
You can view more in [the list on the wiki](https://github.com/tripit/slate/wiki/Slate-in-the-Wild).
Need Help? Found a bug?
--------------------
Read our [contribution guidelines](https://github.com/tripit/slate/blob/master/CONTRIBUTING.md), and then [submit an issue](https://github.com/tripit/slate/issues) to the Slate Github if you need any help. And, of course, feel free to submit pull requests with bug fixes or changes. Compile documentation to static site in `./build`:
Contributors ```shell
-------------------- npm run build
```
Slate was built by [Robert Lord](https://lord.io) while at [TripIt](https://www.tripit.com/).
Thanks to the following people who have submitted major pull requests: Run a dev server that live-reloads at http://localhost:4567:
- [@chrissrogers](https://github.com/chrissrogers) ```shell
- [@bootstraponline](https://github.com/bootstraponline) npm start
- [@realityking](https://github.com/realityking) ```
Also, thanks to [Sauce Labs](http://saucelabs.com) for helping sponsor the project. Publish your docs to `origin/gh-pages` branch:
Special Thanks ```shell
-------------------- npm run deploy
- [Middleman](https://github.com/middleman/middleman) ```
- [jquery.tocify.js](https://github.com/gfranko/jquery.tocify.js)
- [middleman-syntax](https://github.com/middleman/middleman-syntax)
- [middleman-gh-pages](https://github.com/edgecase/middleman-gh-pages)
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network :forwarded_port, guest: 4567, host: 4567
config.vm.provision "bootstrap",
type: "shell",
inline: <<-SHELL
sudo apt-get update
sudo apt-get install -yq ruby2.0 ruby2.0-dev pkg-config build-essential nodejs git libxml2-dev libxslt-dev
sudo apt-get autoremove -yq
gem2.0 install --no-ri --no-rdoc bundler
SHELL
# add the local user git config to the vm
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
config.vm.provision "install",
type: "shell",
privileged: false,
inline: <<-SHELL
echo "=============================================="
echo "Installing app dependencies"
cd /vagrant
bundle config build.nokogiri --use-system-libraries
bundle install
SHELL
config.vm.provision "run",
type: "shell",
privileged: false,
run: "always",
inline: <<-SHELL
echo "=============================================="
echo "Starting up middleman at http://localhost:4567"
echo "If it does not come up, check the ~/middleman.log file for any error messages"
cd /vagrant
bundle exec middleman server --force-polling -l 1 &> ~/middleman.log &
SHELL
end
# Markdown
set :markdown_engine, :redcarpet
set :markdown,
fenced_code_blocks: true,
smartypants: true,
disable_indented_code_blocks: true,
prettify: true,
tables: true,
with_toc_data: true,
no_intra_emphasis: true
# Assets
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
set :fonts_dir, 'fonts'
# Activate the syntax highlighter
activate :syntax
activate :autoprefixer do |config|
config.browsers = ['last 2 version', 'Firefox ESR']
config.cascade = false
config.inline = true
end
# Github pages require relative links
activate :relative_assets
set :relative_links, true
# Build Configuration
configure :build do
# If you're having trouble with Middleman hanging, commenting
# out the following two lines has been known to help
activate :minify_css
activate :minify_javascript
# activate :relative_assets
# activate :asset_hash
# activate :gzip
end
...@@ -30,7 +30,7 @@ overridden by environment variables. Any environment variables are overridden ...@@ -30,7 +30,7 @@ overridden by environment variables. Any environment variables are overridden
by values set in a '.env' file (if it exists), and in turn by those set in a by values set in a '.env' file (if it exists), and in turn by those set in a
file specified by the '--config-file' option." file specified by the '--config-file' option."
bundle exec middleman build --clean npm run build
parse_args() { parse_args() {
# Set args from a local environment file. # Set args from a local environment file.
......
var fs = require('fs');
var gulp = require('gulp');
var cleanCSS = require('gulp-clean-css');
var concat = require('gulp-concat');
var ejs = require('gulp-ejs');
var gls = require('gulp-live-server');
var prettify = require('gulp-prettify');
var rename = require("gulp-rename");
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var gutil = require('gulp-util');
var del = require('del');
var highlight = require('highlight.js');
var marked = require('marked');
var yaml = require('js-yaml');
var renderer = new marked.Renderer();
renderer.code = function (code, language) {
var highlighted = language ? highlight.highlight(language, code).value
: highlight.highlightAuto(code).value;
return '<pre class="highlight ' + language + '"><code>' + highlighted + '</code></pre>';
};
var readIndexYml = function() {
return yaml.safeLoad(fs.readFileSync('./source/index.yml', 'utf8'));
};
gulp.task('clean', function(cb) {
del(['build'], cb);
});
gulp.task('fonts', function() {
return gulp.src('./source/fonts/**/*').pipe(gulp.dest('build/fonts'));
});
gulp.task('images', function() {
return gulp.src('./source/images/**/*').pipe(gulp.dest('build/images'));
});
gulp.task('js-no-search', function() {
return gulp.src([
'./source/javascripts/lib/_energize.js',
'./source/javascripts/lib/_jquery.js',
'./source/javascripts/lib/_jquery_ui.js',
'./source/javascripts/lib/_jquery.tocify.js',
'./source/javascripts/lib/_imagesloaded.min.js',
'./source/javascripts/app/_lang.js',
'./source/javascripts/app/_toc.js',
])
.pipe(concat('all_nosearch.js'))
.pipe(uglify())
.pipe(gulp.dest('./build/javascripts'));
});
gulp.task('js', function() {
return gulp.src([
'./source/javascripts/lib/_energize.js',
'./source/javascripts/lib/_jquery.js',
'./source/javascripts/lib/_jquery_ui.js',
'./source/javascripts/lib/_jquery.tocify.js',
'./source/javascripts/lib/_imagesloaded.min.js',
'./source/javascripts/lib/_lunr.js',
'./source/javascripts/lib/_jquery.highlight.js',
'./source/javascripts/app/_lang.js',
'./source/javascripts/app/_search.js',
'./source/javascripts/app/_toc.js',
])
.pipe(concat('all.js'))
.pipe(uglify())
.pipe(gulp.dest('./build/javascripts'));
});
gulp.task('sass', function () {
return gulp.src('./source/stylesheets/*.css.scss')
.pipe(sass().on('error', sass.logError))
.pipe(rename({ extname: ''}))
.pipe(cleanCSS())
.pipe(gulp.dest('./build/stylesheets'));
});
gulp.task('highlightjs', function () {
var config = readIndexYml();
var path = './node_modules/highlight.js/styles/' + config.highlight_theme + '.css';
return gulp.src(path)
.pipe(rename({ prefix: 'highlight-'}))
.pipe(cleanCSS())
.pipe(gulp.dest('./build/stylesheets'));
});
gulp.task('html', function () {
var config = readIndexYml();
var includes = config.includes
.map(function(include) { return './source/includes/' + include + '.md'; })
.map(function(include) { return fs.readFileSync(include, 'utf8'); })
.map(function(include) { return marked(include, { renderer: renderer }); });
var data = {
current_page: {
data: config
},
page_classes: '',
includes: includes,
image_tag: function(filename) {
return '<img src="images/' + filename + '">';
},
javascript_include_tag: function(name) {
return '<script src="javascripts/' + name + '.js" type="text/javascript"></script>';
},
stylesheet_link_tag: function(name, media) {
return '<link href="stylesheets/' + name + '.css" rel="stylesheet" type="text/css" media="' + media + '" />';
},
langs: (config.language_tabs || []).map(function(lang) {
return typeof lang == 'string' ? lang : lang.keys.first;
})
};
return gulp.src('./source/*.html')
.pipe(ejs(data).on('error', gutil.log))
.pipe(prettify({indent_size: 2}))
.pipe(gulp.dest('./build'));
});
gulp.task('default', ['clean', 'fonts', 'images', 'highlightjs', 'js', 'js-no-search', 'sass', 'html']);
gulp.task('serve', function() {
gulp.watch(['./source/*.html', './source/includes/**/*'], ['html']);
gulp.watch('./source/javascripts/**/*', ['js']);
gulp.watch('./source/stylesheets/**/*', ['sass']);
gulp.watch('./source/index.yml', ['highlightjs', 'html']);
var server = gls.static('build', 4567);
server.start();
gulp.watch(['build/**/*'], function (file) {
server.notify.apply(server, [file]);
});
});
{
"name": "node-slate",
"version": "1.0.0",
"description": "Node port of tripit/slate",
"main": "index.js",
"scripts": {
"start": "gulp serve",
"build": "gulp",
"deploy": "./deploy.sh"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sdelements/node-slate.git"
},
"author": "SD Elements",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/sdelements/node-slate/issues"
},
"homepage": "https://github.com/sdelements/node-slate#readme",
"devDependencies": {
"del": "^2.2.0",
"gulp": "^3.9.1",
"gulp-clean-css": "^2.0.4",
"gulp-cli": "^1.2.1",
"gulp-concat": "^2.6.0",
"gulp-ejs": "^2.1.1",
"gulp-live-server": "0.0.29",
"gulp-prettify": "^0.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"highlight.js": "^9.2.0",
"js-yaml": "^3.5.5",
"marked": "^0.3.5",
"node-sass": "^3.4.2"
}
}
---
title: API Reference
language_tabs:
- shell
- ruby
- python
toc_footers:
- <a href='#'>Sign Up for a Developer Key</a>
- <a href='https://github.com/tripit/slate'>Documentation Powered by Slate</a>
includes:
- errors
search: true
---
# Introduction # Introduction
Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database. Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.
...@@ -40,7 +22,7 @@ import kittn ...@@ -40,7 +22,7 @@ import kittn
api = kittn.authorize('meowmeowmeow') api = kittn.authorize('meowmeowmeow')
``` ```
```shell ```bash
# With shell, you can just pass the correct header with each request # With shell, you can just pass the correct header with each request
curl "api_endpoint_here" curl "api_endpoint_here"
-H "Authorization: meowmeowmeow" -H "Authorization: meowmeowmeow"
...@@ -76,7 +58,7 @@ api = kittn.authorize('meowmeowmeow') ...@@ -76,7 +58,7 @@ api = kittn.authorize('meowmeowmeow')
api.kittens.get() api.kittens.get()
``` ```
```shell ```bash
curl "http://example.com/api/kittens" curl "http://example.com/api/kittens"
-H "Authorization: meowmeowmeow" -H "Authorization: meowmeowmeow"
``` ```
...@@ -135,7 +117,7 @@ api = kittn.authorize('meowmeowmeow') ...@@ -135,7 +117,7 @@ api = kittn.authorize('meowmeowmeow')
api.kittens.get(2) api.kittens.get(2)
``` ```
```shell ```bash
curl "http://example.com/api/kittens/2" curl "http://example.com/api/kittens/2"
-H "Authorization: meowmeowmeow" -H "Authorization: meowmeowmeow"
``` ```
...@@ -165,4 +147,3 @@ This endpoint retrieves a specific kitten. ...@@ -165,4 +147,3 @@ This endpoint retrieves a specific kitten.
Parameter | Description Parameter | Description
--------- | ----------- --------- | -----------
ID | The ID of the kitten to retrieve ID | The ID of the kitten to retrieve
...@@ -13,7 +13,6 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the ...@@ -13,7 +13,6 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations License for the specific language governing permissions and limitations
under the License. under the License.
%> %>
<% language_tabs = current_page.data.language_tabs || [] %>
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
...@@ -22,74 +21,63 @@ under the License. ...@@ -22,74 +21,63 @@ under the License.
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><%= current_page.data.title || "API Documentation" %></title> <title><%= current_page.data.title || "API Documentation" %></title>
<style> <%- stylesheet_link_tag('screen', 'screen') %>
<%= Rouge::Themes::Base16::Monokai.render(:scope => '.highlight') %> <%- stylesheet_link_tag('print', 'print') %>
</style> <%- stylesheet_link_tag('highlight-' + current_page.data.highlight_theme, 'screen, print') %>
<%= stylesheet_link_tag :screen, media: :screen %> <% if (current_page.data.search) { %>
<%= stylesheet_link_tag :print, media: :print %> <%- javascript_include_tag('all') %>
<% if current_page.data.search %> <% } else { %>
<%= javascript_include_tag "all" %> <%- javascript_include_tag('all_nosearch') %>
<% else %> <% } %>
<%= javascript_include_tag "all_nosearch" %>
<% end %>
</head> </head>
<body class="<%= page_classes %>" data-languages="<%=h language_tabs.map{ |lang| lang.is_a?(Hash) ? lang.keys.first : lang }.to_json %>"> <body class="<%= page_classes %>" data-languages="<%= JSON.stringify(langs) %>">
<a href="#" id="nav-button"> <a href="#" id="nav-button">
<span> <span>
NAV NAV
<%= image_tag('navbar.png') %> <%- image_tag('navbar.png') %>
</span> </span>
</a> </a>
<div class="tocify-wrapper"> <div class="tocify-wrapper">
<%= image_tag "logo.png" %> <%- image_tag('logo.png') %>
<% if language_tabs %> <% if (langs) { %>
<div class="lang-selector"> <div class="lang-selector">
<% language_tabs.each do |lang| %> <% for(var i=0; i<langs.length; i++) { %>
<% if lang.is_a? Hash %> <a href="#" data-language-name="<%= langs[i] %>"><%= langs[i] %></a>
<a href="#" data-language-name="<%= lang.keys.first %>"><%= lang.values.first %></a> <% } %>
<% else %>
<a href="#" data-language-name="<%= lang %>"><%= lang %></a>
<% end %>
<% end %>
</div> </div>
<% end %> <% } %>
<% if current_page.data.search %> <% if (current_page.data.search) { %>
<div class="search"> <div class="search">
<input type="text" class="search" id="input-search" placeholder="Search"> <input type="text" class="search" id="input-search" placeholder="Search">
</div> </div>
<ul class="search-results"></ul> <ul class="search-results"></ul>
<% end %> <% } %>
<div id="toc"> <div id="toc">
</div> </div>
<% if current_page.data.toc_footers %> <% if (current_page.data.toc_footers) { %>
<ul class="toc-footer"> <ul class="toc-footer">
<% current_page.data.toc_footers.each do |footer| %> <% for(var i=0; i<current_page.data.toc_footers.length; i++) { %>
<li><%= footer %></li> <li><%- current_page.data.toc_footers[i] %></li>
<% end %> <% } %>
</ul> </ul>
<% end %> <% } %>
</div> </div>
<div class="page-wrapper"> <div class="page-wrapper">
<div class="dark-box"></div> <div class="dark-box"></div>
<div class="content"> <div class="content">
<%= yield %> <% for(var i=0; i<includes.length; i++) { %>
<% current_page.data.includes && current_page.data.includes.each do |include| %> <%- includes[i] %>
<%= partial "includes/#{include}" %> <% } %>
<% end %>
</div> </div>
<div class="dark-box"> <div class="dark-box">
<% if language_tabs %> <% if (langs) { %>
<div class="lang-selector"> <div class="lang-selector">
<% language_tabs.each do |lang| %> <% for(var i=0; i<langs.length; i++) { %>
<% if lang.is_a? Hash %> <a href="#" data-language-name="<%= langs[i] %>"><%= langs[i] %></a>
<a href="#" data-language-name="<%= lang.keys.first %>"><%= lang.values.first %></a> <% } %>
<% else %>
<a href="#" data-language-name="<%= lang %>"><%= lang %></a>
<% end %>
<% end %>
</div> </div>
<% end %> <% } %>
</div> </div>
</div> </div>
</body> </body>
......
title: API Reference
language_tabs:
- bash
- ruby
- python
toc_footers:
- <a href='#'>Sign Up for a Developer Key</a>
- <a href='https://github.com/tripit/slate'>Documentation Powered by Slate</a>
includes:
- main
- _errors
search: true
highlight_theme: monokai
@font-face { @font-face {
font-family: 'slate'; font-family: 'slate';
src:font-url('slate.eot?-syv14m'); src:url('../fonts/slate.eot?-syv14m');
src:font-url('slate.eot?#iefix-syv14m') format('embedded-opentype'), src:url('../fonts/slate.eot?#iefix-syv14m') format('embedded-opentype'),
font-url('slate.woff2?-syv14m') format('woff2'), url('../fonts/slate.woff2?-syv14m') format('woff2'),
font-url('slate.woff?-syv14m') format('woff'), url('../fonts/slate.woff?-syv14m') format('woff'),
font-url('slate.ttf?-syv14m') format('truetype'), url('../fonts/slate.ttf?-syv14m') format('truetype'),
font-url('slate.svg?-syv14m#slate') format('svg'); url('../fonts/slate.svg?-syv14m#slate') format('svg');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment