Skip to content

Commit 0b23fdb

Browse files
committed
First doc, tweaks for render
1 parent 49f6743 commit 0b23fdb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+17606
-98
lines changed

01-diffbot.rst

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,51 @@
66
Diffbot Class
77
=============
88

9-
The Diffbot class is the first instance a developer must create when using the client. It serves as container for global settings, and as a factory for the various API endpoint classes.
9+
.. php:namespace:: Swader\Diffbot
1010
11+
.. php:class:: Diffbot
12+
13+
The Diffbot class is the first instance a developer must create when using the client. It serves as a container for global settings, and as a factory for the various API endpoint classes. The Diffbot class takes a single optional argument, the ``$token``, which can be obtained `here <https://diffbot.com/pricing>`_. Instantiate like so::
14+
15+
$diffbot = new Diffbot("my_token");
16+
17+
Alternatively, set the token globally, and instantiate without passing in the parameter::
18+
19+
Diffbot::setToken("my_token");
20+
$diffbot = new Diffbot();
21+
22+
Note that if you instantiate without a global token set, and don't pass in a token while instantiating either, you'll get a \\DiffbotException.
23+
24+
25+
:hidden:`setToken`
26+
""""""""""""""""""
27+
28+
.. php:staticmethod:: setToken($token)
29+
30+
Useful for setting a default token for all future instances.
31+
32+
:param string $token: The token.
33+
:returns: void, or throws an \\InvalidArgumentException if the token is invalid
34+
35+
Usage::
36+
37+
Diffbot::setToken("my_token");
38+
39+
40+
:hidden:`getToken`
41+
""""""""""""""""""
42+
43+
.. php:method:: getToken()
44+
45+
Returns either the instance token, or the globally defined one - or null if neither is defined
46+
47+
:returns: null or string
48+
49+
Usage::
50+
51+
echo $diffbot->getToken(); // "my_token"
52+
53+
54+
The Diffbot class is the starting point of your API usage. Whenever you use the Diffbot PHP Client, you must start with the steps above.
55+
56+
Next, we'll take a look at an API class.

_build/doctrees/01-diffbot.doctree

14.5 KB
Binary file not shown.

_build/doctrees/environment.pickle

2.05 KB
Binary file not shown.

_build/doctrees/index.doctree

-351 Bytes
Binary file not shown.

_build/doctrees/overview.doctree

-2.88 KB
Binary file not shown.

