mdify 1.1.0 → 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/README.md +32 -40
- data/bin/mdify +32 -14
- data/lib/mdify/renderer.rb +27 -17
- data/lib/mdify/version.rb +3 -0
- data/lib/mdify.rb +4 -7
- data/vendor/template.html +192 -6
- metadata +38 -27
- data/Gemfile +0 -2
- data/Gemfile.lock +0 -20
- data/Rakefile +0 -126
- data/mdify.gemspec +0 -62
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f220feaa264d0b22ea559579cfc39e8b4665e8365f307c7f1cf6728c95223e27
|
|
4
|
+
data.tar.gz: ba2929428bca142ef82ea8b493f2bfe386064e5e99f4e34a127902b22fafadf7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7c3e9ccc585fcd033ecca8f6c36282afd3ed223b0c765fb5408392bc86bbf230b50d4f6bf230b55b650f902f09758d06caffa633e90ada8dd26c36b2f0cc8bc
|
|
7
|
+
data.tar.gz: ec1370b3f1b134624ae7df538a6fedf384f6ee833a495c345b40360aa2db293209e7ce2f8445265ea8ae0b655b454c1b1786628d2ea5e7054079b238e3be5d54
|
data/README.md
CHANGED
|
@@ -1,59 +1,51 @@
|
|
|
1
1
|
mdify
|
|
2
2
|
=====
|
|
3
|
-
`mdify` is a tool for previewing Markdown documents
|
|
3
|
+
`mdify` is a tool for previewing Markdown documents in your browser, with a clean,
|
|
4
|
+
readable serif stylesheet inspired by long-form readers.
|
|
4
5
|
|
|
5
|
-

|
|
6
7
|
|
|
7
8
|
Usage
|
|
8
9
|
-----
|
|
9
|
-
|
|
10
|
+
```
|
|
11
|
+
mdify super_secret.md
|
|
12
|
+
```
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
It will automatically open a new browser window with the content rendered in there.
|
|
14
|
+
A new browser tab opens with the rendered document.
|
|
14
15
|
|
|
15
16
|
Installing
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
----------
|
|
18
|
+
Requires Ruby 3.0 or newer.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
```
|
|
21
|
+
gem install mdify
|
|
22
|
+
```
|
|
20
23
|
|
|
21
24
|
Emacs
|
|
22
|
-
|
|
23
|
-
You can hook `mdify` to the `compile-command` in Emacs so it
|
|
24
|
-
key.
|
|
25
|
-
|
|
26
|
-
First, bind the compile key to whatever you want to use:
|
|
27
|
-
|
|
28
|
-
(global-set-key [f5] 'compile)
|
|
29
|
-
|
|
30
|
-
Then create a new hook for the Markdown mode:
|
|
31
|
-
|
|
32
|
-
(add-hook 'markdown-mode-hook
|
|
33
|
-
(lambda ()
|
|
34
|
-
(set (make-local-variable 'compile-command) (concat "mdify " (buffer-name)))))
|
|
25
|
+
-----
|
|
26
|
+
You can hook `mdify` to the `compile-command` in Emacs so it runs by pressing a key.
|
|
35
27
|
|
|
36
|
-
|
|
28
|
+
Bind the compile key:
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
```elisp
|
|
31
|
+
(global-set-key [f5] 'compile)
|
|
32
|
+
```
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
2. Require it and set your Ruby version:
|
|
34
|
+
Then add a hook for Markdown mode:
|
|
43
35
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
```elisp
|
|
37
|
+
(add-hook 'markdown-mode-hook
|
|
38
|
+
(lambda ()
|
|
39
|
+
(set (make-local-variable 'compile-command) (concat "mdify " (buffer-name)))))
|
|
40
|
+
```
|
|
47
41
|
|
|
48
|
-
|
|
42
|
+
Now F5 inside any Markdown document previews it in your browser.
|
|
49
43
|
|
|
50
44
|
Stylesheet
|
|
51
|
-
|
|
52
|
-
The
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
This was written by [Federico](http://mheroin.com). Drop me a line on Twitter
|
|
59
|
-
([@febuiles](http://twitter.com/febuiles)) if you're using this.
|
|
45
|
+
----------
|
|
46
|
+
The styling uses IBM Plex Serif over a warm cream palette. There's no support for
|
|
47
|
+
custom stylesheets yet; open an issue or PR if you'd like that.
|
|
48
|
+
|
|
49
|
+
License
|
|
50
|
+
-------
|
|
51
|
+
MIT. Written by [Federico Builes](https://github.com/febuiles).
|
data/bin/mdify
CHANGED
|
@@ -1,23 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
lib_dir = File.join(File.dirname(__FILE__), '..', 'lib')
|
|
4
|
-
$LOAD_PATH.unshift lib_dir if File.directory?(lib_dir)
|
|
2
|
+
require "optparse"
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
lib_dir = File.expand_path("../lib", __dir__)
|
|
5
|
+
$LOAD_PATH.unshift(lib_dir) if File.directory?(lib_dir)
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
puts "usage: mdify file"
|
|
10
|
-
exit(-1)
|
|
11
|
-
end
|
|
7
|
+
require "mdify"
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
options = {}
|
|
10
|
+
parser = OptionParser.new do |opts|
|
|
11
|
+
opts.banner = "Usage: mdify [options] FILE"
|
|
12
|
+
opts.on("-v", "--version", "Print version and exit") do
|
|
13
|
+
puts "mdify #{Mdify::VERSION}"
|
|
14
|
+
exit
|
|
15
|
+
end
|
|
16
|
+
opts.on("-h", "--help", "Show this help") do
|
|
17
|
+
puts opts
|
|
18
|
+
exit
|
|
19
|
+
end
|
|
20
|
+
end
|
|
14
21
|
|
|
15
|
-
|
|
22
|
+
begin
|
|
23
|
+
parser.parse!
|
|
24
|
+
rescue OptionParser::InvalidOption => e
|
|
25
|
+
warn e.message
|
|
26
|
+
warn parser
|
|
27
|
+
exit 1
|
|
28
|
+
end
|
|
16
29
|
|
|
17
|
-
if
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
puts "mdify: #{file}: No such file or directory"
|
|
30
|
+
if ARGV.empty?
|
|
31
|
+
warn parser
|
|
32
|
+
exit 1
|
|
21
33
|
end
|
|
22
34
|
|
|
35
|
+
file = ARGV.first
|
|
36
|
+
unless File.exist?(file)
|
|
37
|
+
warn "mdify: #{file}: No such file or directory"
|
|
38
|
+
exit 1
|
|
39
|
+
end
|
|
23
40
|
|
|
41
|
+
Mdify.preview(file)
|
data/lib/mdify/renderer.rb
CHANGED
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
module Mdify
|
|
2
|
-
HTML_TEMPLATE_PATH = File.
|
|
2
|
+
HTML_TEMPLATE_PATH = File.expand_path("../../vendor/template.html", __dir__)
|
|
3
3
|
|
|
4
4
|
class Renderer
|
|
5
|
+
MARKDOWN_OPTIONS = {
|
|
6
|
+
autolink: true,
|
|
7
|
+
fenced_code_blocks: true,
|
|
8
|
+
tables: true,
|
|
9
|
+
strikethrough: true,
|
|
10
|
+
superscript: true,
|
|
11
|
+
no_intra_emphasis: true,
|
|
12
|
+
space_after_headers: true
|
|
13
|
+
}.freeze
|
|
14
|
+
|
|
5
15
|
attr_reader :title, :content
|
|
6
16
|
|
|
7
17
|
def initialize(filename)
|
|
8
|
-
@title =
|
|
18
|
+
@title = File.basename(filename)
|
|
9
19
|
@content = File.read(filename)
|
|
10
20
|
end
|
|
11
21
|
|
|
12
22
|
def render
|
|
13
|
-
|
|
23
|
+
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, MARKDOWN_OPTIONS)
|
|
24
|
+
html = markdown.render(@content)
|
|
14
25
|
document = render_html(@title, html)
|
|
15
|
-
|
|
16
|
-
if RUBY_PLATFORM.downcase.include?("darwin")
|
|
17
|
-
exec "open #{temp_file}"
|
|
18
|
-
else
|
|
19
|
-
exec "launchy #{temp_file}"
|
|
20
|
-
end
|
|
26
|
+
open_in_browser(write_html(document))
|
|
21
27
|
end
|
|
22
28
|
|
|
23
29
|
protected
|
|
24
30
|
|
|
31
|
+
def open_in_browser(path)
|
|
32
|
+
opener = RbConfig::CONFIG["host_os"] =~ /darwin/i ? "open" : "xdg-open"
|
|
33
|
+
system(opener, path)
|
|
34
|
+
end
|
|
35
|
+
|
|
25
36
|
def render_html(title, html)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
document.sub!(/\{\{ body \}\}/, html)
|
|
37
|
+
template = File.read(HTML_TEMPLATE_PATH)
|
|
38
|
+
template.gsub("{{ title }}") { title }.sub("{{ body }}") { html }
|
|
29
39
|
end
|
|
30
40
|
|
|
31
|
-
def
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
def write_html(contents)
|
|
42
|
+
dir = Dir.mktmpdir("mdify")
|
|
43
|
+
path = File.join(dir, "#{File.basename(@title, ".*")}.html")
|
|
44
|
+
File.write(path, contents)
|
|
45
|
+
path
|
|
36
46
|
end
|
|
37
47
|
end
|
|
38
48
|
end
|
data/lib/mdify.rb
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
3
|
-
require 'redcarpet'
|
|
4
|
-
require 'launchy'
|
|
1
|
+
require "tmpdir"
|
|
2
|
+
require "redcarpet"
|
|
5
3
|
|
|
6
|
-
require
|
|
4
|
+
require "mdify/version"
|
|
5
|
+
require "mdify/renderer"
|
|
7
6
|
|
|
8
7
|
module Mdify
|
|
9
|
-
VERSION = "1.1.0"
|
|
10
|
-
|
|
11
8
|
def self.preview(filename)
|
|
12
9
|
Renderer.new(filename).render
|
|
13
10
|
end
|
data/vendor/template.html
CHANGED
|
@@ -1,16 +1,202 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
2
3
|
<head>
|
|
3
4
|
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
4
6
|
<title>{{ title }}</title>
|
|
5
|
-
<link rel="
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
+
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,600;0,700;1,400;1,700&display=swap" rel="stylesheet">
|
|
6
10
|
<style>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
:root {
|
|
12
|
+
--color-primary: #B44E5D;
|
|
13
|
+
--color-primary-hover: #A04553;
|
|
14
|
+
--color-bg: #F8F3EC;
|
|
15
|
+
--color-surface: #F2EDE6;
|
|
16
|
+
--color-border: #E8E4E0;
|
|
17
|
+
--color-text: #1A1918;
|
|
18
|
+
--color-text-soft: #4A4846;
|
|
19
|
+
--color-muted: #999590;
|
|
20
|
+
--serif: 'IBM Plex Serif', Georgia, serif;
|
|
21
|
+
--mono: 'Monaco', 'Menlo', 'Courier New', monospace;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
25
|
+
|
|
26
|
+
html, body {
|
|
27
|
+
margin: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
background-color: var(--color-bg);
|
|
30
|
+
color: var(--color-text-soft);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
body {
|
|
34
|
+
font-family: var(--serif);
|
|
35
|
+
font-size: 20px;
|
|
36
|
+
line-height: 1.8;
|
|
37
|
+
padding: 40px 20px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.reader-article {
|
|
41
|
+
max-width: 720px;
|
|
42
|
+
margin: 0 auto;
|
|
43
|
+
padding: 20px 24px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.reader-header {
|
|
47
|
+
margin-bottom: 32px;
|
|
48
|
+
padding-bottom: 16px;
|
|
49
|
+
border-bottom: 1px solid var(--color-border);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.reader-meta {
|
|
53
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
letter-spacing: 0.5px;
|
|
57
|
+
text-transform: uppercase;
|
|
58
|
+
color: var(--color-muted);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.reader-content > h1:first-child,
|
|
62
|
+
.reader-content > h2:first-child {
|
|
63
|
+
margin-top: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.reader-content p {
|
|
67
|
+
margin: 0 0 20px 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.reader-content h1,
|
|
71
|
+
.reader-content h2,
|
|
72
|
+
.reader-content h3,
|
|
73
|
+
.reader-content h4,
|
|
74
|
+
.reader-content h5,
|
|
75
|
+
.reader-content h6 {
|
|
76
|
+
margin: 32px 0 16px 0;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
line-height: 1.4;
|
|
79
|
+
color: var(--color-text);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.reader-content h1 { font-size: 28px; }
|
|
83
|
+
.reader-content h2 { font-size: 24px; }
|
|
84
|
+
.reader-content h3 { font-size: 20px; }
|
|
85
|
+
.reader-content h4 { font-size: 18px; }
|
|
86
|
+
.reader-content h5,
|
|
87
|
+
.reader-content h6 { font-size: 16px; }
|
|
88
|
+
|
|
89
|
+
.reader-content ul,
|
|
90
|
+
.reader-content ol {
|
|
91
|
+
margin: 0 0 20px 0;
|
|
92
|
+
padding-left: 28px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.reader-content li {
|
|
96
|
+
margin-bottom: 8px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.reader-content blockquote {
|
|
100
|
+
margin: 24px 0;
|
|
101
|
+
padding: 16px 24px;
|
|
102
|
+
border-left: 4px solid var(--color-primary);
|
|
103
|
+
background-color: var(--color-surface);
|
|
104
|
+
font-style: italic;
|
|
105
|
+
color: var(--color-text-soft);
|
|
106
|
+
}
|
|
11
107
|
|
|
108
|
+
.reader-content blockquote p:last-child { margin-bottom: 0; }
|
|
109
|
+
|
|
110
|
+
.reader-content pre {
|
|
111
|
+
margin: 20px 0;
|
|
112
|
+
padding: 16px;
|
|
113
|
+
background-color: var(--color-surface);
|
|
114
|
+
border-radius: 6px;
|
|
115
|
+
overflow-x: auto;
|
|
116
|
+
font-size: 15px;
|
|
117
|
+
line-height: 1.5;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.reader-content code {
|
|
121
|
+
font-family: var(--mono);
|
|
122
|
+
font-size: 0.9em;
|
|
123
|
+
background-color: var(--color-surface);
|
|
124
|
+
padding: 2px 6px;
|
|
125
|
+
border-radius: 3px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.reader-content pre code {
|
|
129
|
+
background-color: transparent;
|
|
130
|
+
padding: 0;
|
|
131
|
+
font-size: 1em;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.reader-content img {
|
|
135
|
+
max-width: 100%;
|
|
136
|
+
height: auto;
|
|
137
|
+
margin: 24px 0;
|
|
138
|
+
border-radius: 4px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.reader-content a {
|
|
142
|
+
color: var(--color-primary);
|
|
143
|
+
text-decoration: none;
|
|
144
|
+
transition: color 0.15s ease;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.reader-content a:hover {
|
|
148
|
+
color: var(--color-primary-hover);
|
|
149
|
+
text-decoration: underline;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.reader-content hr {
|
|
153
|
+
border: 0;
|
|
154
|
+
border-top: 1px solid var(--color-border);
|
|
155
|
+
margin: 32px 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.reader-content table {
|
|
159
|
+
width: 100%;
|
|
160
|
+
border-collapse: collapse;
|
|
161
|
+
margin: 20px 0;
|
|
162
|
+
font-size: 17px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.reader-content th,
|
|
166
|
+
.reader-content td {
|
|
167
|
+
padding: 10px 14px;
|
|
168
|
+
border-bottom: 1px solid var(--color-border);
|
|
169
|
+
text-align: left;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.reader-content th {
|
|
173
|
+
font-weight: 600;
|
|
174
|
+
color: var(--color-text);
|
|
175
|
+
background-color: var(--color-surface);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.reader-content del {
|
|
179
|
+
color: var(--color-muted);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.reader-content kbd {
|
|
183
|
+
font-family: var(--mono);
|
|
184
|
+
font-size: 0.85em;
|
|
185
|
+
padding: 2px 6px;
|
|
186
|
+
border: 1px solid var(--color-border);
|
|
187
|
+
border-radius: 3px;
|
|
188
|
+
background-color: var(--color-surface);
|
|
189
|
+
}
|
|
190
|
+
</style>
|
|
12
191
|
</head>
|
|
13
192
|
<body>
|
|
14
|
-
|
|
193
|
+
<article class="reader-article">
|
|
194
|
+
<header class="reader-header">
|
|
195
|
+
<div class="reader-meta">{{ title }}</div>
|
|
196
|
+
</header>
|
|
197
|
+
<div class="reader-content">
|
|
198
|
+
{{ body }}
|
|
199
|
+
</div>
|
|
200
|
+
</article>
|
|
15
201
|
</body>
|
|
16
202
|
</html>
|
metadata
CHANGED
|
@@ -1,43 +1,57 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mdify
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Federico Builes
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-04-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: redcarpet
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - ~>
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '3.6'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - ~>
|
|
24
|
+
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '3.6'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: minitest
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
34
|
-
type: :
|
|
33
|
+
version: '5.20'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '5.20'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rake
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '13.0'
|
|
48
|
+
type: :development
|
|
35
49
|
prerelease: false
|
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
51
|
requirements:
|
|
38
|
-
- -
|
|
52
|
+
- - "~>"
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
54
|
+
version: '13.0'
|
|
41
55
|
description: mdify is a tool for previewing Markdown documents right in your browser,
|
|
42
56
|
with a nice stylesheet.
|
|
43
57
|
email: federico.builes@gmail.com
|
|
@@ -46,36 +60,33 @@ executables:
|
|
|
46
60
|
extensions: []
|
|
47
61
|
extra_rdoc_files: []
|
|
48
62
|
files:
|
|
49
|
-
- Gemfile
|
|
50
|
-
- Gemfile.lock
|
|
51
63
|
- README.md
|
|
52
|
-
- Rakefile
|
|
53
64
|
- bin/mdify
|
|
54
65
|
- lib/mdify.rb
|
|
55
66
|
- lib/mdify/renderer.rb
|
|
56
|
-
- mdify.
|
|
67
|
+
- lib/mdify/version.rb
|
|
57
68
|
- vendor/template.html
|
|
58
|
-
homepage:
|
|
59
|
-
licenses:
|
|
69
|
+
homepage: https://github.com/febuiles/mdify
|
|
70
|
+
licenses:
|
|
71
|
+
- MIT
|
|
60
72
|
metadata: {}
|
|
61
|
-
post_install_message:
|
|
73
|
+
post_install_message:
|
|
62
74
|
rdoc_options: []
|
|
63
75
|
require_paths:
|
|
64
76
|
- lib
|
|
65
77
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
78
|
requirements:
|
|
67
|
-
- -
|
|
79
|
+
- - ">="
|
|
68
80
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: '0'
|
|
81
|
+
version: '3.0'
|
|
70
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
83
|
requirements:
|
|
72
|
-
- -
|
|
84
|
+
- - ">="
|
|
73
85
|
- !ruby/object:Gem::Version
|
|
74
86
|
version: '0'
|
|
75
87
|
requirements: []
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
specification_version: 2
|
|
88
|
+
rubygems_version: 3.5.22
|
|
89
|
+
signing_key:
|
|
90
|
+
specification_version: 4
|
|
80
91
|
summary: Preview Markdown documents with your browser
|
|
81
92
|
test_files: []
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
mdify (1.0.1)
|
|
5
|
-
launchy
|
|
6
|
-
redcarpet (~> 1.9)
|
|
7
|
-
|
|
8
|
-
GEM
|
|
9
|
-
remote: http://rubygems.org/
|
|
10
|
-
specs:
|
|
11
|
-
addressable (2.2.6)
|
|
12
|
-
launchy (2.0.5)
|
|
13
|
-
addressable (~> 2.2.6)
|
|
14
|
-
redcarpet (1.17.2)
|
|
15
|
-
|
|
16
|
-
PLATFORMS
|
|
17
|
-
ruby
|
|
18
|
-
|
|
19
|
-
DEPENDENCIES
|
|
20
|
-
mdify!
|
data/Rakefile
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
require 'rubygems'
|
|
2
|
-
require 'rake'
|
|
3
|
-
require 'date'
|
|
4
|
-
# Generated with Rakegem (https://github.com/mojombo/rakegem/)
|
|
5
|
-
#############################################################################
|
|
6
|
-
#
|
|
7
|
-
# Helper functions
|
|
8
|
-
#
|
|
9
|
-
#############################################################################
|
|
10
|
-
|
|
11
|
-
def name
|
|
12
|
-
@name ||= Dir['*.gemspec'].first.split('.').first
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def version
|
|
16
|
-
line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
|
|
17
|
-
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def date
|
|
21
|
-
Date.today.to_s
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def rubyforge_project
|
|
25
|
-
name
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def gemspec_file
|
|
29
|
-
"#{name}.gemspec"
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def gem_file
|
|
33
|
-
"#{name}-#{version}.gem"
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def replace_header(head, header_name)
|
|
37
|
-
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
#############################################################################
|
|
41
|
-
#
|
|
42
|
-
# Standard tasks
|
|
43
|
-
#
|
|
44
|
-
#############################################################################
|
|
45
|
-
|
|
46
|
-
task :default => :test
|
|
47
|
-
|
|
48
|
-
require 'rake/testtask'
|
|
49
|
-
Rake::TestTask.new(:test) do |test|
|
|
50
|
-
test.libs << 'lib' << 'test'
|
|
51
|
-
test.pattern = 'test/**/test_*.rb'
|
|
52
|
-
test.verbose = true
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
desc "Open an irb session preloaded with this library"
|
|
56
|
-
task :console do
|
|
57
|
-
sh "irb -rubygems -r ./lib/#{name}.rb"
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
#############################################################################
|
|
61
|
-
#
|
|
62
|
-
# Packaging tasks
|
|
63
|
-
#
|
|
64
|
-
#############################################################################
|
|
65
|
-
|
|
66
|
-
desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
|
|
67
|
-
task :release => :build do
|
|
68
|
-
unless `git branch` =~ /^\* master$/
|
|
69
|
-
puts "You must be on the master branch to release!"
|
|
70
|
-
exit!
|
|
71
|
-
end
|
|
72
|
-
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
|
73
|
-
sh "git tag v#{version}"
|
|
74
|
-
sh "git push origin master"
|
|
75
|
-
sh "git push origin v#{version}"
|
|
76
|
-
sh "gem push pkg/#{name}-#{version}.gem"
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
desc "Build #{gem_file} into the pkg directory"
|
|
80
|
-
task :build => :gemspec do
|
|
81
|
-
sh "mkdir -p pkg"
|
|
82
|
-
sh "gem build #{gemspec_file}"
|
|
83
|
-
sh "mv #{gem_file} pkg"
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
desc "Generate #{gemspec_file}"
|
|
87
|
-
task :gemspec => :validate do
|
|
88
|
-
# read spec file and split out manifest section
|
|
89
|
-
spec = File.read(gemspec_file)
|
|
90
|
-
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
|
91
|
-
|
|
92
|
-
# replace name version and date
|
|
93
|
-
replace_header(head, :name)
|
|
94
|
-
replace_header(head, :version)
|
|
95
|
-
replace_header(head, :date)
|
|
96
|
-
#comment this out if your rubyforge_project has a different name
|
|
97
|
-
replace_header(head, :rubyforge_project)
|
|
98
|
-
|
|
99
|
-
# determine file list from git ls-files
|
|
100
|
-
files = `git ls-files`.
|
|
101
|
-
split("\n").
|
|
102
|
-
sort.
|
|
103
|
-
reject { |file| file =~ /^\./ }.
|
|
104
|
-
reject { |file| file =~ /^(rdoc|pkg)/ }.
|
|
105
|
-
map { |file| " #{file}" }.
|
|
106
|
-
join("\n")
|
|
107
|
-
|
|
108
|
-
# piece file back together and write
|
|
109
|
-
manifest = " s.files = %w[\n#{files}\n ]\n"
|
|
110
|
-
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
|
|
111
|
-
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
|
112
|
-
puts "Updated #{gemspec_file}"
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
desc "Validate #{gemspec_file}"
|
|
116
|
-
task :validate do
|
|
117
|
-
libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}"]
|
|
118
|
-
unless libfiles.empty?
|
|
119
|
-
puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
|
|
120
|
-
exit!
|
|
121
|
-
end
|
|
122
|
-
unless Dir['VERSION*'].empty?
|
|
123
|
-
puts "A `VERSION` file at root level violates Gem best practices."
|
|
124
|
-
exit!
|
|
125
|
-
end
|
|
126
|
-
end
|
data/mdify.gemspec
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
Gem::Specification.new do |s|
|
|
2
|
-
s.specification_version = 2 if s.respond_to? :specification_version=
|
|
3
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
4
|
-
s.rubygems_version = '1.3.5'
|
|
5
|
-
|
|
6
|
-
## Leave these as is they will be modified for you by the rake gemspec task.
|
|
7
|
-
## If your rubyforge_project name is different, then edit it and comment out
|
|
8
|
-
## the sub! line in the Rakefile
|
|
9
|
-
s.name = 'mdify'
|
|
10
|
-
s.version = '1.1.0'
|
|
11
|
-
s.date = '2016-01-19'
|
|
12
|
-
s.rubyforge_project = 'mdify'
|
|
13
|
-
|
|
14
|
-
## Make sure your summary is short. The description may be as long
|
|
15
|
-
## as you like.
|
|
16
|
-
s.summary = "Preview Markdown documents with your browser"
|
|
17
|
-
s.description = "mdify is a tool for previewing Markdown documents right in your browser, with a nice stylesheet."
|
|
18
|
-
|
|
19
|
-
## List the primary authors. If there are a bunch of authors, it's probably
|
|
20
|
-
## better to set the email to an email list or something. If you don't have
|
|
21
|
-
## a custom homepage, consider using your GitHub URL or the like.
|
|
22
|
-
s.authors = ["Federico Builes"]
|
|
23
|
-
s.email = 'federico.builes@gmail.com'
|
|
24
|
-
s.homepage = 'http://github.com/febuiles/mdify'
|
|
25
|
-
|
|
26
|
-
## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
|
|
27
|
-
## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
|
|
28
|
-
s.require_paths = %w[lib]
|
|
29
|
-
|
|
30
|
-
## If your gem includes any executables, list them here.
|
|
31
|
-
s.executables = ["mdify"]
|
|
32
|
-
|
|
33
|
-
## List your runtime dependencies here. Runtime dependencies are those
|
|
34
|
-
## that are needed for an end user to actually USE your code.
|
|
35
|
-
s.add_dependency("redcarpet", "~> 1.9")
|
|
36
|
-
s.add_dependency("launchy")
|
|
37
|
-
|
|
38
|
-
## List your development dependencies here. Development dependencies are
|
|
39
|
-
## those that are only needed during development
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## Leave this section as-is. It will be automatically generated from the
|
|
43
|
-
## contents of your Git repository via the gemspec task. DO NOT REMOVE
|
|
44
|
-
## THE MANIFEST COMMENTS, they are used as delimiters by the task.
|
|
45
|
-
# = MANIFEST =
|
|
46
|
-
s.files = %w[
|
|
47
|
-
Gemfile
|
|
48
|
-
Gemfile.lock
|
|
49
|
-
README.md
|
|
50
|
-
Rakefile
|
|
51
|
-
bin/mdify
|
|
52
|
-
lib/mdify.rb
|
|
53
|
-
lib/mdify/renderer.rb
|
|
54
|
-
mdify.gemspec
|
|
55
|
-
vendor/template.html
|
|
56
|
-
]
|
|
57
|
-
# = MANIFEST =
|
|
58
|
-
|
|
59
|
-
## Test files will be grabbed from the file list. Make sure the path glob
|
|
60
|
-
## matches what you actually use.
|
|
61
|
-
s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
|
|
62
|
-
end
|