mdpress 0.0.12 → 0.0.13

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.
data/bin/mdpress CHANGED
@@ -29,7 +29,7 @@ def list_available_stylesheets
29
29
  end
30
30
  end
31
31
 
32
- def render
32
+ def render opts
33
33
  text = File.read(FILENAME)
34
34
  # ugly hack to get attributes for impress.js
35
35
  # TODO make this pretty
@@ -54,7 +54,7 @@ def render
54
54
 
55
55
  # now use those attributes and render the file
56
56
  include Redcarpet
57
- ImpressRenderer.init_with_attrs attrs
57
+ ImpressRenderer.init_with_attrs attrs, opts
58
58
  if File.exist?(STYLESHEET_HEAD)
59
59
  ImpressRenderer.set_head(File.read(STYLESHEET_HEAD))
60
60
  else
@@ -77,6 +77,7 @@ EOS
77
77
  opt :stylesheet, "Specify what stylesheet to use.", :default => "default"
78
78
  opt :list, "List all available stylesheets."
79
79
  opt :run, "Run presentation (automatically compiles to a tmp directory and opens in a browser window)"
80
+ opt :latex, "Provide Latex support"
80
81
  opt :verbose, "Be verbose."
81
82
  end
82
83
 
@@ -122,7 +123,7 @@ else
122
123
  Dir.mkdir(DIRNAME)
123
124
  end
124
125
 
125
- render
126
+ render OPTS
126
127
 
127
128
  log "copying files"
128
129
  FileUtils.cp_r(base_dir + "js", DIRNAME)
@@ -134,7 +135,12 @@ def auto
134
135
  sleep 2
135
136
  if FileUtils.uptodate?(FILENAME, [DIRNAME + "/index.html"])
136
137
  log "updating from #{FILENAME}"
137
- render
138
+ render OPTS
139
+ end
140
+ # Takes care of updating stylesheets for local styles.
141
+ if FileUtils.uptodate?(STYLESHEET, [DIRNAME + "/css/style.css"])
142
+ log "updating stylesheet #{STYLESHEET}"
143
+ FileUtils.cp(STYLESHEET, DIRNAME + "/css/style.css")
138
144
  end
139
145
  end
140
146
  end
