mdify 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15c8dae4e789eec972f8c5ef455dc63155e93f63984c2427cab2d6411679a361
4
- data.tar.gz: c7926861ce23542198b59dc86c29ea4c53dbc69c4d68fbd915c4bf3de9ffd7e7
3
+ metadata.gz: f220feaa264d0b22ea559579cfc39e8b4665e8365f307c7f1cf6728c95223e27
4
+ data.tar.gz: ba2929428bca142ef82ea8b493f2bfe386064e5e99f4e34a127902b22fafadf7
5
5
  SHA512:
6
- metadata.gz: ccf29107ed7fccac12d83c0780f378e10ea06559b51c598d87a675dca75b7ee17276f60e31b006b56c03f0740bf75e5ca78924f93b84df96eacc8b3b40d99182
7
- data.tar.gz: 71b83c49acdeaf73a03bef93a27fd50c847de2cc32af86c301245cbbe6acff03a7e96787e9cebadff42b893ef8cf4a1519993358f1788a69fc9e624cb21e0150
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 right in your browser, with a nice stylesheet.
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
- ![Screenshot of mdify](http://i.imgur.com/OiRr5.png)
6
+ ![Screenshot of mdify](screenshot.png)
6
7
 
7
8
  Usage
8
9
  -----
9
- You can use it on your documents by running:
10
+ ```
11
+ mdify super_secret.md
12
+ ```
10
13
 
11
- mdify super_secret.md
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
- The installation requires Ruby 1.8.7 or greater.
17
+ ----------
18
+ Requires Ruby 3.0 or newer.
18
19
 
19
- gem install mdify
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's run by pressing a
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
- Now you can press F5 inside any Markdown document to automatically preview it in your browser.
28
+ Bind the compile key:
37
29
 
38
- If you are using RVM to manage your rubies then you will need to instruct Emacs to play nice with
39
- it. To do this:
30
+ ```elisp
31
+ (global-set-key [f5] 'compile)
32
+ ```
40
33
 
41
- 1. Download [rvm.el](https://github.com/senny/rvm.el) and save it in your Emacs load path.
42
- 2. Require it and set your Ruby version:
34
+ Then add a hook for Markdown mode:
43
35
 
44
- `(require 'rvm)`
45
-
46
- `(rvm-use-default)`
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
- 3. You should now be able to use the hook mentioned above.
42
+ Now F5 inside any Markdown document previews it in your browser.
49
43
 
50
44
  Stylesheet
51
- ----
52
- The pretty styles are provided by Twitter's [Bootstrap](http://twitter.github.com/bootstrap/)
53
- library. Right now there's no support for custom stylesheets but feel free to open an issue or
54
- create a pull request if you want to add something else.
55
-
56
- Farewell
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 'rubygems'
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
- require 'mdify'
4
+ lib_dir = File.expand_path("../lib", __dir__)
5
+ $LOAD_PATH.unshift(lib_dir) if File.directory?(lib_dir)
7
6
 
8
- def print_usage
9
- puts "usage: mdify file"
10
- exit(-1)
11
- end
7
+ require "mdify"
12
8
 
13
- print_usage if ARGV.empty?
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
- file = ARGV.first
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 File.exists?(file)
18
- Mdify.preview(file)
19
- else
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)
@@ -1,38 +1,48 @@
1
1
  module Mdify
2
- HTML_TEMPLATE_PATH = File.join(File.dirname(__FILE__), "..", "..", "vendor", "template.html")
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 = filename.split("/").last
18
+ @title = File.basename(filename)
9
19
  @content = File.read(filename)
10
20
  end
11
21
 
12
22
  def render
13
- html = Redcarpet.new(@content).to_html
23
+ markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, MARKDOWN_OPTIONS)
24
+ html = markdown.render(@content)
14
25
  document = render_html(@title, html)
15
- temp_file = create_temp_file(document)
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
- template_file = File.read(HTML_TEMPLATE_PATH)
27
- document = template_file.sub(/\{\{ title \}\}/, title)
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 create_temp_file(contents)
32
- temp_file = Tempfile.new("mdify")
33
- temp_file.write(contents)
34
- temp_file.close
35
- temp_file.path
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
@@ -0,0 +1,3 @@
1
+ module Mdify
2
+ VERSION = "2.0.0"
3
+ end
data/lib/mdify.rb CHANGED
@@ -1,13 +1,10 @@
1
- require 'rubygems'
2
- require 'tempfile'
3
- require 'redcarpet'
4
- require 'launchy'
1
+ require "tmpdir"
2
+ require "redcarpet"
5
3
 
