Skip to content

Commit b761d09

Browse files
committed
Deploy docs from eccd783
Ashwin Maroli: Document command-line-interface of importers (#507) Merge pull request 507
1 parent a5e6bc2 commit b761d09

File tree

38 files changed

+1717
-491
lines changed

38 files changed

+1717
-491
lines changed

css/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/style.css.map

+6-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/behance/index.html

+35-8
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ <h1>
243243

244244

245245
<div class="unit four-fifths">
246-
<article>
246+
<article class="importer">
247247
<h1>Behance</h1>
248248

249249

@@ -277,15 +277,42 @@ <h5>Additional Dependencies</h5>
277277

278278
</div>
279279

280-
<p>To import your posts from your <a href="http://behance.com">Behance</a>, generate an API token for your user account and run:</p>
280+
281+
282+
<h2>Invocation</h2>
283+
284+
285+
<p>
286+
Sample snippet to invoke the importer:
287+
<pre>jekyll import behance --user NAME --api_token TOKEN</pre>
288+
</p>
289+
290+
<div class="table-container">
291+
<table class="cli">
292+
<tr><th>Option &lt;PARAM&gt;</th><th colspan="3">Description</th></tr>
293+
294+
<tr class="required-option">
295+
<td><code>--user NAME</code></td>
296+
<td colspan="2"><p>The username of the account</p>
297+
</td>
298+
299+
</tr>
300+
301+
<tr class="required-option">
302+
<td><code>--api_token TOKEN</code></td>
303+
<td colspan="2"><p>The API access token for the account</p>
304+
</td>
305+
306+
</tr>
307+
308+
</table>
309+
310+
<div class="cli-table-note">Highlighted row(s) in table above indicate required options.</div>
311+
312+
</div>
313+
281314

282-
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>ruby <span class="nt">-r</span> rubygems <span class="nt">-e</span> <span class="s1">'require "jekyll-import";
283-
JekyllImport::Importers::Behance.run({
284-
"user" =&gt; "my_username",
285-
"api_token" =&gt; "my_api_token"
286-
})'</span></code></pre></figure>
287315

288-
<p>Both <code class="language-plaintext highlighter-rouge">user</code> and <code class="language-plaintext highlighter-rouge">api_token</code> are required.</p>
289316

290317

291318
<div class="button">

docs/blogger/index.html

+53-15
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ <h1>
243243

244244

245245
<div class="unit four-fifths">
246-
<article>
246+
<article class="importer">
247247
<h1>Blogger</h1>
248248

249249

@@ -277,20 +277,58 @@ <h5>Additional Dependencies</h5>
277277

278278
</div>
279279

280-
<p>To import your posts from your <a href="https://www.blogger.com/">Blogger</a>,
281-
you first have to <a href="https://support.google.com/blogger/answer/97416" title="Export or import your blog - Blogger Help">export the blog</a>
282-
to a XML file (<code class="language-plaintext highlighter-rouge">blog-MM-DD-YYYY.xml</code>),
283-
and run:</p>
284-
285-
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>ruby <span class="nt">-r</span> rubygems <span class="nt">-e</span> <span class="s1">'require "jekyll-import";
286-
JekyllImport::Importers::Blogger.run({
287-
"source" =&gt; "/path/to/blog-MM-DD-YYYY.xml",
288-
"no-blogger-info" =&gt; false, # not to leave blogger-URL info (id and old URL) in the front matter
289-
"replace-internal-link" =&gt; false, # replace internal links using the post_url liquid tag.
290-
})'</span></code></pre></figure>
291-
292-
<p>The only required field is <code class="language-plaintext highlighter-rouge">source</code>.
293-
The other fields default to their above values.</p>
280+
281+
282+
<h2>Invocation</h2>
283+
<p>
284+
<p>To import your posts from Blogger, you have to first <a href="https://support.google.com/blogger/answer/97416" title="Export or import your blog - Blogger Help">export the blog</a>
285+
to an XML file (<code class="language-plaintext highlighter-rouge">blog-MM-DD-YYYY.xml</code>).</p>
286+
287+
288+
</p>
289+
290+
<p>
291+
Sample snippet to invoke the importer:
292+
<pre>jekyll import blogger --source NAME --no-blogger-info --replace-internal-link --comments</pre>
293+
</p>
294+
295+
<div class="table-container">
296+
<table class="cli">
297+
<tr><th>Option &lt;PARAM&gt;</th><th colspan="3">Description</th></tr>
298+
299+
<tr class="required-option">
300+
<td><code>--source NAME</code></td>
301+
<td colspan="2"><p>The XML file (blog-MM-DD-YYYY.xml) path to import</p>
302+
</td>
303+
304+
</tr>
305+
306+
<tr>
307+
<td><code>--no-blogger-info</code></td>
308+
<td><p>not to leave blogger-URL info (id and old URL) in the front matter.</p>
309+
</td>
310+
<td><small>Default:&nbsp;&nbsp;<code>false</code></small></td>
311+
</tr>
312+
313+
<tr>
314+
<td><code>--replace-internal-link</code></td>
315+
<td><p>replace internal links using the post_url liquid tag.</p>
316+
</td>
317+
<td><small>Default:&nbsp;&nbsp;<code>false</code></small></td>
318+
</tr>
319+
320+
<tr>
321+
<td><code>--comments</code></td>
322+
<td><p>import comments to _comments collection.</p>
323+
</td>
324+
<td><small>Default:&nbsp;&nbsp;<code>false</code></small></td>
325+
</tr>
326+
327+
</table>
328+
329+
<div class="cli-table-note">Highlighted row(s) in table above indicate required options.</div>
330+
331+
</div>
294332

295333
<p>“Labels” will be included in export as “Tags”.</p>
296334

docs/contributing/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ <h1>
243243

244244

245245
<div class="unit four-fifths">
246-
<article>
246+
<article class="docs">
247247
<h1>Contributing</h1>
248248

249249

docs/csv/index.html

+34-15
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,42 @@ <h1>
243243

244244

245245
<div class="unit four-fifths">
246-
<article>
246+
<article class="importer">
247247
<h1>CSV</h1>
248248

249249

250250

251-
<p>To import your posts from a CSV file, run:</p>
251+
252+
253+
<h2>Invocation</h2>
254+
252255

253-
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>ruby <span class="nt">-r</span> rubygems <span class="nt">-e</span> <span class="s1">'require "jekyll-import";
254-
JekyllImport::Importers::CSV.run({
255-
"file" =&gt; "my_posts.csv"
256-
})'</span></code></pre></figure>
256+
<p>
257+
Sample snippet to invoke the importer:
258+
<pre>jekyll import csv --file NAME --no-front-matter</pre>
259+
</p>
260+
261+
<div class="table-container">
262+
<table class="cli">
263+
<tr><th>Option &lt;PARAM&gt;</th><th colspan="3">Description</th></tr>
264+
265+
<tr>
266+
<td><code>--file NAME</code></td>
267+
<td><p>The CSV file to import.</p>
268+
</td>
269+
<td><small>Default:&nbsp;&nbsp;<code>'posts.csv'</code></small></td>
270+
</tr>
271+
272+
<tr>
273+
<td><code>--no-front-matter</code></td>
274+
<td><p>Do not add the default front matter to the post body.</p>
275+
</td>
276+
<td><small>Default:&nbsp;&nbsp;<code>false</code></small></td>
277+
</tr>
278+
279+
</table>
280+
281+
</div>
257282

258283
<p>Your CSV file will be read in with the following columns:</p>
259284

@@ -265,15 +290,9 @@ <h1>CSV</h1>
265290
<li>filter (e.g. markdown, textile)</li>
266291
</ol>
267292

268-
<p>If you wish to specify custom front matter for each of your posts, you
269-
can use the <code class="language-plaintext highlighter-rouge">no-front-matter</code> option to prevent the default front matter
270-
from being written to the imported files:</p>
271-
272-
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>ruby <span class="nt">-r</span> rubygems <span class="nt">-e</span> <span class="s1">'require "jekyll-import";
273-
JekyllImport::Importers::CSV.run({
274-
"file" =&gt; "my_posts.csv",
275-
"no-front-matter" =&gt; true
276-
})'</span></code></pre></figure>
293+
<p>If you wish to specify custom front matter for each of your posts, you can use
294+
the <code class="language-plaintext highlighter-rouge">--no-front-matter</code> option to prevent the default front matter from being
295+
written to the imported files.</p>
277296

278297

279298

docs/dotclear/index.html

+35-7
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ <h1>
243243

244244

245245
<div class="unit four-fifths">
246-
<article>
246+
<article class="importer">
247247
<h1>Dotclear</h1>
248248

249249

@@ -284,13 +284,41 @@ <h5>Additional Dependencies</h5>
284284

285285
</div>
286286

287-
<p>To import your posts from a dotclear file, run:</p>
287+
288+
289+
<h2>Invocation</h2>
290+
291+
292+
<p>
293+
Sample snippet to invoke the importer:
294+
<pre>jekyll import dotclear --datafile PATH --mediafolder PATH</pre>
295+
</p>
296+
297+
<div class="table-container">
298+
<table class="cli">
299+
<tr><th>Option &lt;PARAM&gt;</th><th colspan="3">Description</th></tr>
300+
301+
<tr class="required-option">
302+
<td><code>--datafile PATH</code></td>
303+
<td colspan="2"><p>dotClear export file</p>
304+
</td>
305+
306+
</tr>
307+
308+
<tr class="required-option">
309+
<td><code>--mediafolder PATH</code></td>
310+
<td colspan="2"><p>dotClear media export folder (media.zip inflated)</p>
311+
</td>
312+
313+
</tr>
314+
315+
</table>
316+
317+
<div class="cli-table-note">Highlighted row(s) in table above indicate required options.</div>
318+
319+
</div>
320+
288321

289-
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>ruby <span class="nt">-r</span> rubygems <span class="nt">-e</span> <span class="s1">'require "jekyll-import";
290-
JekyllImport::Importers::Dotclear.run({
291-
"datafile" =&gt; "2019-....-backup.txt",
292-
"mediafolder" =&gt; "path/to/the/media (media.zip inflated)"
293-
})'</span></code></pre></figure>
294322

295323

296324

docs/drupal6/index.html

+76-26
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ <h1>
243243

244244

245245
<div class="unit four-fifths">
246-
<article>
246+
<article class="importer">
247247
<h1>Drupal 6</h1>
248248

249249

@@ -291,36 +291,86 @@ <h5>Additional Dependencies</h5>
291291

292292
</div>
293293

294-
<p>To import your posts from a <a href="http://drupal.org">Drupal 6</a> installation, run:</p>
294+
295+
296+
<h2>Invocation</h2>
297+
295298

296-
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>ruby <span class="nt">-r</span> rubygems <span class="nt">-e</span> <span class="s1">'require "jekyll-import";
297-
JekyllImport::Importers::Drupal6.run({
298-
"dbname" =&gt; "name",
299-
"user" =&gt; "myuser",
300-
"password" =&gt; "mypassword",
301-
"host" =&gt; "myhost",
302-
"prefix" =&gt; "mytableprefix",
303-
"types" =&gt; ["blog", "story", "article"]
304-
})'</span></code></pre></figure>
299+
<p>
300+
Sample snippet to invoke the importer:
301+
<pre>jekyll import drupal6 --dbname DB --user USER --engine [mysql|postgresql] --password PW --host HOST --port PORT --prefix PREFIX --types TYPE1[,TYPE2[,TYPE3...]]</pre>
302+
</p>
305303

306-
<p>The only required fields are <code class="language-plaintext highlighter-rouge">dbname</code> and <code class="language-plaintext highlighter-rouge">user</code>. <code class="language-plaintext highlighter-rouge">password</code> defaults to <code class="language-plaintext highlighter-rouge">""</code>,
307-
<code class="language-plaintext highlighter-rouge">host</code> defaults to <code class="language-plaintext highlighter-rouge">"localhost"</code>, and <code class="language-plaintext highlighter-rouge">prefix</code> defaults to <code class="language-plaintext highlighter-rouge">""</code>.</p>
304+
<div class="table-container">
305+
<table class="cli">
306+
<tr><th>Option &lt;PARAM&gt;</th><th colspan="3">Description</th></tr>
307+
308+
<tr class="required-option">
309+
<td><code>--dbname DB</code></td>
310+
<td colspan="2"><p>Database name</p>
311+
</td>
312+
313+
</tr>
314+
315+
<tr class="required-option">
316+
<td><code>--user USER</code></td>
317+
<td colspan="2"><p>Database user name</p>
318+
</td>
319+
320+
</tr>
321+
322+
<tr>
323+
<td><code>--engine [mysql|postgresql]</code></td>
324+
<td><p>Database engine</p>
325+
</td>
326+
<td><small>Default:&nbsp;&nbsp;<code>"mysql"</code></small></td>
327+
</tr>
328+
329+
<tr>
330+
<td><code>--password PW</code></td>
331+
<td><p>Database user’s password</p>
332+
</td>
333+
<td><small>Default:&nbsp;&nbsp;<code>""</code></small></td>
334+
</tr>
335+
336+
<tr>
337+
<td><code>--host HOST</code></td>
338+
<td><p>Database host name</p>
339+
</td>
340+
<td><small>Default:&nbsp;&nbsp;<code>"localhost"</code></small></td>
341+
</tr>
342+
343+
<tr>
344+
<td><code>--port PORT</code></td>
345+
<td><p>Database port name</p>
346+
</td>
347+
<td><small>Default:&nbsp;&nbsp;<code>"3306"</code></small></td>
348+
</tr>
349+
350+
<tr>
351+
<td><code>--prefix PREFIX</code></td>
352+
<td><p>Table prefix name</p>
353+
</td>
354+
<td><small>Default:&nbsp;&nbsp;<code>""</code></small></td>
355+
</tr>
356+
357+
<tr>
358+
<td><code>--types TYPE1[,TYPE2[,TYPE3...]]</code></td>
359+
<td><p>The Drupal content types to be imported</p>
360+
</td>
361+
<td><small>Default:&nbsp;&nbsp;<code>blog,story,article</code></small></td>
362+
</tr>
363+
364+
</table>
365+
366+
<div class="cli-table-note">Highlighted row(s) in table above indicate required options.</div>
367+
368+
</div>
308369

309370
<p>By default, this will pull in nodes of type <code class="language-plaintext highlighter-rouge">blog</code>, <code class="language-plaintext highlighter-rouge">story</code>, and <code class="language-plaintext highlighter-rouge">article</code>.
310371
To specify custom types, you can use the <code class="language-plaintext highlighter-rouge">types</code> option when you run the
311-
importer:</p>
312-
313-
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>ruby <span class="nt">-r</span> rubygems <span class="nt">-e</span> <span class="s1">'require "jekyll-import";
314-
JekyllImport::Importers::Drupal6.run({
315-
"dbname" =&gt; "name",
316-
"user" =&gt; "myuser",
317-
"password" =&gt; "mypassword",
318-
"host" =&gt; "myhost",
319-
"prefix" =&gt; "mytableprefix",
320-
"types" =&gt; ["blog", "post"]
321-
})'</span></code></pre></figure>
322-
323-
<p>That will import nodes of type <code class="language-plaintext highlighter-rouge">blog</code> and <code class="language-plaintext highlighter-rouge">post</code> only.</p>
372+
importer to select node types.</p>
373+
324374

325375

326376
<div class="button">

0 commit comments

Comments
 (0)