lib/controllers/generate.rb in evertils-0.3.3 vs lib/controllers/generate.rb in evertils-0.3.4
- old
+ new
@@ -34,21 +34,21 @@
end
# generate daily notes
def daily
title = @format.date_templates[NOTEBOOK_DAILY]
- body = @format.template_contents
+ body = @format.template_contents(NOTEBOOK_DAILY)
body += to_enml($config.custom_sections[NOTEBOOK_DAILY]) unless $config.custom_sections.nil?
parent_notebook = NOTEBOOK_DAILY
@model.create_note(title: title, body: body, parent_notebook: parent_notebook)
end
# generate weekly notes
def weekly
title = @format.date_templates[NOTEBOOK_WEEKLY]
- body = @format.template_contents
+ body = @format.template_contents(NOTEBOOK_WEEKLY)
body += to_enml($config.custom_sections[NOTEBOOK_WEEKLY]) unless $config.custom_sections.nil?
parent_notebook = NOTEBOOK_WEEKLY
if !@force
if !Date.today.monday?
@@ -64,11 +64,11 @@
end
# generate monthly notes
def monthly
title = @format.date_templates[NOTEBOOK_MONTHLY]
- body = @format.template_contents
+ body = @format.template_contents(NOTEBOOK_MONTHLY)
body += to_enml($config.custom_sections[NOTEBOOK_MONTHLY]) unless $config.custom_sections.nil?
parent_notebook = NOTEBOOK_MONTHLY
note = @model.create_note(title: title, body: body, parent_notebook: parent_notebook)
@@ -80,11 +80,11 @@
# generate monthly task summary templates
def mts
Notify.error("Name argument is required", {}) if @name.nil?
title = "#{@name} #{DateTime.now.strftime('%m-%Y')}"
- body = @format.template_contents
+ body = @format.template_contents(NOTEBOOK_MTS)
body += to_enml($config.custom_sections[NOTEBOOK_MTS]) unless $config.custom_sections.nil?
parent_notebook = NOTEBOOK_MTS
# create the note from template
mts_note = @model.create_note(title: title, body: body, parent_notebook: parent_notebook)
@@ -101,23 +101,30 @@
end
# generate priority queue notes
def pq
title = @format.date_templates[NOTEBOOK_PRIORITY_QUEUE]
- body = @format.template_contents
+ body = @format.template_contents(NOTEBOOK_PRIORITY_QUEUE)
body += to_enml($config.custom_sections[NOTEBOOK_PRIORITY_QUEUE]) unless $config.custom_sections.nil?
parent_notebook = NOTEBOOK_PRIORITY_QUEUE
- note = @model.create_note(title: title, body: body, parent_notebook: parent_notebook)
+ @model.create_note(title: title, body: body, parent_notebook: parent_notebook)
end
+ # creates the notes required to start the day
+ # - priority queue
+ # - daily
+ def morning
+ pq
+ daily
+ end
+
private
#
# @since 0.3.1
def to_enml(hash)
Evertils::Helper::EvernoteENML.with_list(hash)
end
-
end
end
end