enwrite 0.2.2 → 0.2.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
  SHA1:
3
- metadata.gz: 76e561f6fecc0e5374becc2555e60f9c19a2edff
4
- data.tar.gz: 110b88c65b25e095ba62156e61fc110e58da43ce
3
+ metadata.gz: ab868ce535c913c7f1bda420ccc50ea9e8c8629a
4
+ data.tar.gz: a53cf60fcfea16cb3f3aac2816966c507bde662e
5
5
  SHA512:
6
- metadata.gz: 7d18acb5bb0a196020a17dc04fcb44b15303cb68a8daac2dab423d51cfb96bf1b39387aa81f02d453fbc23a5b0ff6af07f576b73f4708602d5bf1675899d71b3
7
- data.tar.gz: 86739fbafadc94d1494663b3af5afdb325e9911333fad9adaf4e07cf22a4a34dfd1ebfb89bab6d5308312643f6d10325e13d455978483dfcd49940d1f7be9fa9
6
+ metadata.gz: b973cf1e94be664f7155636dc3621009f15ef3907727a0541e5f93a0cdc2066eb24a1de997169a35308b631d0ad5ef24a96659870a660b644c47fecbf4e30915
7
+ data.tar.gz: 1eec8e7fd2222e735878bd3383261a7e42b0f7c71734ab5f3d2aa72a5d8b0ab8372c2f2843179973d3882c34a89f595f1df22e3a857ca553b23a6ef50aeacec7
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Enwrite
1
+ # Enwrite [![Gem Version](https://badge.fury.io/rb/enwrite.svg)](http://badge.fury.io/rb/enwrite)
2
2
 
3
3
  > What wild heart-histories seemed to lie enwritten<br/>
4
4
  > Upon those crystalline, celestial spheres!
@@ -86,10 +86,6 @@ selected notes:
86
86
  - `page`: publish the note as a page instead of a blog post.
87
87
  - `post` (or none): publish the note as a blog post. This is the
88
88
  default.
89
- - `_home`: set this page as the default for the site. This is
90
- dependent on the Hugo theme being used.
91
- - `_mainmenu`: add this page to the top-level navigation menu. This is
92
- dependent on the Hugo theme being used.
93
89
  - `markdown`: store the note as Markdown instead of HTML. Markdown
94
90
  notes can still contain images or other formatting, this will be left
95
91
  untouched inside the Markdown file.
@@ -109,6 +105,19 @@ default.
109
105
  attachments are stored under the Hugo output directory. `.tar.gz`
110
106
  files will be unpacked under that directory, all others will be
111
107
  stored as-is.
