Giter VIP home page Giter VIP logo

asciibook's Introduction

Asciibook

Asciibook is an Ebook generator for converting AsciiDoc to HTML, PDF and EPUB.

Installation

Asciibook uses docker as distribution tool. Docker helps deal with dependencies, keeps the local environment clean, and works well with CI / CD tools.

You can download and install docker in https://www.docker.com/products/docker-desktop .

After installed docker, Pull the docker image:

$ docker pull asciibook/asciibook

Usage

First, enter container enviroment in your AsciiDoc file diretory:

$ docker run -it -v $(pwd):/asciibook asciibook/asciibook bash
/asciibook #

Following command is executed inside the container environment.

For a existing AsciiDoc file, run this command to build all formats:

/asciibook # ascibook build mybook.adoc

Generated results will be placed in the build folder.

Or generate partial formats:

/asciibook # asciibook build mybook.adoc --format html,pdf,epub

If you don’t want to type the parameters repeatedly, you can create a configuration file for the document:

/asciibook # asciibook init mybook.adoc

It will create a config file named asciibook.yml in the same directory, edit config for your need, then use this command to build next time:

/asciibook # asciibook build

Development

Clone this repo:

$ git clone https://github.com/asciibook/asciibook.git
$ cd asciibook

Star dev environment with docker:

$ docker-compose run console

Run test:

/asciibook # rake test

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/asciibook/asciibook.

License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

asciibook's People

Contributors

chloerei avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

asciibook's Issues

Admonitions icon empty in PDF

wkhtmltopdf do not wait font download to finish, something it will not correct render icon correctly.

Possible solution:

  • add render latency by --javascript-delay
  • inline base64 encode font by data url

This problem does not always happen, wait and see if there is a better solution.

Section title with CJK characters in AsciiDoc file will cause the incorrect EPUB file generation

If the source AsciiDoc file has at least 1 section header with CJK characters, some common EPUB tools (Calibre E-book viewer/editor, Sigil, etc.) will not correctly recognize corresponding filenames in the generated EPUB file.

Example file:
debug.epub.zip (Remove the .zip suffix before use)
debug.adoc.txt (Remove the .txt suffix before use)

Screenshots:
(Opened with Ark Archiving Tool)
图片

(Opened with Caliber E-book viewer, notice the two "broken" file names on the left)
图片

(Opened with Sigil, notice the warning dialog at startup)
图片

Full-text search implementation discussion

The default html document generated by asciidoc is a single page, so we can easily use the browser's search function. But asciibook generated html contains multiple pages, there is a good solution to achieve full-text search?

I thought of using https://www.algolia.com/products/search-and-discovery/hosted-search-api/ ( E.g: https://docs.taro.zone/en/docs/README ) , but this engine requires that the document must be online, it is not suitable for offline documents.

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.