@@ -4,8 +4,8 @@ html {
4
4
 
5
5
  body {
6
6
  font-family: 'Open Sans', sans-serif;
7
- line-height: .8;
8
- font-size: 45px;
7
+ line-height: 40px;
8
+ font-size: 32px;
9
9
  }
10
10
 
11
11
  body {
@@ -71,6 +71,7 @@ h1 {
71
71
  }
72
72
 
73
73
  h2 {
74
+ font-size: 48px;
74
75
  font-weight: 300;
75
76
  letter-spacing: .1em;
76
77
  text-transform: uppercase;
@@ -101,6 +102,11 @@ table {
101
102
  pointer-events: auto; /* Enable Click on link */
102
103
  }
103
104
 
105
+ code {
106
+ font-size: 30px;
107
+ line-height: 36px;
108
+ }
109
+
104
110
  a {
105
111
  pointer-events: none; /* Fix Body Click */
106
112
  color: inherit;
@@ -122,7 +128,6 @@ a:hover {
122
128
  p {
123
129
  font-weight: 400;
124
130
  line-height: 60px;
125
- text-align: center;
126
131
  }
127
132
 
128
133
  ol {
@@ -134,9 +139,8 @@ ul {
134
139
  }
135
140
 
136
141
  li {
137
- margin: 10px 0;
138
142
  line-height: 50px;
139
- list-style: none;
143
+ list-style: disc;
140
144
  }
141
145
 
142
146
  td,th {
@@ -0,0 +1,162 @@
1
+ /* the style used in impress.js's intro presentation */
2
+
3
+ /* http://meyerweb.com/eric/tools/css/reset/
4
+ v2.0 | 20110126
5
+ License: none (public domain)
6
+ */
7
+
8
+ html, body, div, span, applet, object, iframe,
9
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
10
+ a, abbr, acronym, address, big, cite, code,
11
+ del, dfn, em, img, ins, kbd, q, s, samp,
12
+ small, strike, strong, sub, sup, tt, var,
13
+ b, u, i, center,
14
+ dl, dt, dd, ol, ul, li,
15
+ fieldset, form, label, legend,
16
+ table, caption, tbody, tfoot, thead, tr, th, td,
17
+ article, aside, canvas, details, embed,
18
+ figure, figcaption, footer, header, hgroup,
19
+ menu, nav, output, ruby, section, summary,
20
+ time, mark, audio, video {
21
+ margin: 0;
22
+ padding: 0;
23
+ border: 0;
24
+ font-size: 100%;
25
+ font: inherit;
26
+ vertical-align: baseline;
27
+ }
28
+
29
+ /* HTML5 display-role reset for older browsers */
30
+ article, aside, details, figcaption, figure,
31
+ footer, header, hgroup, menu, nav, section {
32
+ display: block;
33
+ }
34
+ body {
35
+ line-height: 1;
36
+ }
37
+ ol{
38
+ margin: 0px 0 20px 70px;
39
+ }
40
+
41
+ ul {
42
+ margin: 0px 0 20px 50px;
43
+ }
44
+
45
+ blockquote, q {
46
+ border-left: 10px solid #BBB;
47
+ padding-left: 10px;
48
+ }
49
+
50
+ blockquote p {
51
+ line-height: 60px;
52
+ }
53
+
54
+ blockquote:before, blockquote:after,
55
+ q:before, q:after {
56
+ content: '';
57
+ content: none;
58
+ }
59
+
60
+ table {
61
+ border-collapse: collapse;
62
+ border-spacing: 0;
63
+ }
64
+
65
+
66
+ /* show "unsupported" message conditionally */
67
+
68
+ .fallback-message {
69
+ font-family: sans-serif;
70
+ line-height: 1.3;
71
+
72
+ width: 780px;
73
+ padding: 10px 10px 0;
74
+ margin: 20px auto;
75
+
76
+ border: 1px solid #E4C652;
77
+ border-radius: 10px;
78
+ background: #EEDC94;
79
+ }
80
+
81
+ .fallback-message p {
82
+ margin-bottom: 10px;
83
+ }
84
+
85
+ .impress-supported .fallback-message {
86
+ display: none;
87
+ }
88
+
89
+ /* styles start here */
90
+
91
+ body {
92
+ font-family: 'Lato', sans-serif;
93
+
94
+ min-height: 740px;
95
+ background: white;
96
+
97
+ -webkit-font-smoothing: antialiased;
98
+ }
99
+
100
+ .step {
101
+ -webkit-transition: opacity 1s;
102
+ -moz-transition: opacity 1s;
103
+ -ms-transition: opacity 1s;
104
+ -o-transition: opacity 1s;
105
+ transition: opacity 1s;
106
+ }
107
+
108
+ .step:not(.active) {
109
+ opacity: 0.0;
110
+ }
111
+
112
+ .step {
113
+ width: 1400px;
114
+ min-height: 800px;
115
+ padding: 100px;
116
+
117
+ -webkit-box-sizing: border-box;
118
+ -moz-box-sizing: border-box;
119
+ -ms-box-sizing: border-box;
120
+ -o-box-sizing: border-box;
121
+ box-sizing: border-box;
122
+
123
+ font-size: 36px;
124
+ line-height: 48px;
125
+ }
126
+
127
+ h1 {
128
+ font-weight: 900;
129
+ font-size: 80px;
130
+ margin: 10px 0 20px 0;
131
+ text-align: center;
132
+ }
133
+
134
+ h2 {
135
+ font-weight: 900;
136
+ font-size: 48px;
137
+ margin: 10px 0 20px 0;
138
+ }
139
+
140
+ p {
141
+ font-weight: 400;
142
+ color: #555;
143
+ }
144
+
145
+ a {
146
+ text-decoration: none;
147
+ border-bottom: 1px solid #ddd;
148
+ }
149
+
150
+ li {
151
+ margin: 3px 0;
152
+ }
153
+
154
+ /* code highlighting */
155
+
156
+ code {
157
+ background: #F2F2F2;
158
+ font-family: monospace, serif;
159
+ word-wrap: break-word;
160
+ font-size: 30px;
161
+ line-height: 36px;
162
+ }
@@ -0,0 +1 @@
1
+ <link href="http://fonts.googleapis.com/css?family=Lato:300,900" rel="stylesheet" />
@@ -4,9 +4,10 @@ class ImpressRenderer < Redcarpet::Render::HTML
4
4
  @@current = 0
5
5
  @@head = ""
6
6
 
7
- def self.init_with_attrs att
8
- @@attrs = att
7
+ def self.init_with_attrs _attrs, _opts
8
+ @@attrs = _attrs
9
9
  @@current = 0
10
+ @@opts = _opts
10
11
  end
11
12
 
12
13
  def self.set_head head
@@ -29,6 +30,19 @@ class ImpressRenderer < Redcarpet::Render::HTML
29
30
  "<code class='inline prettyprint'>#{code}</code>"
30
31
  end
31
32
 
33
+ def mathjax
34
+ if @@opts[:latex]
35
+ %{
36
+ <script type="text/x-mathjax-config">
37
+ MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
38
+ </script>
39
+ <script type="text/javascript"
40
+ src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
41
+ </script>
42
+ }
43
+ end
44
+ end
45
+
32
46
  def doc_header
33
47
  %{<!DOCTYPE html>
34
48
  <html>
@@ -43,7 +57,7 @@ class ImpressRenderer < Redcarpet::Render::HTML
43
57
  <link href="css/highlight.css" type="text/css" rel="stylesheet" />
44
58
  <script type="text/javascript" src="js/highlight.pack.js"></script>
45
59
  <script>hljs.initHighlightingOnLoad();</script>
46
-
60
+ #{self.mathjax}
47
61
  <link href="css/style.css" rel="stylesheet" />
48
62
  #{@@head}
49
63
  </head>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdpress
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease: false
4
+ hash: 5
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 12
10
- version: 0.0.12
9
+ - 13
10
+ version: 0.0.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aditya Bhargava
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-10-29 00:00:00 -07:00
19
- default_executable:
18
+ date: 2012-10-29 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: redcarpet
@@ -106,11 +105,12 @@ files:
106
105
  - lib/impress_css/default.html
107
106
  - lib/impress_css/impress.css
108
107
  - lib/impress_css/impress.html
108
+ - lib/impress_css/obtvse.css
109
+ - lib/impress_css/obtvse.html
109
110
  - lib/impress_renderer.rb
110
111
  - lib/js/highlight.pack.js
111
112
  - lib/js/impress.js
112
113
  - bin/mdpress
113
- has_rdoc: true
114
114
  homepage: https://github.com/egonSchiele/mdpress
115
115
  licenses: []
116
116
 
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  requirements: []
141
141
 
142
142
  rubyforge_project:
143
- rubygems_version: 1.3.7
143
+ rubygems_version: 1.8.25
144
144
  signing_key:
145
145
  specification_version: 3
146
146
  summary: Build impress.js presentations from markdown files.