108
+
109
+ Any of these special tags are removed from the post before publishing
110
+ (you can configure additional ones with the `--remove-tags`
111
+ option). All other tags are passed through to the produced posts. Of
112
+ course, you could have some of those tags also trigger special
113
+ behavior within the output system. For example, my
114
+ [custom Hugo theme](https://github.com/zzamboni/new/tree/master/themes/hyde-x-zzamboni)
115
+ recognizes the following tags:
116
+
117
+ - `_home`: set this page as the default for the site. This is
118
+ dependent on the Hugo theme being used.
119
+ - `_mainmenu`: add this page to the top-level navigation menu. This is
120
+ dependent on the Hugo theme being used.
112
121
 
113
122
  ## Shortcuts
114
123
 
@@ -125,7 +134,11 @@ Embed gist:
125
134
 
126
135
  [gist url="https://gist.github.com/zzamboni/843142d3f759e582fe8f"]
127
136
 
128
- ## Bugs, feedback or other issues?
137
+ ## Planned features/fixes
138
+
139
+ https://github.com/zzamboni/enwrite/labels/enhancement
140
+
141
+ ## Bugs, feature requests, feedback or other issues?
129
142
 
130
143
  Please open a
131
144
  [Github issue](https://github.com/zzamboni/enwrite/issues).
data/Rakefile CHANGED
@@ -19,9 +19,7 @@ Jeweler::Tasks.new do |gem|
19
19
  gem.homepage = "http://github.com/zzamboni/enwrite"
20
20
  gem.license = "MIT"
21
21
  gem.summary = %Q{Enwrite: Power a web site using Evernote}
22
- gem.description = %Q{Enwrite allows you to generate a website from contents stored in Evernote.
23
- At the moment only Hugo (http://gohugo.io) is supported as an output format,
24
- but others can be added through plugins.}
22
+ gem.description = %Q{Enwrite allows you to generate a website from content stored in Evernote.}
25
23
  gem.email = "diego@zzamboni.org"
26
24
  gem.authors = ["Diego Zamboni"]
27
25
  # dependencies defined in Gemfile
@@ -4,7 +4,6 @@
4
4
  # enwrite - power a web site using Evernote
5
5
  #
6
6
  # Diego Zamboni, March 2015
7
- # Time-stamp: <2015-04-28 13:26:56 diego>
8
7
 
9
8
  require 'enwrite'
10
9
 
@@ -2,17 +2,17 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: enwrite 0.2.2 ruby lib
5
+ # stub: enwrite 0.2.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "enwrite"
9
- s.version = "0.2.2"
9
+ s.version = "0.2.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Diego Zamboni"]
14
- s.date = "2015-04-30"
15
- s.description = "Enwrite allows you to generate a website from contents stored in Evernote.\nAt the moment only Hugo (http://gohugo.io) is supported as an output format,\nbut others can be added through plugins."
14
+ s.date = "2015-05-15"
15
+ s.description = "Enwrite allows you to generate a website from content stored in Evernote."
16
16
  s.email = "diego@zzamboni.org"
17
17
  s.executables = ["enwrite"]
18
18
  s.extra_rdoc_files = [
@@ -3,7 +3,6 @@
3
3
  # ENML Processing class
4
4
  #
5
5
  # Diego Zamboni, March 2015
6
- # Time-stamp: <2015-04-30 00:45:35 diego>
7
6
 
8
7
  require 'digest'
9
8
  require 'htmlentities'
@@ -4,7 +4,6 @@
4
4
  # enwrite - power a web site using Evernote
5
5
  #
6
6
  # Diego Zamboni, March 2015
7
- # Time-stamp: <2015-04-30 16:52:56 diego>
8
7
 
9
8
  require 'rubygems'
10
9
 
@@ -23,7 +22,7 @@ class Enwrite
23
22
  module Version
24
23
  MAJOR = 0
25
24
  MINOR = 2
26
- PATCH = 2
25
+ PATCH = 3
27
26
 
28
27
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
29
28
  end
@@ -165,7 +164,12 @@ class Enwrite
165
164
  verbose "Current update count for the account: #{currentUpdateCount}"
166
165
 
167
166
  if (currentUpdateCount > latestUpdateCount)
168
- msg "Reading #{options.rebuild_all ? 'all' : 'updated'} notes that match #{searchexp}"
167
+ msg "Checking updated Evernote contents..."
168
+
169
+ # There are new notes, doesn't necessarily mean any of them are withing the
170
+ # selected content, so we keep track of whether we actually produce any updates
171
+ # in the output.
172
+ something_updated = false
169
173
 
170
174
  filter = Evernote::EDAM::NoteStore::NoteFilter.new
171
175
  filter.words = searchexp
@@ -259,6 +263,7 @@ class Enwrite
259
263
  end
260
264
  end
261
265
  end
266
+ something_updated = true
262
267
  results.notes.delete(filesnotemd)
263
268
  results.totalNotes -= 1
264
269
  }
@@ -277,10 +282,13 @@ class Enwrite
277
282
  note.tagNames = note.tagNames - options.removetags
278
283
  # This either creates or deletes posts as appropriate
279
284
  writer.output_note(note)
285
+ something_updated = true
280
286
  end
281
287
  # Persist the latest updatecount for next time
282
288
  setconfig(updatecount_index, currentUpdateCount)
289
+ end
283
290
 
291
+ if something_updated
284
292
  exit 0
285
293
  else
286
294
  msg "No updated notes that match #{searchexp}"
@@ -2,7 +2,6 @@
2
2
  # Evernote access utilities
3
3
  #
4
4
  # Diego Zamboni, March 2015
5
- # Time-stamp: <2015-04-30 16:30:27 diego>
6
5
 
7
6
  # Load libraries required by the Evernote OAuth
8
7
  require 'oauth'
@@ -1,9 +1,7 @@
1
1
  # Base class to output pages
2
2
  #
3
3
  # Diego Zamboni, March 2015
4
- # Time-stamp: <2015-03-29 00:51:04 diego>
5
4
 
6
5
  class Output
7
- def output_note(metadata, note)
8
- end
6
+ # Just in case we need some base behavior later for output plugins.
9
7
  end
@@ -2,7 +2,6 @@
2
2
  # Output class for Hugo
3
3
  #
4
4
  # Diego Zamboni, March 2015
5
- # Time-stamp: <2015-04-30 12:40:31 diego>
6
5
 
7
6
  require 'output'
8
7
  require 'filters'
@@ -3,24 +3,28 @@ require 'colorize'
3
3
 
4
4
  # Message output
5
5
 
6
+ def now
7
+ Time.now.strftime "%Y-%m-%d %H:%M:%S %Z %Y"
8
+ end
9
+
6
10
  def verbose(msg)
7
- puts ("Enwrite [VERBOSE]: " + msg).blue if $enwrite_verbose
11
+ puts ("#{now} Enwrite [VERBOSE]: " + msg).blue if $enwrite_verbose
8
12
  end
9
13
 
10
14
  def debug(msg)
11
- puts ("Enwrite [DEBUG]: " + msg) if $enwrite_debug
15
+ puts ("#{now} Enwrite [DEBUG]: " + msg) if $enwrite_debug
12
16
  end
13
17
 
14
18
  def error(msg)
15
- $stderr.puts ("Enwrite [ERROR]: " + msg).red
19
+ $stderr.puts ("#{now} Enwrite [ERROR]: " + msg).red
16
20
  end
17
21
 
18
22
  def msg(msg)
19
- puts ("Enwrite [INFO]: " + msg).green
23
+ puts ("#{now} Enwrite [INFO]: " + msg).green
20
24
  end
21
25
 
22
26
  def warn(msg)
23
- $stderr.puts ("Enwrite [WARN]: " + msg).light_yellow
27
+ $stderr.puts ("#{now} Enwrite [WARN]: " + msg).light_yellow
24
28
  end
25
29
 
26
30
  # Config file storage
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Zamboni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2015-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -122,10 +122,7 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '2.0'
125
- description: |-
126
- Enwrite allows you to generate a website from contents stored in Evernote.
127
- At the moment only Hugo (http://gohugo.io) is supported as an output format,
128
- but others can be added through plugins.
125
+ description: Enwrite allows you to generate a website from content stored in Evernote.
129
126
  email: diego@zzamboni.org
130
127
  executables:
131
128
  - enwrite