mo2tex 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0d4a3e29680a83e0ed36be6adb016ccbae0514ae391b20ae47cf9636afa5af0
4
- data.tar.gz: 89558d4aedee21d11e805100bb4382ce5e9f8074e5e605ec7ffc2153fc07320f
3
+ metadata.gz: f68191fdbb4823e1f2918d06fc359c049094683a488e10a3dba6173372e6f195
4
+ data.tar.gz: ebec861600d24f1e1e95e860ed705861829928cd1a3489d8495bb8c7a5bc39ca
5
5
  SHA512:
6
- metadata.gz: c0b52b0888cfad63b7f2ea9ac5ff0dad89b883fa64b2bd2f68b9c8c6ecfd46275aaf786da78a8ddca98765a85a80fc3f7c74768eb210d107149f46e87acb5fdd
7
- data.tar.gz: d8ad2fa5702a9bf2337ab2aab272afc8424da4b0a27ee1407f44226f5661dd75f770bb221f2faa4dde8a87f75cb8e1afeaa0591036133fe9c88a3689e4dbb3ff
6
+ metadata.gz: 0277efd60def0f56f639e2f93bf7b73f1927240bffa7605aaf5e3a425664d205c6f476a959920d50c1970d11a9ad18000c3e55de4eda3359013c79739274f805
7
+ data.tar.gz: 66a0283cb729da2a976a14157cdaa987885f67d839152990a3f1739c19d64f019c5da0f78dfde3329aa640812f8149f32655777742a8b0072b6d9568a33bd256
data/README.md CHANGED
@@ -1,22 +1,45 @@
1
- # `mo2tex` - A pure `ruby` monteore-to-`latex` table generator
1
+ # `mo2tex` - A pure `ruby` monteore-to-`latex`, `ical` and `pic` table generator
2
2
 
3
3
  ![[pipeline](https://gitlab.com/SMELAT/mo2tex)](https://gitlab.com/SMELAT/mo2tex/badges/master/pipeline.svg)
4
4
 
5
- `mo2tex` is a pure `ruby` monteore-to-`latex` table generator
5
+ `mo2tex` is a pure `ruby` monteore-to-`latex`, `ical` and `pic` table generator
6
6
 
7
7
  ## Installation
8
8
 
9
9
  Install the gem and add to the application's Gemfile by executing:
10
10
 
11
+ ```sh
11
12
  $ bundle add mo2tex
13
+ ```
12
14
 
13
15
  If bundler is not being used to manage dependencies, install the gem by executing:
14
16
 
17
+ ```sh
15
18
  $ gem install mo2tex
19
+ ```
20
+
21
+ ## Configuration
22
+
23
+ You will have to write a `yaml` configuration file before using `mo2tex`.
24
+ Please check the [example provided](./config/courses.yml) for a sample configuration file.
16
25
 
17
26
  ## Usage
18
27
 
19
- TODO: Write usage instructions here
28
+ After installation, you should be able to run:
29
+
30
+ ```sh
31
+ $ m2l <config file> # this should create a latex file on standard out with your monteore listing
32
+ ```
33
+
34
+ Please check the [example provided](./config/courses.yml) for a configuration file.
35
+
36
+ ```sh
37
+ $ m2c <config file> > <ical calendar file> # this should create an ical file on standard out which you can upload anywhere fitting
38
+ ```
39
+
40
+ ```sh
41
+ $ m2p <config file> | groff -p -mpic -Tpdf -P-pa4 # this should create a pdf file on standard out with a table of the lessons
42
+ ```
20
43
 
21
44
  ## Development
22
45
 
data/Rakefile CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  require "bundler/gem_tasks"
4
4
  require "rspec/core/rake_task"
5
+ require 'rdoc/task'
6
+
7
+ RDoc::Task.new do |rdoc|
8
+ rdoc.main = "README.md"
9
+ rdoc.rdoc_files.include(rdoc.main, "lib/**/*.rb")
10
+ end
5
11
 
6
12
  RSpec::Core::RakeTask.new(:spec)
7
13
 
@@ -8,6 +8,5 @@ maxpsht=29.7
8
8
  textwid=maxpswid-scale
9
9
  textht =maxpsht-1.035*scale
10
10
 
11
- copy "config/templates/pic/objects.pic"
11
+ copy "<%= self.absolute_pic_objects_include_path -%>"
12
12
  .PE
13
-
data/lib/mo2tex/pic.rb CHANGED
@@ -200,12 +200,16 @@ module Mo2tex
200
200
  result = ''
201
201
  self.pages.each do
202
202
  |page|
203
- result += self.header
203
+ result += self.header.result(binding)
204
204
  result += self.body.result(binding)
205
205
  result += self.trailer.result(binding)
206
206
  end
207
207
  return result
208
208
  end
209
+
210
+ def absolute_pic_objects_include_path
211
+ return File.expand_path(File.join(['..'] * 3, 'config', 'templates', 'pic', 'objects.pic'), __FILE__)
212
+ end
209
213
 
210
214
  DAYS_PER_PAGE = 12
211
215
  DAYS_PER_ROW = 4
@@ -273,7 +277,8 @@ module Mo2tex
273
277
  end
274
278
 
275
279
  def read_header
276
- return read('header.pic')
280
+ template = read('header.pic.erb')
281
+ return ERB.new(template, trim_mode: '-')
277
282
  end
278
283
 
279
284
  def read_trailer
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mo2tex
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mo2tex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicola Bernardini
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2024-12-05 00:00:00.000000000 Z
10
+ date: 2025-01-08 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rdoc
@@ -65,7 +65,8 @@ dependencies:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
- description: mo2tex transforms a Monte Ore calendar into a Tex table
68
+ description: mo2tex transforms a Monte Ore calendar into a LaTex table, or an ical
69
+ file, or a pic table
69
70
  email:
70
71
  - nicola.bernardini.rome@gmail.com
71
72
  executables:
@@ -86,7 +87,7 @@ files:
86
87
  - config/templates/latex/header.tex
87
88
  - config/templates/latex/trailer.tex
88
89
  - config/templates/pic/body.pic.erb
89
- - config/templates/pic/header.pic
90
+ - config/templates/pic/header.pic.erb
90
91
  - config/templates/pic/objects.pic
91
92
  - config/templates/pic/trailer.pic.erb
92
93
  - exe/m2c
@@ -132,5 +133,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
133
  requirements: []
133
134
  rubygems_version: 3.6.0.dev
134
135
  specification_version: 4
135
- summary: mo2tex transforms a Monte Ore calendar into a Tex table
136
+ summary: mo2tex transforms a Monte Ore calendar into a LaTex table, or an ical file,
137
+ or a pic table
136
138
  test_files: []