mnogootex 0.2.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/actions/setup-ruby/action.yml +34 -0
- data/.github/workflows/main.yml +44 -0
- data/.gitignore +3 -0
- data/.rspec +0 -2
- data/.rubocop.yml +15 -0
- data/CHANGELOG.md +55 -0
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +4 -3
- data/Guardfile +56 -0
- data/README.md +260 -20
- data/Rakefile +25 -4
- data/demo/.mnogootexrc +4 -0
- data/demo/demo.asciicast +114 -0
- data/demo/demo.gif +0 -0
- data/demo/main.tex +5 -0
- data/exe/mnogootex +2 -92
- data/lib/mnogootex/cfg.rb +72 -0
- data/lib/mnogootex/cli.rb +63 -0
- data/lib/mnogootex/job/logger.rb +53 -0
- data/lib/mnogootex/job/porter.rb +63 -0
- data/lib/mnogootex/job/runner.rb +60 -0
- data/lib/mnogootex/job/warden.rb +104 -0
- data/lib/mnogootex/log/level.rb +17 -0
- data/lib/mnogootex/log/levels.yml +29 -0
- data/lib/mnogootex/log/line.rb +14 -0
- data/lib/mnogootex/log/matcher.rb +17 -0
- data/lib/mnogootex/log/matchers.yml +205 -0
- data/lib/mnogootex/log/processor.rb +115 -0
- data/lib/mnogootex/log.rb +23 -0
- data/lib/mnogootex/utils.rb +27 -0
- data/lib/mnogootex/version.rb +3 -1
- data/lib/mnogootex.rb +4 -4
- data/mnogootex.gemspec +43 -18
- data/spec/mnogootex/cfg_spec.rb +54 -0
- data/spec/mnogootex/job/porter_spec.rb +140 -0
- data/spec/mnogootex/job/runner_spec.rb +74 -0
- data/spec/mnogootex/log/processor_spec.rb +203 -0
- data/spec/mnogootex/utils_spec.rb +52 -0
- data/spec/spec_helper.rb +124 -0
- metadata +150 -29
- data/.gitmodules +0 -3
- data/.travis.yml +0 -5
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/mnogootex/configuration.rb +0 -46
- data/lib/mnogootex/job.rb +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: edf454b8fab7fe98488bade01dd2c59b3419d5afb9bc4a6c7cadca1cd36bf296
|
4
|
+
data.tar.gz: 1036a5f4e565b1deef11daa6c5418eeb4f357e942fc55009d92f7fc6cfd9dcbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c47604bd0302b39ab98ac7417fd0b1b720360c6e54650cc99383237ef2c42cbc65b2edebad71b44d7a662a21aa3740b6f71a66712b87af09d253d86de142989
|
7
|
+
data.tar.gz: 7e00d8a660f75ac7e04e0ba8befea9553f33d8f94b692f31bd634f333043a29abf0eb6eef619389dbf1cc31496ea299ed101b0f4311080ce0e47904983aa939a
|
@@ -0,0 +1,34 @@
|
|
1
|
+
name: Setup Ruby
|
2
|
+
description: Setup Ruby
|
3
|
+
inputs:
|
4
|
+
ruby-version:
|
5
|
+
required: false
|
6
|
+
default: '2.7'
|
7
|
+
cache-path:
|
8
|
+
required: false
|
9
|
+
default: vendor/bundle
|
10
|
+
cache-key:
|
11
|
+
required: false
|
12
|
+
default: gems-
|
13
|
+
cache-restore-keys:
|
14
|
+
required: false
|
15
|
+
default: gems-
|
16
|
+
outputs: {}
|
17
|
+
runs:
|
18
|
+
using: "composite"
|
19
|
+
steps:
|
20
|
+
- name: Setup Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ inputs.ruby-version }}
|
24
|
+
- name: Cache Ruby gems
|
25
|
+
uses: actions/cache@v2
|
26
|
+
with:
|
27
|
+
path: ${{ inputs.cache-path }}
|
28
|
+
key: ${{ inputs.cache-key }}
|
29
|
+
restore-keys: ${{ inputs.cache-restore-keys }}
|
30
|
+
- name: Install Ruby gems
|
31
|
+
shell: bash
|
32
|
+
run: |
|
33
|
+
bundle config path ${{ inputs.cache-path }}
|
34
|
+
bundle install --jobs 4 --retry 3
|
@@ -0,0 +1,44 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
|
9
|
+
test:
|
10
|
+
runs-on: ${{ matrix.os }}
|
11
|
+
strategy:
|
12
|
+
fail-fast: false
|
13
|
+
matrix:
|
14
|
+
os: [ 'ubuntu-latest', 'macos-latest' ]
|
15
|
+
ruby: [ '2.6', '2.7', '3.0' ]
|
16
|
+
include:
|
17
|
+
- os: ubuntu-latest
|
18
|
+
ruby: '2.7'
|
19
|
+
coverage: true
|
20
|
+
|
21
|
+
steps:
|
22
|
+
|
23
|
+
- name: Checkout repo
|
24
|
+
uses: actions/checkout@v2
|
25
|
+
|
26
|
+
- name: Setup Ruby
|
27
|
+
uses: ./.github/actions/setup-ruby
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
30
|
+
cache-key: gems-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'mnogootex.gemspec') }}
|
31
|
+
cache-restore-keys: gems-${{ matrix.os }}-${{ matrix.ruby }}-
|
32
|
+
|
33
|
+
- name: Run tests
|
34
|
+
run: bundle exec rake spec:rspec
|
35
|
+
|
36
|
+
- name: Test and publish coverage to Code Climate
|
37
|
+
uses: paambaati/codeclimate-action@v3.0.0
|
38
|
+
if: ${{ matrix.coverage && github.ref == 'refs/heads/main' }}
|
39
|
+
env:
|
40
|
+
CC_TEST_REPORTER_ID: 890ed5ee01002c7149920883256f8e4790000127faa9ddf14d86dd3ceb3b8179
|
41
|
+
COVERAGE: true
|
42
|
+
with:
|
43
|
+
coverageCommand: bundle exec rspec
|
44
|
+
coverageLocations: ${{ github.workspace }}/coverage/coverage.json:simplecov
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
NewCops: enable
|
4
|
+
Metrics/LineLength:
|
5
|
+
Max: 120
|
6
|
+
Layout/DotPosition:
|
7
|
+
EnforcedStyle: trailing
|
8
|
+
Style/TrailingCommaInArguments:
|
9
|
+
EnforcedStyleForMultiline: consistent_comma
|
10
|
+
Metrics/BlockLength:
|
11
|
+
Exclude:
|
12
|
+
- spec/**/*_spec.rb
|
13
|
+
# TODO: re-enable
|
14
|
+
Style/Documentation:
|
15
|
+
Enabled: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [Unreleased]
|
9
|
+
|
10
|
+
## [2.0.0] - 2021-11-19
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- `exec` command to run `latexmk` directly.
|
15
|
+
- `clobber` command to delete both unessential files and artifacts.
|
16
|
+
|
17
|
+
### Changed
|
18
|
+
|
19
|
+
- `go` command renamed to `build`.
|
20
|
+
- `clean` command simply deletes unessential files (instead of everything).
|
21
|
+
- Configuration must be named `.mnogootexrc` (instead of `.mnogootex.yml`).
|
22
|
+
|
23
|
+
### Removed
|
24
|
+
|
25
|
+
- `mnogoo` shell integration no longer exists.
|
26
|
+
- `dir` and `pdf` commands no longer exist.
|
27
|
+
|
28
|
+
### Fixed
|
29
|
+
|
30
|
+
- Avoid deleting files before buils so viewers can reload.
|
31
|
+
- Caught nasty IO timing bug when polling `latexmk -pv` for logs.
|
32
|
+
|
33
|
+
## [1.1.0] - 2021-11-06
|
34
|
+
|
35
|
+
### Added
|
36
|
+
|
37
|
+
- New option `work_path` in configuration file to simplify access to build folders.
|
38
|
+
|
39
|
+
## [1.0.1] - 2018-09-03
|
40
|
+
|
41
|
+
### Fixed
|
42
|
+
|
43
|
+
- `mnogootex mnogoo` now produces correct path.
|
44
|
+
|
45
|
+
## [1.0.0] - 2018-04-24
|
46
|
+
|
47
|
+
### Added
|
48
|
+
|
49
|
+
- First public release.
|
50
|
+
|
51
|
+
[unreleased]: https://github.com/paolobrasolin/mnogootex/compare/v2.0.0...HEAD
|
52
|
+
[2.0.0]: https://github.com/paolobrasolin/mnogootex/compare/v1.1.0...v2.0.0
|
53
|
+
[1.1.0]: https://github.com/paolobrasolin/mnogootex/compare/v1.0.1...v1.1.0
|
54
|
+
[1.0.1]: https://github.com/paolobrasolin/mnogootex/compare/v1.0.0...v1.0.1
|
55
|
+
[1.0.0]: https://github.com/paolobrasolin/mnogootex/releases/tag/v1.0.0
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
55
55
|
## Enforcement
|
56
56
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at
|
58
|
+
reported by contacting the project team at <paolo.brasolin@gmail.com>. All
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
60
60
|
is deemed necessary and appropriate to the circumstances. The project team is
|
61
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
data/Gemfile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
6
|
|
5
|
-
# Specify your gem's dependencies in mnogootex.gemspec
|
6
7
|
gemspec
|
data/Guardfile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
4
|
+
require 'guard/rspec/dsl'
|
5
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
6
|
+
|
7
|
+
# RSpec files
|
8
|
+
watch(dsl.rspec.spec_helper) { dsl.rspec.spec_dir }
|
9
|
+
watch(dsl.rspec.spec_files)
|
10
|
+
|
11
|
+
# Ruby files
|
12
|
+
dsl.watch_spec_files_for(dsl.ruby.lib_files)
|
13
|
+
end
|
14
|
+
|
15
|
+
# # TODO: refactor the following into a new version of guard-mutant
|
16
|
+
|
17
|
+
# require 'mutant'
|
18
|
+
# require 'dry/inflector'
|
19
|
+
# require 'guard/compat/plugin'
|
20
|
+
|
21
|
+
# # NOTE: :: is mandatory for inline guards
|
22
|
+
# module ::Guard
|
23
|
+
# class Mutant < Plugin
|
24
|
+
# def initialize(options = {})
|
25
|
+
# opts = options.dup
|
26
|
+
# # @my_option = opts.delete(:my_special_option)
|
27
|
+
# super(opts) # important to call + avoid passing options Guard doesn't understand
|
28
|
+
# end
|
29
|
+
|
30
|
+
# # TODO: how would this make sense?
|
31
|
+
# # def run_all; end
|
32
|
+
|
33
|
+
# def run_on_modifications(paths)
|
34
|
+
# inflector = Dry::Inflector.new
|
35
|
+
# subjects = paths.map do |path|
|
36
|
+
# match = path.match(%r{(?:spec|lib)\/(.*?)(?:_spec)?.rb}).captures.first
|
37
|
+
# inflector.camelize match
|
38
|
+
# end
|
39
|
+
# succesful = ::Mutant::CLI.run(%w[--use rspec --fail-fast] + subjects)
|
40
|
+
# throw :task_has_failed unless succesful
|
41
|
+
# self
|
42
|
+
# end
|
43
|
+
# end
|
44
|
+
# end
|
45
|
+
|
46
|
+
# guard :mutant do
|
47
|
+
# require 'guard/rspec/dsl'
|
48
|
+
# dsl = Guard::RSpec::Dsl.new(self)
|
49
|
+
|
50
|
+
# # RSpec files
|
51
|
+
# # watch(dsl.rspec.spec_helper) { dsl.rspec.spec_dir }
|
52
|
+
# watch(dsl.rspec.spec_files)
|
53
|
+
|
54
|
+
# # Ruby files
|
55
|
+
# dsl.watch_spec_files_for(dsl.ruby.lib_files)
|
56
|
+
# end
|
data/README.md
CHANGED
@@ -1,43 +1,283 @@
|
|
1
1
|
# Многоꙮтех
|
2
2
|
|
3
|
-
|
3
|
+
[![CI tests status badge][build-shield]][build-url]
|
4
|
+
[![Latest release badge][rubygems-shield]][rubygems-url]
|
5
|
+
[![License badge][license-shield]][license-url]
|
6
|
+
[![Maintainability badge][cc-maintainability-shield]][cc-maintainability-url]
|
7
|
+
[![Test coverage badge][cc-coverage-shield]][cc-coverage-url]
|
4
8
|
|
5
|
-
|
9
|
+
[build-shield]: https://img.shields.io/github/workflow/status/paolobrasolin/mnogootex/CI/main?label=tests&logo=github
|
10
|
+
[build-url]: https://github.com/paolobrasolin/mnogootex/actions/workflows/main.yml "CI tests status"
|
11
|
+
[rubygems-shield]: https://img.shields.io/gem/v/mnogootex?logo=ruby
|
12
|
+
[rubygems-url]: https://rubygems.org/gems/mnogootex "Latest release"
|
13
|
+
[license-shield]: https://img.shields.io/github/license/paolobrasolin/mnogootex
|
14
|
+
[license-url]: https://github.com/paolobrasolin/mnogootex/blob/main/LICENSE "License"
|
15
|
+
[cc-maintainability-shield]: https://img.shields.io/codeclimate/maintainability/paolobrasolin/mnogootex?logo=codeclimate
|
16
|
+
[cc-maintainability-url]: https://codeclimate.com/github/paolobrasolin/mnogootex "Maintainability"
|
17
|
+
[cc-coverage-shield]: https://img.shields.io/codeclimate/coverage/paolobrasolin/mnogootex?logo=codeclimate&label=test%20coverage
|
18
|
+
[cc-coverage-url]: https://codeclimate.com/github/paolobrasolin/mnogootex/coverage "Test coverage"
|
6
19
|
|
7
|
-
|
20
|
+
Многоꙮтех (mnogootex) is a utility that parallelizes compilation
|
21
|
+
of a LaTeX document using different classes and offers a
|
22
|
+
meaningfully filtered output.
|
8
23
|
|
9
|
-
|
24
|
+
The motivating use case is maintaining a single preamble while
|
25
|
+
submitting a paper to many journals using their outdated or crummy
|
26
|
+
document classes.
|
10
27
|
|
11
|
-
|
12
|
-
|
28
|
+
## Getting started
|
29
|
+
|
30
|
+
### Prerequisites
|
31
|
+
|
32
|
+
Многоꙮтех is written in [**Ruby**](https://www.ruby-lang.org) and requires version `>=2.5` (earlier ones are untested).
|
33
|
+
You can check whether it's installed by running `ruby --version`.
|
34
|
+
For installation instructions you can refer to the [official documentation](https://www.ruby-lang.org/en/documentation/installation/).
|
35
|
+
|
36
|
+
|
37
|
+
Многоꙮтех heavily relies on [**`latexmk`**](https://ctan.org/pkg/latexmk).
|
38
|
+
You can check whether it's installed by running `latexmk --version`.
|
39
|
+
If you are missing it, follow the documentation of your specific LaTeX distribution and install the `latexmk` package.
|
40
|
+
|
41
|
+
### Installation
|
42
|
+
|
43
|
+
To install многоꙮтех execute
|
44
|
+
|
45
|
+
```bash
|
46
|
+
gem install mnogootex
|
13
47
|
```
|
14
48
|
|
15
|
-
|
49
|
+
If you're upgrading from a previous version, execute
|
50
|
+
|
51
|
+
```bash
|
52
|
+
gem update mnogootex
|
53
|
+
```
|
16
54
|
|
17
|
-
|
55
|
+
and remove any mention of `mnogootex` from your shell profile (it's not needed anymore).
|
18
56
|
|
19
|
-
|
57
|
+
### Quick start
|
20
58
|
|
21
|
-
|
59
|
+
First you write a LaTeX document:
|
60
|
+
|
61
|
+
```latex
|
62
|
+
% ~/demo/main.tex
|
63
|
+
\documentclass{scrarticle}
|
64
|
+
\begin{document}
|
65
|
+
\abstract{Simply put, my article is awesome.}
|
66
|
+
Let's port my \KOMAScript\ article to other classes!
|
67
|
+
\end{document}
|
68
|
+
```
|
69
|
+
|
70
|
+
Then you list the desided classes in a Многоꙮтех configuration file:
|
71
|
+
|
72
|
+
```yaml
|
73
|
+
# ~/demo/.mnogootexrc
|
74
|
+
jobs:
|
75
|
+
- scrartcl
|
76
|
+
- article
|
77
|
+
- book
|
78
|
+
```
|
79
|
+
|
80
|
+
Finally you run `mnogootex build` and enjoy the technicolor:
|
81
|
+
|
82
|
+

|
22
83
|
|
23
84
|
## Usage
|
24
85
|
|
25
|
-
|
86
|
+
A Многоꙮтех run does the following:
|
87
|
+
1. copy the _source_ folder of a project to many _target_ folders, one for each _job_;
|
88
|
+
2. replace the document class in the source of each _target_ folder with the name of the relative _job_;
|
89
|
+
3. call `latexmk` in parallel on each _target_ folder to compile the documents (or do other tasks);
|
90
|
+
4. wait for the outcomes and print the logs, filtered and colour-coded in a meaningful way.
|
91
|
+
|
92
|
+
Its convenience lies in the fact that it
|
93
|
+
* automates the setup process,
|
94
|
+
* parallelizes compilation,
|
95
|
+
* improves the readability of the infamous waterfall logs.
|
96
|
+
|
97
|
+
Многоꙮтех can be invoked from CLI using `mnogootex`.
|
98
|
+
It accepts various [commands](#mnogootex-commands) detailed below.
|
99
|
+
|
100
|
+
To leverage the full power of this tool you will need to learn writing [`mnogootex` configurations](#mnogootex-configuration) and ['latexmk' configurations](#latexmk-configuration).
|
101
|
+
It might sound daunting but they're really just a few lines.
|
102
|
+
|
103
|
+
### `mnogootex` commands
|
104
|
+
|
105
|
+
> **Notation:** `[FOO]` means that _`FOO` is optional_ while `FOO ...` means _one or more `FOO`s_.
|
106
|
+
|
107
|
+
All commands except `help` accept the same parameters, so let's examine them in advance to avoid repeating ourselves later.
|
108
|
+
Here is their syntax:
|
109
|
+
|
110
|
+
```bash
|
111
|
+
mnogootex COMMAND [JOB ...] [FLAG ...] ROOT
|
112
|
+
```
|
113
|
+
|
114
|
+
`JOB`s are the names of the document classes to compile your document with.
|
115
|
+
Zero or more can be provided, and when none is given the job list is loaded from the [configuration](#jobs).
|
116
|
+
|
117
|
+
`FLAG`s are `latexmk` options.
|
118
|
+
Zero or more can be provided to override the behaviour of the `latexmk` call underlying the `mnogootex` command.
|
119
|
+
You can obtain a list of available options with the inline help `latexmk --help`, and the full documentation with `man latexmk`.
|
120
|
+
Generally speaking, if you find yourself always using a `FLAG` you should properly [configure `latexmk`](#latexmk-configuration) instead.
|
121
|
+
|
122
|
+
The last mandatory parameter is the `ROOT` file for compiling of your document.
|
123
|
+
|
124
|
+
Let's examine the details of each command now.
|
125
|
+
|
126
|
+
#### `help [COMMAND]`
|
127
|
+
|
128
|
+
This command prints the help for `COMMAND` (or all commands if none is given).
|
129
|
+
|
130
|
+
#### `exec [JOB ...] [FLAG ...] ROOT`
|
131
|
+
|
132
|
+
This command simply runs `latexmk` on the `ROOT` document for each of your `JOB`s passing the given `FLAG`s.
|
133
|
+
|
134
|
+
All other commands below are specializations of this one.
|
135
|
+
However you'll seldom use it unless you're debugging.
|
136
|
+
|
137
|
+
#### `build [JOB ...] [FLAG ...] ROOT`
|
138
|
+
|
139
|
+
This command builds your document.
|
140
|
+
|
141
|
+
It is equivalent to `exec [JOB ...] -interaction=nonstopmode ROOT`.
|
142
|
+
|
143
|
+
You will probably need to pass some `FLAG`s (e.g. to use the correct engine) but it is not recommended: [configure `latexmk`](#latexmk-configuration) instead.
|
144
|
+
|
145
|
+
#### `open [JOB ...] [FLAG ...] ROOT`
|
146
|
+
|
147
|
+
This command opens the final compilation artifact (after running the build if necessary).
|
148
|
+
|
149
|
+
It is equivalent to `exec [JOB ...] -pv -interaction=nonstopmode ROOT`.
|
150
|
+
|
151
|
+
You might need to pass some `FLAG`s (e.g. to use the correct viewer) but it is not recommended: [configure `latexmk`](#latexmk-configuration) instead.
|
152
|
+
|
153
|
+
#### `clean [JOB ...] [FLAG ...] ROOT`
|
26
154
|
|
27
|
-
|
155
|
+
This command deletes all nonessential build files while keeping the compiled artifacts.
|
28
156
|
|
29
|
-
|
157
|
+
It is equivalent to `exec [JOB ...] -c ROOT`.
|
30
158
|
|
31
|
-
|
159
|
+
#### `clobber [JOB ...] [FLAG ...] ROOT`
|
32
160
|
|
33
|
-
|
161
|
+
This command deletes all nonessential build files including the compiled artifacts.
|
34
162
|
|
35
|
-
|
163
|
+
It is equivalent to `exec [JOB ...] -C ROOT`.
|
36
164
|
|
37
|
-
|
165
|
+
### `mnogootex` configuration
|
166
|
+
|
167
|
+
`mnogootex` is configured through [`YAML`](https://learnxinyminutes.com/docs/yaml/)
|
168
|
+
files named `.mnogootexrc` put into your projects' root directory.
|
169
|
+
|
170
|
+
When `mnogootex` loads a configuration it also looks up for `.mnogootexrc`
|
171
|
+
files in all parent directories to merge then together (from the
|
172
|
+
shallowest to the deepest path). This means that e.g. you can keep
|
173
|
+
a configuration file in your home folder and use it as a global
|
174
|
+
configuration for all you projects, while overwriting only specific
|
175
|
+
options in the configuration files of each one.
|
176
|
+
|
177
|
+
`mnogootex` currently accepts three options.
|
178
|
+
|
179
|
+
#### `jobs`
|
180
|
+
|
181
|
+
This option represents the `JOB`s to build your document (when none are given via CLI).
|
182
|
+
|
183
|
+
It must contain valid document class names, given as a list of strings.
|
184
|
+
|
185
|
+
By default there are no `JOB`s:
|
186
|
+
|
187
|
+
```yaml
|
188
|
+
# Default value:
|
189
|
+
jobs: []
|
190
|
+
```
|
191
|
+
|
192
|
+
Here is a slightly more interesting example:
|
193
|
+
|
194
|
+
```yaml
|
195
|
+
jobs:
|
196
|
+
- scrartcl
|
197
|
+
- article
|
198
|
+
- book
|
199
|
+
```
|
200
|
+
|
201
|
+
#### `work_path`
|
202
|
+
|
203
|
+
This option is the folder where all elaboration happens.
|
204
|
+
|
205
|
+
It must be a well formed path, given as a string.
|
206
|
+
|
207
|
+
By default none is given, meaning that each run of any given job happens in a dedicated temporary folder:
|
208
|
+
|
209
|
+
```yaml
|
210
|
+
# Default value:
|
211
|
+
work_path: null
|
212
|
+
```
|
213
|
+
|
214
|
+
Overriding this allows you to have easier access to the compilation artifacts.
|
215
|
+
A good choice is setting it to `./build` and keep everything below your source folder:
|
216
|
+
|
217
|
+
```yaml
|
218
|
+
work_path: ./build
|
219
|
+
```
|
220
|
+
|
221
|
+
#### `spinner`
|
222
|
+
|
223
|
+
This option is the spinner animation shown by the CLI.
|
224
|
+
|
225
|
+
It is a series of frames given as characters of a string.
|
226
|
+
|
227
|
+
By default it's a hole looping around in a blister:
|
228
|
+
|
229
|
+
```yaml
|
230
|
+
# Default value:
|
231
|
+
spinner: ⣾⣽⣻⢿⡿⣟⣯⣷
|
232
|
+
```
|
233
|
+
|
234
|
+
Here is a couple more in case your terminal doesn't like Unicode:
|
235
|
+
|
236
|
+
```yaml
|
237
|
+
# A wriggly ASCII worm:
|
238
|
+
spinner: )}]|[{({[|]}
|
239
|
+
# An extended ASCII boomerang:
|
240
|
+
spinner: ╒┍┌┎╓╖┒┐┑╕╛┙┘┚╜╙┖└┕╘
|
241
|
+
```
|
242
|
+
|
243
|
+
Feel free to get creative!
|
244
|
+
|
245
|
+
### `latexmk` configuration
|
246
|
+
|
247
|
+
`latexmk` is configured through [`Perl`](https://www.perl.org/)
|
248
|
+
files named `.latexmkrc` put into your projects' root directory.
|
249
|
+
|
250
|
+
When `latexmk` loads a configuration it also looks up for `.latexmkrc`
|
251
|
+
files in all parent directories to merge then together (from the
|
252
|
+
shallowest to the deepest path). This means that e.g. you can keep
|
253
|
+
a configuration file in your home folder and use it as a global
|
254
|
+
configuration for all you projects, while overwriting only specific
|
255
|
+
options in the configuration files of each one.
|
256
|
+
|
257
|
+
`latexmk` has a gazillion of options.
|
258
|
+
We'll just skim over the most common ones here.
|
259
|
+
|
260
|
+
First of all, one must pick the correct engine.
|
261
|
+
Assuming you want to produce a PDF artifact, you have a few choices:
|
262
|
+
|
263
|
+
```perl
|
264
|
+
$pdf_mode = 1; # create PDF with pdflatex
|
265
|
+
# $pdf_mode = 2; # create PDF with ps2pdf (via PS)
|
266
|
+
# $pdf_mode = 3; # create PDF with dvipdf (via DVI)
|
267
|
+
# $pdf_mode = 4; # create PDF with lualatex
|
268
|
+
# $pdf_mode = 5; # create PDF with xelatex
|
269
|
+
```
|
270
|
+
|
271
|
+
Then, if your PDF previewer is not being detected, you might need to configure it.
|
272
|
+
Assuming you want to use evince:
|
273
|
+
|
274
|
+
```perl
|
275
|
+
$pdf_previewer = 'start evince';
|
276
|
+
```
|
38
277
|
|
39
|
-
|
278
|
+
Most people won't probably need anything more than that.
|
279
|
+
However, for further details read the documentation in the commandline with `man latexmk` or on [CTAN](https://ctan.mirror.garr.it/mirrors/ctan/support/latexmk/latexmk.txt)
|
40
280
|
|
41
|
-
##
|
281
|
+
## Acknowledgements
|
42
282
|
|
43
|
-
|
283
|
+
* Thanks to [@tetrapharmakon](https://github.com/tetrapharmakon) for being the first tester and user.
|
data/Rakefile
CHANGED
@@ -1,6 +1,27 @@
|
|
1
|
-
|
2
|
-
require "rspec/core/rake_task"
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
3
|
+
# require 'mutant'
|
4
|
+
# require 'dry/inflector'
|
5
5
|
|
6
|
-
|
6
|
+
require 'rspec/core/rake_task'
|
7
|
+
|
8
|
+
namespace :spec do
|
9
|
+
desc 'run RSpec'
|
10
|
+
RSpec::Core::RakeTask.new(:rspec) do |task|
|
11
|
+
task.rspec_opts = '--format documentation'
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'run SimpleCov'
|
15
|
+
task :simplecov do
|
16
|
+
ENV['COVERAGE'] = 'true'
|
17
|
+
Rake::Task['spec:rspec'].invoke
|
18
|
+
end
|
19
|
+
|
20
|
+
# desc 'run Mutant'
|
21
|
+
# task :mutant, [:subject] do |_, args|
|
22
|
+
# subjects = [args[:subject]].compact
|
23
|
+
# subjects << 'Mnogootex*' if subjects.empty?
|
24
|
+
# successful = ::Mutant::CLI.run(%w[--use rspec --fail-fast] + subjects)
|
25
|
+
# raise('Mutant task is not successful') unless successful
|
26
|
+
# end
|
27
|
+
end
|
data/demo/.mnogootexrc
ADDED