-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document command-line-interface of importers #507
Changes from all commits
eef3313
afc7280
b116c38
679d6ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,7 @@ | ||
--- | ||
layout: docs | ||
title: Behance | ||
importer: true | ||
prev_section: usage | ||
link_source: behance | ||
next_section: blogger | ||
permalink: /docs/behance/ | ||
--- | ||
|
||
To import your posts from your [Behance](http://behance.com), generate an API token for your user account and run: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Behance.run({ | ||
"user" => "my_username", | ||
"api_token" => "my_api_token" | ||
})' | ||
{% endhighlight %} | ||
|
||
Both `user` and `api_token` are required. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,13 @@ | ||
--- | ||
layout: docs | ||
title: Blogger | ||
importer: true | ||
prev_section: behance | ||
link_source: blogger | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Side note: could we lexically alphabetize the list of importers and set these in a plugin or in Liquid too? This seems a bit inefficient to list them all here. When adding a new importer, the contributor has to know the order of their new importer in the context of other importers which we could easily get a computer to figure that out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically, this is not needed at all. At least with modern Jekyll because basically there's already the concept of |
||
next_section: csv | ||
permalink: /docs/blogger/ | ||
--- | ||
|
||
To import your posts from your [Blogger](https://www.blogger.com/), | ||
you first have to [export the blog][export-blogger-xml] | ||
to a XML file (`blog-MM-DD-YYYY.xml`), | ||
and run: | ||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Blogger.run({ | ||
"source" => "/path/to/blog-MM-DD-YYYY.xml", | ||
"no-blogger-info" => false, # not to leave blogger-URL info (id and old URL) in the front matter | ||
"replace-internal-link" => false, # replace internal links using the post_url liquid tag. | ||
})' | ||
{% endhighlight %} | ||
prereq_info: |- | ||
To import your posts from Blogger, you have to first [export the blog][export-blogger-xml] | ||
to an XML file (`blog-MM-DD-YYYY.xml`). | ||
|
||
The only required field is `source`. | ||
The other fields default to their above values. | ||
[export-blogger-xml]: https://support.google.com/blogger/answer/97416 "Export or import your blog - Blogger Help" | ||
--- | ||
|
||
"Labels" will be included in export as "Tags". | ||
|
||
[export-blogger-xml]: https://support.google.com/blogger/answer/97416 "Export or import your blog - Blogger Help" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,6 @@ | ||
--- | ||
layout: docs | ||
title: Dotclear | ||
prev_section: csv | ||
link_source: dotclear | ||
next_section: drupal6 | ||
permalink: /docs/dotclear/ | ||
--- | ||
|
||
To import your posts from a dotclear file, run: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Dotclear.run({ | ||
"datafile" => "2019-....-backup.txt", | ||
"mediafolder" => "path/to/the/media (media.zip inflated)" | ||
})' | ||
{% endhighlight %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,10 @@ | ||
--- | ||
layout: docs | ||
title: Drupal 6 | ||
prev_section: csv | ||
link_source: drupal6 | ||
next_section: drupal7 | ||
permalink: /docs/drupal6/ | ||
--- | ||
|
||
To import your posts from a [Drupal 6](http://drupal.org) installation, run: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Drupal6.run({ | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost", | ||
"prefix" => "mytableprefix", | ||
"types" => ["blog", "story", "article"] | ||
})' | ||
{% endhighlight %} | ||
|
||
The only required fields are `dbname` and `user`. `password` defaults to `""`, | ||
`host` defaults to `"localhost"`, and `prefix` defaults to `""`. | ||
|
||
By default, this will pull in nodes of type `blog`, `story`, and `article`. | ||
To specify custom types, you can use the `types` option when you run the | ||
importer: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Drupal6.run({ | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost", | ||
"prefix" => "mytableprefix", | ||
"types" => ["blog", "post"] | ||
})' | ||
{% endhighlight %} | ||
|
||
That will import nodes of type `blog` and `post` only. | ||
importer to select node types. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,10 @@ | ||
--- | ||
layout: docs | ||
title: Drupal 7 | ||
prev_section: drupal6 | ||
link_source: drupal7 | ||
next_section: drupal8 | ||
permalink: /docs/drupal7/ | ||
--- | ||
|
||
To import your posts from a [Drupal 7](http://drupal.org) installation, run: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Drupal7.run({ | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost", | ||
"prefix" => "mytableprefix", | ||
"types" => ["blog", "story", "article"] | ||
})' | ||
{% endhighlight %} | ||
|
||
The only required fields are `dbname` and `user`. `password` defaults to `""`, | ||
`host` defaults to `"localhost"`, and `prefix` defaults to `""`. | ||
|
||
By default, this will pull in nodes of type `blog`, `story`, and `article`. | ||
To specify custom types, you can use the `types` option when you run the | ||
importer: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Drupal7.run({ | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost", | ||
"prefix" => "mytableprefix", | ||
"types" => ["blog", "post"] | ||
})' | ||
{% endhighlight %} | ||
|
||
That will import nodes of type `blog` and `post` only. | ||
|
||
The default Drupal 7 expects database to be MySQL. If you want to import posts | ||
from Drupal 7 installation with PostgreSQL define `"engine"` as `"postgresql"`: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Drupal7.run({ | ||
"engine" => "postgresql", | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost", | ||
"prefix" => "mytableprefix", | ||
"types" => ["blog", "story", "article"] | ||
})' | ||
{% endhighlight %} | ||
importer to select node types. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,10 @@ | ||
--- | ||
layout: docs | ||
title: Drupal 8 | ||
prev_section: drupal7 | ||
link_source: drupal8 | ||
next_section: easyblog | ||
permalink: /docs/drupal8/ | ||
--- | ||
|
||
To import your posts from a [Drupal 8](http://drupal.org) installation, run: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Drupal8.run({ | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost", | ||
"prefix" => "mytableprefix", | ||
"types" => ["blog", "story", "article"] | ||
})' | ||
{% endhighlight %} | ||
|
||
The only required fields are `dbname` and `user`. `password` defaults to `""`, | ||
`host` defaults to `"localhost"`, and `prefix` defaults to `""`. | ||
|
||
By default, this will pull in nodes of type `blog`, `story`, and `article`. | ||
To specify custom types, you can use the `types` option when you run the | ||
importer: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Drupal8.run({ | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost", | ||
"prefix" => "mytableprefix", | ||
"types" => ["blog", "post"] | ||
})' | ||
{% endhighlight %} | ||
|
||
That will import nodes of type `blog` and `post` only. | ||
|
||
The default Drupal 8 expects database to be MySQL. If you want to import posts | ||
from Drupal 8 installation with PostgreSQL define `"engine"` as `"postgresql"`: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Drupal8.run({ | ||
"engine" => "postgresql", | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost", | ||
"prefix" => "mytableprefix", | ||
"types" => ["blog", "story", "article"] | ||
})' | ||
{% endhighlight %} | ||
importer to select node types. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,6 @@ | ||
--- | ||
layout: docs | ||
title: EasyBlog | ||
prev_section: drupal8 | ||
link_source: easyblog | ||
next_section: enki | ||
permalink: /docs/easyblog/ | ||
--- | ||
|
||
To import your posts from a [EasyBlog](http://stackideas.com/easyblog) installation, run: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Easyblog.run({ | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost", | ||
"prefix" => "mytableprefix" | ||
})' | ||
{% endhighlight %} | ||
|
||
The only required fields are `dbname` and `user`. `password` defaults to `""`, | ||
`host` defaults to `"localhost"` | ||
`prefix` defaults to `"jos_"`. This will export all articles (in any state). Category and tags will be included in export. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,5 @@ | ||
--- | ||
layout: docs | ||
title: Enki | ||
prev_section: easyblog | ||
link_source: enki | ||
next_section: ghost | ||
permalink: /docs/enki/ | ||
--- | ||
|
||
To import your posts from a [Enki](https://github.com/xaviershay/enki) installation, run: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Enki.run({ | ||
"dbname" => "name", | ||
"user" => "myuser", | ||
"password" => "mypassword", | ||
"host" => "myhost" | ||
})' | ||
{% endhighlight %} | ||
|
||
The only required fields are `dbname` and `user`. `password` defaults to `""` | ||
and `host` defaults to `"localhost"`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
--- | ||
layout: docs | ||
title: Ghost | ||
prev_section: enki | ||
link_source: ghost | ||
next_section: google_reader | ||
permalink: /docs/ghost/ | ||
--- | ||
|
||
To import your posts from your self-hosted Ghost instance, you first have to download your ghost.db from your server and run: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::Ghost.run({ | ||
"dbfile" => "/path/to/your/ghost.db" | ||
})' | ||
{% endhighlight %} | ||
|
||
There are no required fields. `dbfile` defaults to `"ghost.db"`. | ||
|
||
If you have a Ghost backup file, consider using another tool called [jekyll_ghost_importer](https://github.com/eloyesp/jekyll_ghost_importer) to import your content. It is a separate gem and docs can be found at the link provided. | ||
If you have a Ghost backup file, consider using another tool called | ||
[jekyll_ghost_importer](https://github.com/eloyesp/jekyll_ghost_importer) to | ||
import your content. It is a separate gem and docs can be found at the link | ||
provided. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
--- | ||
layout: docs | ||
title: Google Reader | ||
prev_section: enki | ||
link_source: google_reader | ||
next_section: joomla | ||
permalink: /docs/google_reader/ | ||
--- | ||
|
||
To import your posts from a [Google Reader](http://reader.google.com) XML dump file, run: | ||
|
||
{% highlight bash %} | ||
$ ruby -r rubygems -e 'require "jekyll-import"; | ||
JekyllImport::Importers::GoogleReader.run({ | ||
"source" => "my_file.xml" | ||
})' | ||
{% endhighlight %} | ||
|
||
The `source` field is required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin you wrote is super cool and the final output is amazing! I'm kind of sad that a reader of this Jekyll site source wouldn't actually get to see much of the content that they'd view in the output. It simultaneously shows the power of Jekyll ("you can inject all sorts of content at build time!") and the drawback of that power ("a lot of the key content on the site isn't in the source files"). I wonder if it would make sense for either (1) us to generate the content into the site source which we push up to the repo or (2) the plugin to inject a variable into the Liquid template so our page can at least have a reference like
{{ auto_generated_usage_guide }}
. Some food for thought. Right now it's very magical but I'm debating if maybe it separates the source and final output too much?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For hosted metadata, we could generate another data file for CLI information using a Rake task just like we have one for the list of importer-dependencies.
But that is less exciting (for me, atleast) than having content generated automatically at runtime, especially because contributors / maintainers have to ensure the data file is updated as needed.
For example, say we add a new option to an importer or we make edits to the option-description, then
Regarding the Liquid object
autogenerated...
, that too is possible, but I am not yet clear on the suggested use-case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points. Let's leave it how you have it now.