clix.publish_atom: Set type attribute on title, summary and content from --FIELD-type arguments

Tue, 08 Oct 2013 14:45:07 +0200

author
Kim Alvefur <zash@zash.se>
date
Tue, 08 Oct 2013 14:45:07 +0200
changeset 119
d2cb5800ab27
parent 118
8bb289b2b7be
child 120
3456a6088dc6

clix.publish_atom: Set type attribute on title, summary and content from --FIELD-type arguments

clix/publish_atom.lua file | annotate | diff | comparison | revisions
--- a/clix/publish_atom.lua	Fri Jul 12 04:16:46 2013 +0200
+++ b/clix/publish_atom.lua	Tue Oct 08 14:45:07 2013 +0200
@@ -25,16 +25,16 @@
 		local entry_id = opts.id or new_uuid();
 		local atom_entry = verse.stanza("entry", { xmlns = xmlns_atom})
 			:tag("id"):text(entry_id):up()
-			:tag("title"):text(opts.title or ""):up()
+			:tag("title", { type = opts["title-type"] }):text(opts.title or ""):up()
 			:tag("updated"):text(opts.updated or datetime()):up();
 		atom_entry:tag("author"):tag("name"):text(opts.author or os.getenv("USER") or "Unknown author"):up();
 		atom_entry:up();
 		if opts.summary then
-			atom_entry:tag("summary"):text(opts.summary):up();
+			atom_entry:tag("summary", { type = opts["summary-type"] }):text(opts.summary):up();
 		end
 
 		if opts.content then
-			atom_entry:tag("content"):text(opts.content):up();
+			atom_entry:tag("content", { type = opts["content-type"] }):text(opts.content):up();
 		end
 
 		for opt, optval in pairs(opts) do

mercurial