From f63463bc9e742862be3f3998e6113a90dcec25ca Mon Sep 17 00:00:00 2001 From: kriss Date: Sat, 6 Jan 2024 15:08:31 +0000 Subject: [PATCH] microblog creation --- js/cmd.js | 10 ++++++++++ js/plated.js | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/js/cmd.js b/js/cmd.js index e067b9a9..61389b24 100644 --- a/js/cmd.js +++ b/js/cmd.js @@ -151,6 +151,12 @@ if( argv._[0]=="blog" ) var plated=require("./plated.js").create(argv); return await plated.blog(); } +else +if( argv._[0]=="micro" ) +{ + var plated=require("./plated.js").create(argv); + return await plated.micro(); +} // help text console.log( @@ -174,6 +180,10 @@ console.log( "\tCreate an empty blogpost with todays date and the given title in the source blog directory.\n"+ "\t\t--blog=blog -- choose the blog folder. \n"+ "\t\t...same options as build\n"+ + "> plated micro I had buttered scones for tea. \n"+ + "\tCreate a microblogpost with todays date-time and the given text as markdown content.\n"+ + "\t\t--blog=blog -- choose the blog folder. \n"+ + "\t\t...same options as build\n"+ "\n"+ ""); diff --git a/js/plated.js b/js/plated.js index a648afe3..85847356 100644 --- a/js/plated.js +++ b/js/plated.js @@ -540,6 +540,43 @@ Type words here. } }; +/*************************************************************************** +--[[#js.plated.micro + + plated.micro() + +Create a starting microblogpost with todays date-time in the main blog directory. + +Markdown text is taken from opts._[1] onwards IE the command line. + +]]*/ + plated.micro=async function() + { + let blogtext="" + if( opts._ && opts._[1] ) + { + for( let i=1 ; i