diff --git a/README.markdown b/README.markdown index 5db39417..14d7f389 100644 --- a/README.markdown +++ b/README.markdown @@ -12,7 +12,7 @@ The new __Jekyll__ command for importing from various blogs to Jekyll format. ### Jekyll v2.x and higher 1. Install the _rubygem_ with `gem install jekyll-import`. -2. Run `jekyll import IMPORTER [options]` +2. Run `jekyll-import IMPORTER [options]` ### Jekyll v1.x diff --git a/docs/_docs/contributing.md b/docs/_docs/contributing.md index 822083c3..af138326 100644 --- a/docs/_docs/contributing.md +++ b/docs/_docs/contributing.md @@ -15,7 +15,7 @@ Found an issue with one of the importers? Sorry about that! In order to better a 1. Collection information about your system: operating system and version, Ruby version, Jekyll version, jekyll-import version. 2. Which importer are you using? Note this. 3. Collect the relevant data. This may be data from your database or input file. This will help us diagnose where the issue occurred. -4. Ensure the `--trace` option is specified if you're running `jekyll import` from the command-line. +4. Ensure the `--trace` option is specified if you're running `jekyll-import` from the command-line. 4. [Open a new issue]({{ site.repository }}/issues/new) describing the four above points, as well as what you expected the outcome of your incantation to be. You should receive help soon. As always, check out [our help repo](https://talk.jekyllrb.com/) if you just have a question. @@ -90,5 +90,5 @@ Once you have your importer working (test with `script/console`), then you're re `./docs/_importers/columbus.md`. Take a look at one of the other importers as an example. You just add basic usage and you're golden. All set? Add everything to a branch on your fork of `jekyll-import` and -[submit a pull request](https://github.com/jekyll/jekyll-import/compare/). +[submit a pull request](https://github.com/jekyll/jekyll-import/compare/). Thank you! diff --git a/docs/_layouts/importer.html b/docs/_layouts/importer.html index 92f9a1b8..e0b34781 100644 --- a/docs/_layouts/importer.html +++ b/docs/_layouts/importer.html @@ -20,7 +20,7 @@

Invocation

Sample snippet to invoke the importer: -

jekyll import {{ page.cmd_name }}{% if page.cmd_opts %} {{ page.cmd_opts | map: 'switch' | join: ' ' }}{% endif %}
+
jekyll-import {{ page.cmd_name }}{% if page.cmd_opts %} {{ page.cmd_opts | map: 'switch' | join: ' ' }}{% endif %}

diff --git a/exe/jekyll-import b/exe/jekyll-import new file mode 100755 index 00000000..cea8394f --- /dev/null +++ b/exe/jekyll-import @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +STDOUT.sync = true + +$LOAD_PATH.unshift File.expand_path("../lib", __dir__) + +require 'jekyll-import' +require 'jekyll/commands/import' +require 'mercenary' + +Mercenary.program(:jekyll_import) do |p| + p.version JekyllImport::VERSION + p.description "Import from various blogs to Jekyll format." + p.syntax "jekyll-import [options]" + + # Create all the subcommands for the importers. + JekyllImport.add_importer_commands(p) + + p.action do |args, _| + if args.empty? + Jekyll.logger.error "A subcommand is required." + puts p + abort + else + subcommand = args.first + unless p.has_command? subcommand + Jekyll.logger.abort_with "fatal: 'jekyll-import #{args.first}'" \ + " could not be found." + end + end + end +end