Usage
Components
Booklet itself consists of 3 parts:
- booklet-library - Core part that provides storage, options, Scalate publishing logic;
- booklet-knockoff - Knockoff integration part that enhance standard Knockoff parsers;
- booklet-app - application, that compatible with SBT launcher.
Use as the standalone application
You may start it in *NIX environment with command line like this:
java \
-Dsbt.boot.properties=/home/user/booklet/booklet-app.configuration \
-jar /home/user/booklet/sbt-launch.jar -- @mybooklet.properties
where
- sbt.boot.properties - location of the application configuration
- sbt-launch.jar - the latest ;-) launcher from SBT
- mybooklet.properties - argument with user options, for example. Use '-h' for help
Application configuration
The typical application configuration is provided bellow. You may copy'n'paste it or download sample one and modify. Change 1.2.3.4-SNAPSHOT version to the latest available.
[scala]
version: 2.10.3
[app]
org: org.digimead
name: booklet-app
version: 1.2.3.4-SNAPSHOT
class: org.digimead.booklet.Application
cross-versioned: binary
[repositories]
local
maven-central
digimead-maven: http://storage.googleapis.com/maven.repository.digimead.org/
[boot]
directory: \${user.home}/.sbt/booklet-boot
SBT launcher
You may use any available SBT launcher. I recommend the latest one.
User options
File with user options may be specified in @file format. For example I used bellow options file while designing Booklet:
resources: /my/path/to/template-dev
user: digimead-specific
project: Booklet
artifacts: booklet-app, booklet-knockoff, booklet-library
logo: http://commondatastorage.googleapis.com/digimead/booklet.png
disqus: Booklet
Of course, for publishing I provided different options. I specified path to production template with compressed resources and adjusted other parameters.
Running
docs directory with markdown files must be exists. After start you will see something like:
[main] INFO org.digimead.booklet.template.Preview\$ - Warm up Scalate engine.
[main] INFO org.eclipse.jetty.server.Server - jetty-7.6.9.v20130131
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - started o.e.j.s.ServletContextHandler{/,null}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started SocketConnector@127.0.0.1:50059
Previewing `docs`. Press CTRL+C to stop.
The Booklet is ready to process HTTP requests on 127.0.0.1:50059.
Use as a library
Add Booklet to you application and invoke
Produce(BookletStorage(input, bookletProperties).globalized, output)
where
- input - directory with markdown files
- output - directory with transformation result
- bookletProperties - user options