Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ highlighter: pygments
markdown: kramdown
kramdown:
input: GFM
line_width: 80
line_width: 80
3 changes: 2 additions & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="header">
<div class="left">

<h1><a href="{{ site.baseurl }}">WP REST API</a></h1>
<h1><a href="{{ site.baseurl }}">WP REST API <span>(v1 – Deprecated)</span></a></h1>
<ul>
<li><a href="{{ site.baseurl }}">WP REST API</a></li>
<li><a href="https://github.com/WP-API/WP-API">Source on GitHub</a></li>
Expand All @@ -12,6 +12,7 @@ <h1><a href="{{ site.baseurl }}">WP REST API</a></h1>
<li><a href="{{ site.baseurl }}internals.html">Internals</a></li>
<li><a href="{{ site.baseurl }}resources.html">Resources</a></li>
<li><a href="{{ site.baseurl }}misc.html">Misc</a></li>
<li><a class="v2-link" href="http://v2.wp-api.org/">Version 2 Documentation</a></li>
</ul>
</div>
<div class="right">
Expand Down
6 changes: 3 additions & 3 deletions _layouts/guide.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
---
<!doctype html>
<html>
Expand All @@ -20,8 +20,8 @@
<script src="{{ site.baseurl }}js/sidebar.js"></script>

<!-- Meta -->
<meta content="WP API" property="og:title">
<meta content="Official Documentation for the WP REST API" name="description">
<meta content="WP API version 1" property="og:title">
<meta content="Official Documentation for the WP REST API version 1" name="description">
</head>

{% include header.html %}
Expand Down
6 changes: 3 additions & 3 deletions _layouts/internals.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
---
<!doctype html>
<html>
Expand All @@ -20,8 +20,8 @@
<script src="{{ site.baseurl }}js/sidebar.js"></script>

<!-- Meta -->
<meta content="WP API" property="og:title">
<meta content="Official Documentation for the WP REST API" name="description">
<meta content="WP API version 1" property="og:title">
<meta content="Official Documentation for the WP REST API version 1" name="description">
</head>

{% include header.html %}
Expand Down
2 changes: 1 addition & 1 deletion guides.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: guide
---
Guides
Expand Down
2 changes: 1 addition & 1 deletion guides/authentication.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: guide
---
Authentication
Expand Down
107 changes: 107 additions & 0 deletions index-deprecated.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
title: WP REST API (v1) Documentation - deprecated
---
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">

<title>{{ page.title }}</title>

<!-- Flatdoc -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/rstacruz/flatdoc/gh-pages/legacy.js"></script>
<script src="https://cdn.rawgit.com/rstacruz/flatdoc/gh-pages/flatdoc.js"></script>

<link rel="stylesheet" href="{{ site.baseurl }}stylesheets/styles.css">
<link rel="stylesheet" href="{{ site.baseurl }}stylesheets/pygment_trac.css">

<script src="https://cdn.rawgit.com/rstacruz/flatdoc/gh-pages/theme-white/script.js"></script>

<!-- Meta -->
<meta content="WP API version 1" property="og:title">
<meta content="Official Documentation for WP API" name="description">

<!-- Initializer -->
<script>
var multi_github = function(multi) {
var urls = [];
var sort = {};
for (var i = multi.length - 1; i >= 0; i--) {
var bits = multi[i];
var url = 'https://api.github.com/repos/'+bits.repo+'/contents/'+bits.filepath+'?ref=master';
sort[bits.filepath] = i;

urls.push(url);
};
return function(callback) {
var requests = [];
for (var i = urls.length - 1; i >= 0; i--) {
requests.push($.get(urls[i]));
};

var promise = $.when.apply(null, requests);
promise.fail(function(e) { callback(e, null); });
promise.done(function(data) {
var responses = Array.prototype.slice.call(arguments);
responses.sort(function (a, b) {
var a_path = a[0].path;
var b_path = b[0].path;
var a_index = sort[a_path];
var b_index = sort[b_path];
return b_index - a_index;
})
var markdown = '';
for (var i = responses.length - 1; i >= 0; i--) {
markdown += window.Base64.decode( responses[i][0].content );
};
callback(null, markdown);
});
};
};
function slugify(text) {
return text.toLowerCase().match(/[a-z0-9]+/g).join('-');
}
Flatdoc.transformer.addIDs = function($content) {
$content.find('h1, h2, h3').each(function() {
var $el = $(this);
var text = $el.text();
var id = slugify(text);

switch ($el[0].nodeName) {
case 'H3':
var text = $el.prevAll("h2").first().text();
var id = slugify(text) + '_' + id;
// Fall-through

case 'H2':
var text = $el.prevAll("h1").first().text();
var id = slugify(text) + '_' + id;

}
$el.attr('id', id);
});
};
Flatdoc.run({
fetcher: multi_github([
{ repo: "WP-API/WP-API", filepath: "README.md" },
{ repo: "WP-API/WP-API", filepath: "docs/routes/routes.md" },
])
});
</script>
</head>

{% include header.html %}

<div class="content-root">

{% include sidebar.html %}