_build/html/en/01-diffbot.html

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
2+
3+
<!DOCTYPE html>
4+
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
5+
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
6+
<head>
7+
<meta charset="utf-8">
8+
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
10+
11+
<title>Diffbot Class &mdash; Diffbot PHP Client Documentation 1 documentation</title>
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
28+
29+
30+
31+
32+
33+
<link rel="top" title="Diffbot PHP Client Documentation 1 documentation" href="index.html"/>
34+
<link rel="prev" title="Overview" href="overview.html"/>
35+
36+
37+
<script src="_static/js/modernizr.min.js"></script>
38+
39+
</head>
40+
41+
<body class="wy-body-for-nav" role="document">
42+
43+
<div class="wy-grid-for-nav">
44+
45+
46+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
47+
<div class="wy-side-nav-search">
48+
49+
50+
51+
<a href="index.html" class="icon icon-home"> Diffbot PHP Client Documentation
52+
53+
54+
55+
</a>
56+
57+
58+
<div role="search">
59+
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
60+
<input type="text" name="q" placeholder="Search docs" />
61+
<input type="hidden" name="check_keywords" value="yes" />
62+
<input type="hidden" name="area" value="default" />
63+
</form>
64+
</div>
65+
66+
67+
</div>
68+
69+
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
70+
71+
72+
73+
<ul class="current">
74+
<li class="toctree-l1"><a class="reference internal" href="overview.html">Overview</a><ul>
75+
<li class="toctree-l2"><a class="reference internal" href="overview.html#diffbot">Diffbot</a></li>
76+
<li class="toctree-l2"><a class="reference internal" href="overview.html#diffbot-php-client">Diffbot PHP Client</a><ul>
77+
<li class="toctree-l3"><a class="reference internal" href="overview.html#quickstart">Quickstart</a></li>
78+
</ul>
79+
</li>
80+
</ul>
81+
</li>
82+
<li class="toctree-l1 current"><a class="current reference internal" href="">Diffbot Class</a><ul>
83+
<li class="toctree-l2"><a class="reference internal" href="#settoken"><span class="hidden">setToken</span></a></li>
84+
<li class="toctree-l2"><a class="reference internal" href="#gettoken"><span class="hidden">getToken</span></a></li>
85+
</ul>
86+
</li>
87+
</ul>
88+
89+
90+
91+
</div>
92+
&nbsp;
93+
</nav>
94+
95+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
96+
97+
98+
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
99+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
100+
<a href="index.html">Diffbot PHP Client Documentation</a>
101+
</nav>
102+
103+
104+
105+
<div class="wy-nav-content">
106+
<div class="rst-content">
107+
<div role="navigation" aria-label="breadcrumbs navigation">
108+
<ul class="wy-breadcrumbs">
109+
<li><a href="index.html">Docs</a> &raquo;</li>
110+
111+
<li>Diffbot Class</li>
112+
<li class="wy-breadcrumbs-aside">
113+
114+
115+
<a href="_sources/01-diffbot.txt" rel="nofollow"> View page source</a>
116+
117+
118+
</li>
119+
</ul>
120+
<hr/>
121+
</div>
122+
<div role="main" class="document">
123+
124+
<div class="section" id="namespace-Swader\Diffbot">
125+
<span id="diffbot-class"></span><h1>Diffbot Class<a class="headerlink" href="#namespace-Swader\Diffbot" title="Permalink to this headline"></a></h1>
126+
<dl class="class">
127+
<dt id="Swader\Diffbot\Diffbot">
128+
<em class="property">class </em><code class="descclassname">Swader\Diffbot\</code><code class="descname">Diffbot</code><a class="headerlink" href="#Swader\Diffbot\Diffbot" title="Permalink to this definition"></a></dt>
129+
<dd><p>The Diffbot class is the first instance a developer must create when using the client. It serves as a container for global settings, and as a factory for the various API endpoint classes. The Diffbot class takes a single optional argument, the <code class="docutils literal"><span class="pre">$token</span></code>, which can be obtained <a class="reference external" href="https://diffbot.com/pricing">here</a>. Instantiate like so:</p>
130+
<div class="highlight-php"><div class="highlight"><pre><span class="nv">$diffbot</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Diffbot</span><span class="p">(</span><span class="s2">&quot;my_token&quot;</span><span class="p">);</span>
131+
</pre></div>
132+
</div>
133+
<p>Alternatively, set the token globally, and instantiate without passing in the parameter:</p>
134+
<div class="highlight-php"><div class="highlight"><pre><span class="nx">Diffbot</span><span class="o">::</span><span class="na">setToken</span><span class="p">(</span><span class="s2">&quot;my_token&quot;</span><span class="p">);</span>
135+
<span class="nv">$diffbot</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Diffbot</span><span class="p">();</span>
136+
</pre></div>
137+
</div>
138+
<p>Note that if you instantiate without a global token set, and don&#8217;t pass in a token while instantiating either, you&#8217;ll get a \DiffbotException.</p>
139+
</dd></dl>
140+
141+
<div class="section" id="settoken">
142+
<h2><span class="hidden">setToken</span><a class="headerlink" href="#settoken" title="Permalink to this headline"></a></h2>
143+
<blockquote>
144+
<div><dl class="staticmethod">
145+
<dt id="Swader\Diffbot\Diffbot::setToken">
146+
<em class="property">static </em><code class="descclassname">Swader\Diffbot\Diffbot::</code><code class="descname">setToken</code><span class="sig-paren">(</span><em>$token</em><span class="sig-paren">)</span><a class="headerlink" href="#Swader\Diffbot\Diffbot::setToken" title="Permalink to this definition"></a></dt>
147+
<dd><p>Useful for setting a default token for all future instances.</p>
148+
<table class="docutils field-list" frame="void" rules="none">
149+
<col class="field-name" />
150+
<col class="field-body" />
151+
<tbody valign="top">
152+
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
153+
<li><strong>$token</strong> (<em>string</em>) &#8211; The token.</li>
154+
</ul>
155+
</td>
156+
</tr>
157+
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">void, or throws an \InvalidArgumentException if the token is invalid</p>
158+
</td>
159+
</tr>
160+
</tbody>
161+
</table>
162+
<p>Usage:</p>
163+
<div class="highlight-php"><div class="highlight"><pre><span class="nx">Diffbot</span><span class="o">::</span><span class="na">setToken</span><span class="p">(</span><span class="s2">&quot;my_token&quot;</span><span class="p">);</span>
164+
</pre></div>
165+
</div>
166+
</dd></dl>
167+
168+
</div></blockquote>
169+
</div>
170+
<div class="section" id="gettoken">
171+
<h2><span class="hidden">getToken</span><a class="headerlink" href="#gettoken" title="Permalink to this headline"></a></h2>
172+
<blockquote>
173+
<div><dl class="method">
174+
<dt id="Swader\Diffbot\Diffbot::getToken">
175+
<code class="descclassname">Swader\Diffbot\Diffbot::</code><code class="descname">getToken</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#Swader\Diffbot\Diffbot::getToken" title="Permalink to this definition"></a></dt>
176+
<dd><p>Returns either the instance token, or the globally defined one - or null if neither is defined</p>
177+
<table class="docutils field-list" frame="void" rules="none">
178+
<col class="field-name" />
179+
<col class="field-body" />
180+
<tbody valign="top">
181+
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">null or string</td>
182+
</tr>
183+
</tbody>
184+
</table>
185+
<p>Usage:</p>
186+
<div class="highlight-php"><div class="highlight"><pre><span class="k">echo</span> <span class="nv">$diffbot</span><span class="o">-&gt;</span><span class="na">getToken</span><span class="p">();</span> <span class="c1">// &quot;my_token&quot;</span>
187+
</pre></div>
188+
</div>
189+
</dd></dl>
190+
191+
</div></blockquote>
192+
<p>The Diffbot class is the starting point of your API usage. Whenever you use the Diffbot PHP Client, you must start with the steps above.</p>
193+
<p>Next, we&#8217;ll take a look at an API class.</p>
194+
</div>
195+
</div>
196+
197+
198+
</div>
199+
<footer>
200+
201+
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
202+
203+
204+
<a href="overview.html" class="btn btn-neutral" title="Overview" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
205+
206+
</div>
207+
208+
209+
<hr/>
210+
211+
<div role="contentinfo">
212+
<p>
213+
&copy; Copyright 2015, Bruno Skvorc.
214+
</p>
215+
</div>
216+
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
217+
218+
</footer>
219+
220+
</div>
221+
</div>
222+
223+
</section>
224+
225+
</div>
226+
227+
228+
229+
230+
231+
<script type="text/javascript">
232+
var DOCUMENTATION_OPTIONS = {
233+
URL_ROOT:'./',
234+
VERSION:'1',
235+
COLLAPSE_INDEX:false,
236+
FILE_SUFFIX:'.html',
237+
HAS_SOURCE: true
238+
};
239+
</script>
240+
<script type="text/javascript" src="_static/jquery.js"></script>
241+
<script type="text/javascript" src="_static/underscore.js"></script>
242+
<script type="text/javascript" src="_static/doctools.js"></script>
243+
244+
245+
246+
247+
248+
<script type="text/javascript" src="_static/js/theme.js"></script>
249+
250+
251+
252+
253+
<script type="text/javascript">
254+
jQuery(function () {
255+
SphinxRtdTheme.StickyNav.enable();
256+
});
257+
</script>
258+
259+
260+
</body>
261+
</html>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.. The overview file describes the purpose of the library
2+
Added: August 30th, 2015
3+
Author: Bruno Skvorc <[email protected]>
4+
5+
=============
6+
Diffbot Class
7+
=============
8+
9+
.. php:namespace:: Swader\Diffbot
10+
11+
.. php:class:: Diffbot
12+
13+
The Diffbot class is the first instance a developer must create when using the client. It serves as a container for global settings, and as a factory for the various API endpoint classes. The Diffbot class takes a single optional argument, the ``$token``, which can be obtained `here <https://diffbot.com/pricing>`_. Instantiate like so::
14+
15+
$diffbot = new Diffbot("my_token");
16+
17+
Alternatively, set the token globally, and instantiate without passing in the parameter::
18+
19+
Diffbot::setToken("my_token");
20+
$diffbot = new Diffbot();
21+
22+
Note that if you instantiate without a global token set, and don't pass in a token while instantiating either, you'll get a \\DiffbotException.
23+
24+
25+
:hidden:`setToken`
26+
""""""""""""""""""
27+
28+
.. php:staticmethod:: setToken($token)
29+
30+
Useful for setting a default token for all future instances.
31+
32+
:param string $token: The token.
33+
:returns: void, or throws an \\InvalidArgumentException if the token is invalid
34+
35+
Usage::
36+
37+
Diffbot::setToken("my_token");
38+
39+
40+
:hidden:`getToken`
41+
""""""""""""""""""
42+
43+
.. php:method:: getToken()
44+
45+
Returns either the instance token, or the globally defined one - or null if neither is defined
46+
47+
:returns: null or string
48+
49+
Usage::
50+
51+
echo $diffbot->getToken(); // "my_token"
52+
53+
54+
The Diffbot class is the starting point of your API usage. Whenever you use the Diffbot PHP Client, you must start with the steps above.
55+
56+
Next, we'll take a look at an API class.

_build/html/en/_sources/index.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ If this is your first time encountering the PHP client, it's recommended you rea
1313
Contents:
1414

1515
.. toctree::
16-
:maxdepth: 2
16+
:maxdepth: 3
1717

1818
overview
19+
01-diffbot

_build/html/en/_sources/overview.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.. The overview file describes the purpose of the library
22
Added: August 30th, 2015
3+
Author: Bruno Skvorc <[email protected]>
34

45
========
56
Overview

0 commit comments

Comments
 (0)