polytexnic 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7811a66c9d17ae4c458e5ae584f9d5c7b5d967aa6c6405a34b3e5203c4923e2b
4
- data.tar.gz: f50df8db56ef4f75072f4ae6fb094f5cc3e9165a0f982db1f09c4e4c01dd7619
3
+ metadata.gz: b5019c283b39dc25f4f2ff80cda181c78c5d77e37b7245faf92c51cfee93bc35
4
+ data.tar.gz: 2c8d5e978e45e28ec12f0b0010ad6f701d5982e15469fedc3291861b09132d2a
5
5
  SHA512:
6
- metadata.gz: b62df40cecb2a8c2e94a4afcbbb74c013f2395963a405c2f4a6bb7ae859d3325c458e6a1622e6a8aee0eafe72a9b34ecf4789bc8e90bcd65f4c17b6c13dfc4cd
7
- data.tar.gz: 5d64cc55e439a0588090320c7911415e75d6267d2d00280fabfd06d92418431cb9cf829303de8b26604fc305a5a2decedd1bd354372559551d31c9e152cdd937
6
+ metadata.gz: 127fb2ef04c1d0a1d6848f0c8ad540cccc23c7bb7c680b9ea2460e63b74e699af5cf30b10f594d039f3464b43da088b9aa098c9274ba6f5ac020e50e85779e19
7
+ data.tar.gz: 6ed16fb665fdba858cce00d8c420dffc3f02284384ddd5830c7e3caccdf0b189c569c40c949dca7f85a060f239c9f4642261166d65cbd5612416ccb1088fe21c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polytexnic (1.6.2)
4
+ polytexnic (1.6.3)
5
5
  json (~> 2.3.0)
6
6
  kramdown (>= 1.17, < 3.0)
7
7
  msgpack (~> 1.2.0)
@@ -25,7 +25,7 @@ GEM
25
25
  debugger-linecache (~> 1.2.0)
26
26
  diff-lcs (1.4.4)
27
27
  docile (1.1.5)
28
- ffi (1.14.2)
28
+ ffi (1.15.0)
29
29
  formatador (0.2.5)
30
30
  growl (1.0.3)
31
31
  guard (2.16.2)
data/bin/polytexnic CHANGED
@@ -40,23 +40,26 @@ end.parse!
40
40
  # Returns the file format based on extension.
41
41
  # Should be 'html' or 'tex'.
42
42
  def format(filename)
43
- puts '***********'
44
- puts '***********'
45
- puts '***********'
46
- puts '***********'
47
- puts '***********'
48
- p filename.split('.')
49
43
  filename.split('.').last
50
44
  rescue
51
45
  nil
52
46
  end
53
47
 
54
- puts '$$$$$$$$$$$'
55
- puts '$$$$$$$$$$$'
56
- puts '$$$$$$$$$$$'
57
- puts '$$$$$$$$$$$'
58
- puts '$$$$$$$$$$$'
59
- p options
48
+ # Defines a valid HTML template.
49
+ def html_template(title, body)
50
+ %(<!DOCTYPE html>
51
+ <html>
52
+ <head>
53
+ <title>#{title}</title>
54
+ <meta charset="utf-8">
55
+ </head>
56
+ <body>
57
+ #{body}
58
+ </body>
59
+ </html>
60
+ )
61
+ end
62
+
60
63
  if (infile = options[:infile] || ARGV.shift)
61
64
  puts infile
62
65
  input = File.read(infile)
@@ -68,7 +71,7 @@ puts outfile
68
71
  pipeline = Polytexnic::Pipeline.new(input, article: true)
69
72
  format = options[:format] || format(outfile) || "html"
70
73
  if format == "html"
71
- output = pipeline.to_html
74
+ output = html_template("HTML output", pipeline.to_html)
72
75
  elsif format == "tex"
73
76
  output = pipeline.to_polytex
74
77
  else
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "1.6.2"
2
+ VERSION = "1.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polytexnic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hartl
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-03-05 00:00:00.000000000 Z
12
+ date: 2021-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri