From e811f1cc3e618a46edca3bf8b7551d6a9b8069b7 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Wed, 17 Jul 2013 15:57:58 -0600 Subject: [PATCH 1/2] add support for asciidoctor command in place of asciidoc --- Gemfile | 2 +- Gemfile.lock | 24 ++++++++++++++------- README.asciidoc | 9 ++++---- docbook-xsl/fo.xsl | 2 ++ docbook-xsl/fo/highlight.xsl | 18 +++++++--------- example/book/book.asc | 6 +++--- git-scribe.gemspec | 3 +++ lib/git-scribe.rb | 15 +++++++++++++ lib/git-scribe/check.rb | 41 +++++++++++++++++++++++++----------- lib/git-scribe/generate.rb | 12 +++++++---- template/book/book.asc | 6 +++--- template/book/chapter2.asc | 4 ++-- 12 files changed, 95 insertions(+), 47 deletions(-) diff --git a/Gemfile b/Gemfile index e45e65f..851fabc 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,2 @@ -source :rubygems +source 'https://rubygems.org' gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 52df18e..61deeae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,24 +7,32 @@ PATH nokogiri GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: - diff-lcs (1.1.3) + asciidoctor (1.5.2) + coderay (1.1.0) + diff-lcs (1.2.5) grit (2.5.0) diff-lcs (~> 1.1) mime-types (~> 1.15) posix-spawn (~> 0.3.6) - liquid (2.3.0) - mime-types (1.19) - nokogiri (1.5.5) - posix-spawn (0.3.6) - rake (0.9.2) - test-unit (2.3.2) + liquid (3.0.2) + mime-types (1.25.1) + mini_portile (0.6.2) + nokogiri (1.6.6.2) + mini_portile (~> 0.6.0) + posix-spawn (0.3.11) + power_assert (0.2.3) + rake (10.4.2) + test-unit (3.0.9) + power_assert PLATFORMS ruby DEPENDENCIES + asciidoctor + coderay git-scribe! rake test-unit diff --git a/README.asciidoc b/README.asciidoc index 2931d09..2d99308 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -3,8 +3,7 @@ Git Scribe image::https://travis-ci.org/schacon/git-scribe.png[Build Status,link="https://travis-ci.org/schacon/git-scribe"] -The git-scribe tool is a simple command line toolset to help you use Git, GitHub and Asciidoc -to write e-books. This provides tools for setting up the structure, collaborating with co-authors, doing technical and copy-editing, handling translations, taking errata, as well as publishing online, pdf, mobi (Kindle) and epub (iBooks, Nook) versions. +The git-scribe tool is a simple command line toolset to help you use Git, GitHub and AsciiDoc to write e-books. This provides tools for setting up the structure, collaborating with co-authors, doing technical and copy-editing, handling translations, taking errata, as well as publishing online, pdf, mobi (Kindle) and epub (iBooks, Nook) versions. The project is targeted for writing books of any length, but should also be usable for articles and stuff too, though for a while you'll have to just do it as a really short book. @@ -20,9 +19,9 @@ Eventually, these are the feature goals for the project: * Translation workflow tools * Selling (possibly): Kindle, iBooks, Lulu, Pledgie(?) -The idea is that you use the tool to generate a known structure, write in asciidoc and let the tool handle everything else for you. I want authors to be able to focus on writing and not have to worry about anything else (website, multiple format generation, etc). +The idea is that you use the tool to generate a known structure, write in AsciiDoc and let the tool handle everything else for you. I want authors to be able to focus on writing and not have to worry about anything else (website, multiple format generation, etc). -A good AsciiDoc cheat sheet: http://powerman.name/doc/asciidoc#_text +A good AsciiDoc cheat sheet: http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/ Disclaimer ========== @@ -41,8 +40,10 @@ For local generation (eventually pushing to GitHub will handle gen for you), it * Git * Ruby * asciidoc, a2x (8.6.4) +** asciidoctor can be used in place of asciidoc * xsltproc * source-highlight (3.1) +** coderay is required when using asciidoctor * FOP (1.0) - for PDF generation Usage diff --git a/docbook-xsl/fo.xsl b/docbook-xsl/fo.xsl index 99fa754..02f2875 100644 --- a/docbook-xsl/fo.xsl +++ b/docbook-xsl/fo.xsl @@ -155,4 +155,6 @@ auto + + diff --git a/docbook-xsl/fo/highlight.xsl b/docbook-xsl/fo/highlight.xsl index 1be5d9c..6d53f39 100644 --- a/docbook-xsl/fo/highlight.xsl +++ b/docbook-xsl/fo/highlight.xsl @@ -15,10 +15,18 @@ ******************************************************************** --> + + + + + + + + @@ -31,14 +39,6 @@ - - - - - - - -