6
- require 'mdify/renderer'
4
+ require "mdify/version"
5
+ require "mdify/renderer"
7
6
 
8
7
  module Mdify
9
- VERSION = "1.2.0"
10
-
11
8
  def self.preview(filename)
12
9
  Renderer.new(filename).render
13
10
  end
data/vendor/template.html CHANGED
@@ -1,9 +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>
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">
10
+ <style>
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
+ }
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>
5
191
  </head>
6
192
  <body>
7
- {{ body }}
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>
8
201
  </body>
9
202
  </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Builes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-16 00:00:00.000000000 Z
11
+ date: 2026-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet
@@ -16,28 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
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: '1.9'
26
+ version: '3.6'
27
27
  - !ruby/object:Gem::Dependency
28
- name: launchy
28
+ name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
34
- type: :runtime
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: '2.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,16 +60,13 @@ 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.gemspec
67
+ - lib/mdify/version.rb
57
68
  - vendor/template.html
58
- homepage: http://github.com/febuiles/mdify
69
+ homepage: https://github.com/febuiles/mdify
59
70
  licenses:
60
71
  - MIT
61
72
  metadata: {}
@@ -67,15 +78,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
67
78
  requirements:
68
79
  - - ">="
69
80
  - !ruby/object:Gem::Version
70
- version: '0'
81
+ version: '3.0'
71
82
  required_rubygems_version: !ruby/object:Gem::Requirement
72
83
  requirements:
73
84
  - - ">="
74
85
  - !ruby/object:Gem::Version
75
86
  version: '0'
76
87
  requirements: []
77
- rubygems_version: 3.1.2
88
+ rubygems_version: 3.5.22
78
89
  signing_key:
79
- specification_version: 2
90
+ specification_version: 4
80
91
  summary: Preview Markdown documents with your browser
81
92
  test_files: []
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source "http://rubygems.org"
2
- gemspec
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,61 +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.2.0'
11
- s.date = '2020-12-16'
12
- s.licenses = ['MIT']
13
- ## Make sure your summary is short. The description may be as long
14
- ## as you like.
15
- s.summary = "Preview Markdown documents with your browser"
16
- s.description = "mdify is a tool for previewing Markdown documents right in your browser, with a nice stylesheet."
17
-
18
- ## List the primary authors. If there are a bunch of authors, it's probably
19
- ## better to set the email to an email list or something. If you don't have
20
- ## a custom homepage, consider using your GitHub URL or the like.
21
- s.authors = ["Federico Builes"]
22
- s.email = 'federico.builes@gmail.com'
23
- s.homepage = 'http://github.com/febuiles/mdify'
24
-
25
- ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
26
- ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
27
- s.require_paths = %w[lib]
28
-
29
- ## If your gem includes any executables, list them here.
30
- s.executables = ["mdify"]
31
-
32
- ## List your runtime dependencies here. Runtime dependencies are those
33
- ## that are needed for an end user to actually USE your code.
34
- s.add_dependency("redcarpet", "~> 1.9")
35
- s.add_dependency("launchy", "~> 2.0")
36
-
37
- ## List your development dependencies here. Development dependencies are
38
- ## those that are only needed during development
39
-
40
-
41
- ## Leave this section as-is. It will be automatically generated from the
42
- ## contents of your Git repository via the gemspec task. DO NOT REMOVE
43
- ## THE MANIFEST COMMENTS, they are used as delimiters by the task.
44
- # = MANIFEST =
45
- s.files = %w[
46
- Gemfile
47
- Gemfile.lock
48
- README.md
49
- Rakefile
50
- bin/mdify
51
- lib/mdify.rb
52
- lib/mdify/renderer.rb
53
- mdify.gemspec
54
- vendor/template.html
55
- ]
56
- # = MANIFEST =
57
-
58
- ## Test files will be grabbed from the file list. Make sure the path glob
59
- ## matches what you actually use.
60
- s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
61
- end