From 89e4858c2bfe6a528261ba0968e40ffe2360f976 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sat, 7 Mar 2020 13:32:43 +0100 Subject: Readme: Exclude irrelevant parts from readme for npm --- README.adoc | 4 ++++ Rakefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 70a4ac9..c34066e 100644 --- a/README.adoc +++ b/README.adoc @@ -62,6 +62,7 @@ where “The First Section” is *title* of the section with id _sec1_ in _other == Installation +ifndef::npm-readme[] === Ruby Install {gem-name} from Rubygems: @@ -76,6 +77,7 @@ gem install {gem-name} --pre === Node.js +endif::npm-readme[] Install {gem-name} from npmjs.com: @@ -85,6 +87,7 @@ npm install --save {gem-name} == Usage +ifndef::npm-readme[] === CLI If you invoke Asciidoctor from command-line, use option `-r` to load the extension: @@ -104,6 +107,7 @@ IMPORTANT: Bundler automatically _requires_ all the specified gems. === Node.js +endif::npm-readme[] [source, js, subs="+attributes"] ---- diff --git a/Rakefile b/Rakefile index 5866d51..84dcba2 100644 --- a/Rakefile +++ b/Rakefile @@ -28,7 +28,7 @@ task :readme2md do require 'pandoc-ruby' docbook = Asciidoctor - .load_file('README.adoc', header_footer: true, backend: 'docbook') + .load_file('README.adoc', header_footer: true, backend: 'docbook', attributes: 'npm-readme') .convert markdown = PandocRuby .convert(docbook, from: :docbook, to: :markdown_github, 'base-header-level': 2) -- cgit v1.2.3