1 | # DiCy
|
2 |
|
3 | [![Build Status][travis svg]][travis]
|
4 | [![Windows Build Status][appveyor svg]][appveyor]
|
5 | [![Dependency Status][dependency svg]][dependency]
|
6 | [![devDependency Status][devDependency svg]][devDependency]
|
7 | [![Greenkeeper Status][greenkeeper svg]][greenkeeper]
|
8 |
|
9 | A JavaScript based builder for LaTeX, knitr, literate Agda and literate Haskell
|
10 | that automatically builds dependencies. Can automatically process projects that
|
11 | utilize Agda, Asymptote, Biber, BibTeX, dvitopdf, knitr, lhs2TeX, MetaPost,
|
12 | makeindex, makeglossaries, or SageTeX. Also, parses and filters output logs and
|
13 | error messages generated during build.
|
14 |
|
15 | ## Installation
|
16 |
|
17 | DiCy can be used either as a library or via the command line. To install DiCy as
|
18 | a library use `npm install @dicy/core`. To install for command line access use
|
19 | `npm install -g @dicy/cli`.
|
20 |
|
21 | ## Documentation
|
22 |
|
23 | Basic usage of the Command Line interface and library can be found below. For
|
24 | more detailed documentation please see the following pages.
|
25 |
|
26 | - [Configuration][configuration]
|
27 | - [Options][options]
|
28 | - [Commands][commands]
|
29 | - [Rules][rules]
|
30 | - [Events][events]
|
31 |
|
32 | ## Command Line Usage
|
33 |
|
34 | The command line interface is generally called via
|
35 |
|
36 | ```bash
|
37 | dicy [command] [options] [inputs...]
|
38 | ```
|
39 |
|
40 | where the following commands are available (`--help` will enumerate options):
|
41 |
|
42 | | Command | Alias | Description |
|
43 | |:----------------|:-----:|---------------------------------------------------------------------|
|
44 | | build | b | Build the inputs. |
|
45 | | clean | c | Clean up after a previous build. |
|
46 | | scrub | s | Clean up after a previous build and remove all generated files. |
|
47 | | log | l | Report messages from any logs. |
|
48 | | graph | g | Create a dependency graph from a previous build. |
|
49 | | build,clean | bc | Build the inputs and then clean up. |
|
50 | | build,log | bl | Build the inputs and report messages from any logs. |
|
51 | | build,log,clean | blc | Build the inputs, report messages from any logs, and then clean up. |
|
52 | | rules | | List available rules. |
|
53 |
|
54 | The [options][] that can be specified are generally the same options accessible
|
55 | via the library interface.
|
56 |
|
57 | ## Library Usage
|
58 |
|
59 | The primary class for usage is the `DiCy` class. The library requires a
|
60 | polyfill for `Set`/`Map` usage such as `babel-polyfill`. For instance, to build
|
61 | `foo.tex` and report any log messages:
|
62 |
|
63 | ```javascript
|
64 | import 'babel-polyfill'
|
65 | import { DiCy } from '@dicy/core'
|
66 |
|
67 | const builder = await DiCy.create('foo.tex', { synctex: true })
|
68 |
|
69 | builder.on('log', event => {
|
70 | const nameText = event.name ? `[${event.name}] ` : ''
|
71 | const typeText = event.category ? `${event.category}: ` : ''
|
72 | const text = `${event.severity} ${nameText}${typeText}${event.text.replace('\n', ' ')}`
|
73 | console.log(text)
|
74 | })
|
75 |
|
76 | await builder.run('load', 'build', 'log', 'save')
|
77 | ```
|
78 |
|
79 | Any sequence of commands listed below may be used, but the first and last commands should
|
80 | always be `load` and `save`, respectively.
|
81 |
|
82 | | Command | Description |
|
83 | |---------|-----------------------------------------------------------------|
|
84 | | build | Build the input file |
|
85 | | clean | Clean up after a build |
|
86 | | scrub | Clean up after a previous build and remove all generated files. |
|
87 | | graph | Graph dependencies using GraphViz |
|
88 | | log | Report log messages generated |
|
89 |
|
90 | [appveyor svg]: https://ci.appveyor.com/api/projects/status/s3unjr8c90bhcd99?svg=true
|
91 | [appveyor]: https://ci.appveyor.com/project/yitzchak/dicy/branch/master
|
92 | [commands]: https://yitzchak.github.io/dicy/commands
|
93 | [configuration]: https://yitzchak.github.io/dicy/configuration
|
94 | [dependency svg]: https://david-dm.org/yitzchak/dicy.svg
|
95 | [dependency]: https://david-dm.org/yitzchak/dicy
|
96 | [devDependency svg]: https://david-dm.org/yitzchak/dicy/dev-status.svg
|
97 | [devDependency]: https://david-dm.org/yitzchak/dicy?type=dev
|
98 | [events]: https://yitzchak.github.io/dicy/events
|
99 | [greenkeeper svg]: https://badges.greenkeeper.io/yitzchak/dicy.svg
|
100 | [greenkeeper]: https://greenkeeper.io/
|
101 | [options]: https://yitzchak.github.io/dicy/options
|
102 | [rules]: https://yitzchak.github.io/dicy/rules
|
103 | [travis svg]: https://travis-ci.org/yitzchak/dicy.svg?branch=master
|
104 | [travis]: https://travis-ci.org/yitzchak/dicy
|