enwrite 0.2.1 → 0.2.2
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 +4 -4
- data/README.md +42 -1
- data/enwrite.gemspec +2 -2
- data/lib/enwrite.rb +3 -2
- data/lib/evernote-utils.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76e561f6fecc0e5374becc2555e60f9c19a2edff
|
4
|
+
data.tar.gz: 110b88c65b25e095ba62156e61fc110e58da43ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d18acb5bb0a196020a17dc04fcb44b15303cb68a8daac2dab423d51cfb96bf1b39387aa81f02d453fbc23a5b0ff6af07f576b73f4708602d5bf1675899d71b3
|
7
|
+
data.tar.gz: 86739fbafadc94d1494663b3af5afdb325e9911333fad9adaf4e07cf22a4a34dfd1ebfb89bab6d5308312643f6d10325e13d455978483dfcd49940d1f7be9fa9
|
data/README.md
CHANGED
@@ -60,7 +60,9 @@ Populate it with contents from Evernote:
|
|
60
60
|
-v, --debug Debug output mode
|
61
61
|
--version Show version
|
62
62
|
-h, --help Shows this help message
|
63
|
-
|
63
|
+
|
64
|
+
## Sample usage
|
65
|
+
|
64
66
|
Generate posts from all notes tagged `published` in notebook
|
65
67
|
`my_notebook`:
|
66
68
|
|
@@ -76,6 +78,40 @@ Images, audio and video are embedded in the generated posts (audio
|
|
76
78
|
and video are done using HTML5 `<audio>` and `<video>` tags). Other
|
77
79
|
file types are stored and linked to with their filename.
|
78
80
|
|
81
|
+
## Special tags
|
82
|
+
|
83
|
+
The following tags trigger special behavior if found within the
|
84
|
+
selected notes:
|
85
|
+
|
86
|
+
- `page`: publish the note as a page instead of a blog post.
|
87
|
+
- `post` (or none): publish the note as a blog post. This is the
|
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
|
+
- `markdown`: store the note as Markdown instead of HTML. Markdown
|
94
|
+
notes can still contain images or other formatting, this will be left
|
95
|
+
untouched inside the Markdown file.
|
96
|
+
- `_enwrite_config`: the contents of the note must be in YAML format
|
97
|
+
and contain configuration parameters to Enwrite (more documentation
|
98
|
+
about this will be written soon). For example, if you wanted blog
|
99
|
+
posts to be stored in the Hugo `blog` category instead of `post`,
|
100
|
+
you could include this:
|
101
|
+
```
|
102
|
+
hugo:
|
103
|
+
tag_to_type:
|
104
|
+
default: blog/
|
105
|
+
post: blog/
|
106
|
+
page:
|
107
|
+
```
|
108
|
+
- `_enwrite_files_hugo`: text in these notes is ignored, but any
|
109
|
+
attachments are stored under the Hugo output directory. `.tar.gz`
|
110
|
+
files will be unpacked under that directory, all others will be
|
111
|
+
stored as-is.
|
112
|
+
|
113
|
+
## Shortcuts
|
114
|
+
|
79
115
|
The following shortcuts are recognized:
|
80
116
|
|
81
117
|
Embed Youtube video by URL or ID. You can optionally specify `width`
|
@@ -88,3 +124,8 @@ and `height`. All arguments must be enclosed in double quotes.
|
|
88
124
|
Embed gist:
|
89
125
|
|
90
126
|
[gist url="https://gist.github.com/zzamboni/843142d3f759e582fe8f"]
|
127
|
+
|
128
|
+
## Bugs, feedback or other issues?
|
129
|
+
|
130
|
+
Please open a
|
131
|
+
[Github issue](https://github.com/zzamboni/enwrite/issues).
|
data/enwrite.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
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.
|
5
|
+
# stub: enwrite 0.2.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "enwrite"
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.2"
|
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"]
|
data/lib/enwrite.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# enwrite - power a web site using Evernote
|
5
5
|
#
|
6
6
|
# Diego Zamboni, March 2015
|
7
|
-
# Time-stamp: <2015-04-30 16:
|
7
|
+
# Time-stamp: <2015-04-30 16:52:56 diego>
|
8
8
|
|
9
9
|
require 'rubygems'
|
10
10
|
|
@@ -16,13 +16,14 @@ require "ostruct"
|
|
16
16
|
require 'util'
|
17
17
|
require 'yaml'
|
18
18
|
require 'deep_merge'
|
19
|
+
require 'tempfile'
|
19
20
|
|
20
21
|
class Enwrite
|
21
22
|
PLUGINS = %w[hugo]
|
22
23
|
module Version
|
23
24
|
MAJOR = 0
|
24
25
|
MINOR = 2
|
25
|
-
PATCH =
|
26
|
+
PATCH = 2
|
26
27
|
|
27
28
|
STRING = [MAJOR, MINOR, PATCH].compact.join('.')
|
28
29
|
end
|
data/lib/evernote-utils.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# Evernote access utilities
|
3
3
|
#
|
4
4
|
# Diego Zamboni, March 2015
|
5
|
-
# Time-stamp: <2015-04-16
|
5
|
+
# Time-stamp: <2015-04-30 16:30:27 diego>
|
6
6
|
|
7
7
|
# Load libraries required by the Evernote OAuth
|
8
8
|
require 'oauth'
|
@@ -59,7 +59,7 @@ then enwrite will use it automatically in the future.
|
|
59
59
|
print "Would you like me to do that for you now (Y/n)? "
|
60
60
|
$stdout.flush
|
61
61
|
yesno = gets.chomp
|
62
|
-
if yesno =~ /^[yY]
|
62
|
+
if yesno =~ /^([yY].*|)$/
|
63
63
|
setconfig(:evernote_auth_token, access_token.token)
|
64
64
|
puts "Token stored."
|
65
65
|
else
|