<div class="v2-pointer"><p>This site is for the legacy version (v1) of the API. <a href="http://v2.wp-api.org/">View Version 2 Documentation</a></p></div>

<div role="flatdoc-content" class="content"></div>
</div>

{% include footer.html %}
104 changes: 24 additions & 80 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP API Documentation
title: WP REST API Documentation
---
<!doctype html>
<html>
Expand All @@ -10,98 +10,42 @@

<title>{{ page.title }}</title>

<!-- Flatdoc -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/rstacruz/flatdoc/gh-pages/legacy.js"></script>
<script src="https://cdn.rawgit.com/rstacruz/flatdoc/gh-pages/flatdoc.js"></script>

<link rel="stylesheet" href="{{ site.baseurl }}stylesheets/styles.css">
<link rel="stylesheet" href="{{ site.baseurl }}stylesheets/pygment_trac.css">

<script src="https://cdn.rawgit.com/rstacruz/flatdoc/gh-pages/theme-white/script.js"></script>

<!-- Meta -->
<meta content="WP API" property="og:title">
<meta content="Official Documentation for WP API" name="description">

<!-- Initializer -->
<script>
var multi_github = function(multi) {
var urls = [];
var sort = {};
for (var i = multi.length - 1; i >= 0; i--) {
var bits = multi[i];
var url = 'https://api.github.com/repos/'+bits.repo+'/contents/'+bits.filepath+'?ref=master';
sort[bits.filepath] = i;

urls.push(url);
};
return function(callback) {
var requests = [];
for (var i = urls.length - 1; i >= 0; i--) {
requests.push($.get(urls[i]));
};

var promise = $.when.apply(null, requests);
promise.fail(function(e) { callback(e, null); });
promise.done(function(data) {
var responses = Array.prototype.slice.call(arguments);
responses.sort(function (a, b) {
var a_path = a[0].path;
var b_path = b[0].path;
var a_index = sort[a_path];
var b_index = sort[b_path];
return b_index - a_index;
})
var markdown = '';
for (var i = responses.length - 1; i >= 0; i--) {
markdown += window.Base64.decode( responses[i][0].content );
};
callback(null, markdown);
});
};
};
function slugify(text) {
return text.toLowerCase().match(/[a-z0-9]+/g).join('-');
}
Flatdoc.transformer.addIDs = function($content) {
$content.find('h1, h2, h3').each(function() {
var $el = $(this);
var text = $el.text();
var id = slugify(text);

switch ($el[0].nodeName) {
case 'H3':
var text = $el.prevAll("h2").first().text();
var id = slugify(text) + '_' + id;
// Fall-through

case 'H2':
var text = $el.prevAll("h1").first().text();
var id = slugify(text) + '_' + id;

}
$el.attr('id', id);
});
};
Flatdoc.run({
fetcher: multi_github([
{ repo: "WP-API/WP-API", filepath: "README.md" },
{ repo: "WP-API/WP-API", filepath: "docs/routes/routes.md" },
])
});
</script>
<meta content="WP API Documentation" property="og:title">
<meta content="Official Documentation for WP REST API" name="description">
</head>

{% include header.html %}
<body role="flatdoc" class="large-brief no-literate">

<div class="header">
<div class="left">

<h1><a href="http://v2.wp-api.org/">WP REST API</a></h1>
<ul>
<li><a href="https://github.com/WP-API/WP-API">Source on GitHub</a></li>
<li><a href="https://github.com/WP-API/WP-API/issues">Issues</a></li>
</ul>
</div>
<div class="right">
<!-- GitHub buttons: see http://ghbtns.com -->
<iframe src="http://ghbtns.com/github-btn.html?user=WP-API&amp;repo=WP-API&amp;type=watch&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</div>
</div>

<div class="content-root">

{% include sidebar.html %}

<div class="v2-pointer"><p>This site is for the legacy version (v1) of the API. <a href="http://v2.wp-api.org/">View Version 2 Documentation</a></p></div>
<div class="v2-pointer">
<p><a class="button" href="http://v2.wp-api.org/">View Version 2 Documentation</a></p>
<p>or continue to the <a href="/index-deprecated.html">Version 1 Documentation</a>.</p>
</div>


<div role="flatdoc-content" class="content"></div>
</div>

{% include footer.html %}
2 changes: 1 addition & 1 deletion internals.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: internals
---
Internals
Expand Down
2 changes: 1 addition & 1 deletion internals/implementation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: internals
---

Expand Down
2 changes: 1 addition & 1 deletion internals/philosophy.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: internals
---

Expand Down
2 changes: 1 addition & 1 deletion internals/release-process.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: internals
---

Expand Down
2 changes: 1 addition & 1 deletion misc.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: internals
---
Miscellaneous
Expand Down
2 changes: 1 addition & 1 deletion misc/comparison.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: internals
---
# WordPress JSON API Comparison
Expand Down
2 changes: 1 addition & 1 deletion misc/compatibility.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: internals
---
Compatibility
Expand Down
2 changes: 1 addition & 1 deletion resources.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: WP REST API Documentation
title: WP REST API (v1) Documentation - deprecated
layout: internals
---
Resources
Expand Down
Loading