mo2tex 1.0.1 → 1.0.3
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 +4 -4
- data/config/templates/latex/header.tex +1 -0
- data/exe/m2c +1 -1
- data/exe/m2l +1 -1
- data/exe/m2p +1 -1
- data/lib/mo2tex/latex.rb +1 -1
- data/lib/mo2tex/pic.rb +18 -3
- data/lib/mo2tex/school.rb +3 -1
- data/lib/mo2tex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 266da553a3a6a1c7935f36472d52851be4eefa7d8306cd374059c6059479952d
|
4
|
+
data.tar.gz: e513ea7c171cbfca4832f823b31e910709f3dd871a860cb01bc332c7df6b2ad8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac02e006de049b9770969fcdb8556b0dba958e4989c91b89e0ce182493cbbf1b5050e0e4afa40be454e327ae35d28c2859c26d1f694b41b5f7cfa95354f4fda8
|
7
|
+
data.tar.gz: 62ab019275100b20119e67d628cfb49923a744b5a2ef49491309352898c44b7a5bcfbe7b2724476a389fdaf697f9d2f0243c6add8ba7b3e141926ffd4bacabb9
|
data/exe/m2c
CHANGED
data/exe/m2l
CHANGED
data/exe/m2p
CHANGED
data/lib/mo2tex/latex.rb
CHANGED
@@ -26,7 +26,7 @@ module Mo2tex
|
|
26
26
|
|
27
27
|
def table_body
|
28
28
|
result = ''
|
29
|
-
head = proc { |title| "\\hline\n\\multicolumn{3}{|l|}{\\bfseries #{title}}\\\\\n\\hline\n" }
|
29
|
+
head = proc { |title, students| "\\hline\n\\multicolumn{3}{|l|}{\\bfseries #{title}}\\\\\n\\multicolumn{3}{|p{0.9\\textwidth}|}{studenti: #{students}}\\\\\n\\hline\n" }
|
30
30
|
tail = proc { |sctot| "\\multicolumn{2}{l}{Totale ore corso:} & \\hfill#{sctot.round.to_i}\\\\\n & & \\\\\n" }
|
31
31
|
@total_hours_done, result = self.school.generate(head, tail) do
|
32
32
|
|title, nol, ev|
|
data/lib/mo2tex/pic.rb
CHANGED
@@ -114,11 +114,26 @@ module Mo2tex
|
|
114
114
|
def pic_time
|
115
115
|
return sprintf("%s-%s", self.slot.dtstart.hm_to_s, self.slot.dtend.hm_to_s)
|
116
116
|
end
|
117
|
-
|
117
|
+
|
118
118
|
def pic_title
|
119
|
-
|
119
|
+
result = self.slot.class == Event ? make_pic_title : self.slot.title
|
120
|
+
return result
|
120
121
|
end
|
121
|
-
|
122
|
+
|
123
|
+
alias_method :title, :pic_title
|
124
|
+
|
125
|
+
private
|
126
|
+
|
127
|
+
TITLE_RANGE = 2..4 # the title is in this range
|
128
|
+
ANN_RANGE = 5..-1
|
129
|
+
|
130
|
+
def make_pic_title
|
131
|
+
sep = self.slot.title.gsub(/_+/, ' ').split(/ /)
|
132
|
+
acro = sep[TITLE_RANGE].map { |w| w[0] }.join
|
133
|
+
ann = sep[ANN_RANGE].join(' ')
|
134
|
+
return sprintf("%s (%s)", ann, acro)
|
135
|
+
end
|
136
|
+
|
122
137
|
end
|
123
138
|
|
124
139
|
class Container < Base
|
data/lib/mo2tex/school.rb
CHANGED
@@ -30,7 +30,9 @@ module Mo2tex
|
|
30
30
|
hours_done = 0
|
31
31
|
self.each_course do
|
32
32
|
|title, c|
|
33
|
-
|
33
|
+
studs_fc = c.students_fc ? (', \textcolor{gray}{' + c.students_fc + '}') : ''
|
34
|
+
studs = c.students + studs_fc
|
35
|
+
result += head.call(title, studs)
|
34
36
|
result += c.generate(&block)
|
35
37
|
result += tail.call(c.hours_done)
|
36
38
|
hours_done += c.hours_done
|
data/lib/mo2tex/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicola Bernardini
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-13 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rdoc
|