Giter Site home page Giter Site logo

mikemcquaid / manningasciidoc Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 4.0 48 KB

:books: Rake buildsystem for generating Manning DocBook and PDF files from AsciiDoc.

Home Page: https://github.com/mikemcquaid/ManningAsciiDoc

License: MIT License

Ruby 100.00%
asciidoc pdf-files ruby html

manningasciidoc's Introduction

ManningAsciiDoc

ManningAsciiDoc is a Rake buildsystem for generating Manning DocBook and PDF files from AsciiDoc.

Features

  • Outputs HTML5, Manning DocBook and PDF files from AsciiDoc source files.
  • Generates whole book and individual chapter files.
  • Validates all Manning DocBook files.
  • Separates source content from outputted files.
  • Uses an AsciiDoctor post-process filter plugin (rather than faffing with XSLT or regexes).
  • Easily customisable.

Status

ManningAsciiDoc currently generates valid Manning DocBook for my book Git in Practice which makes use of prefaces, parts, notes, callouts and various other features. It has been tested with varying AsciiDoc input but may need fixes for your book (patches are welcome).

Build Status

Usage

Ensure you have ruby, git and libxml installed on your system and setup ManningAsciiDoc by running:

git clone git://github.com/mikemcquaid/ManningAsciiDoc.git
cd ManningAsciiDoc
gem list --installed --local bundler || gem install bundler
bundle install

If you wish to generate PDF files please contact Manning and obtain a copy of AAMakePDF and download and extract it into the AAMakePDF directory (so there should be a file named ./AAMakePDF/createPDF.sh).

ManningAsciiDoc assumes that your book's source files a particular format. I've provided a sample repository for this at https://github.com/mikemcquaid/SampleManningAsciiDocBook.

You can see (and customize) the various assumptions that are made in the Rakefile. HTML5, whole book XML and PDF output rely on the preface/parts/chapters being sorted by filename.

You can now generate the HTML5, Manning DocBook or PDF output with:

rake html5
rake docbook
rake pdf

This will output book.html, book.xml or book.pdf in the ./output/ subdirectory (and copy all images under it).

I recommend you make ./input/ a separate (private) Git repository and ./output/ a checkout of the Subversion directory you will use for submission to Manning.

Contact

Mike McQuaid

License

ManningAsciiDoc is licensed under the MIT License. The full license text is available in [LICENSE.txt](https://github.com/mikemcquaid/ManningAsciiDoc/blob/master/LICENSE .txt).

manningasciidoc's People

Contributors

dependabot-support avatar dependabot[bot] avatar mikemcquaid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

manningasciidoc's Issues

xref to figures

I noticed a weird issue with making xrefs to figures. Here's what I have in my asciidoc:

short. <<counter-image>> shows what the result looks like and

// later in the file

.Counter webapp
[[counter-image]]
image:images/counter.png[]

here's what's created in the xml output:

short. Formalpara <xref linkend="counter-image"/> shows what the result looks like and

<!-- later in the file -->

<formalpara id="counter-image">
  <title>Counter webapp</title>
  <para>
    <inlinemediaobject>
      <imageobject>
        <imagedata fileref="images/counter.png"/>
      </imageobject>
      <caption>
        <para>counter</para>
      </caption>
    </inlinemediaobject>
  </para>
</formalpara>

When making a reference to code listings, the "Listing 1.1" seems to be correctly added. It just seems like it is doing this with images/figures.

Thanks!

Wrong number of arguments

Hi, I'm trying to generate html5 and docbook from your examples (latest master, nothing changed).

I'm getting the following error (similar for html5):

$ rake docbook --trace
** Invoke docbook (first_time)
** Invoke /media/ivan/projects/functional-cpp/book/output/book.xml (first_time)
** Invoke /media/ivan/projects/functional-cpp/book/input/Title.adoc (first_time, not_needed)
** Invoke /media/ivan/projects/functional-cpp/book/output/00-SamplePreface.xml (first_time)
** Invoke input/00-SamplePreface.adoc (first_time, not_needed)
** Invoke /media/ivan/projects/functional-cpp/book/output/manning-book.xsd (first_time, not_needed)
** Invoke output (first_time, not_needed)
** Execute /media/ivan/projects/functional-cpp/book/output/00-SamplePreface.xml
asciidoctor: generating /media/ivan/projects/functional-cpp/book/output/00-SamplePreface.xml
rake aborted!
ArgumentError: wrong number of arguments (2 for 1)
/media/ivan/projects/functional-cpp/book/asciidoctor_extensions/manning_postprocessor.rb:12:in `process'
/usr/lib/ruby/vendor_ruby/asciidoctor/document.rb:1034:in `[]'
/usr/lib/ruby/vendor_ruby/asciidoctor/document.rb:1034:in `block in convert'
/usr/lib/ruby/vendor_ruby/asciidoctor/document.rb:1033:in `each'
/usr/lib/ruby/vendor_ruby/asciidoctor/document.rb:1033:in `convert'
/usr/lib/ruby/vendor_ruby/asciidoctor.rb:1499:in `convert'
/media/ivan/projects/functional-cpp/book/Rakefile:98:in `asciidoctor'
/media/ivan/projects/functional-cpp/book/Rakefile:132:in `block in <top (required)>'
/usr/lib/ruby/2.2.0/rake/task.rb:238:in `call'
/usr/lib/ruby/2.2.0/rake/task.rb:238:in `block in execute'
/usr/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/usr/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/usr/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/usr/lib/ruby/2.2.0/rake/task.rb:201:in `block in invoke_prerequisites'
/usr/lib/ruby/2.2.0/rake/task.rb:199:in `each'
/usr/lib/ruby/2.2.0/rake/task.rb:199:in `invoke_prerequisites'
/usr/lib/ruby/2.2.0/rake/task.rb:178:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/usr/lib/ruby/2.2.0/rake/task.rb:201:in `block in invoke_prerequisites'
/usr/lib/ruby/2.2.0/rake/task.rb:199:in `each'
/usr/lib/ruby/2.2.0/rake/task.rb:199:in `invoke_prerequisites'
/usr/lib/ruby/2.2.0/rake/task.rb:178:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/usr/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/usr/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/usr/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/usr/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/usr/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/usr/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/usr/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/usr/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/usr/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/usr/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Tasks: TOP => docbook => /media/ivan/projects/functional-cpp/book/output/book.xml => /media/ivan/projects/functional-cpp/book/output/00-SamplePreface.xml

Numbering of appendixes

I was wondering whether there's a means to get appendixes numbered as A, B, C instead of continuing the numbering of chapters (1, 2, 3, 4, etc.). The SampleManningAsciiDoc repository also seems to exhibit this behaviour. Or is this something that needs to be done by hand somehow?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.