Editorial Workflows

Create New Post

public workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: Generates a new document with filename and metadata for use in a Pelican blog.

Shared by: Darby Lines

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Select from List ?
Title
Post Type
List (Lines)
Post Blurb Link Annex
Multiple Selection
OFF
Show in Popover
OFF
Change Case ?
  • UPPER CASE
  • lower case
  • Title Case
Set Variable ?
Variable Name
postType
Value
Input
Request Text Input ?
Title
Post Title
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
postTitle
Value
Input
If… ?
Run the block if
postType
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
link
Request Text Input ?
Title
Link URL
Initial Text
Clipboard
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
eurl
Value
Input
…End If
Select from List ?
Title
Post Status
List (Lines)
Draft Published
Multiple Selection
OFF
Show in Popover
OFF
Change Case ?
  • UPPER CASE
  • lower case
  • Title Case
Set Variable ?
Variable Name
postStatus
Value
Input
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import editor
import datetime

#gather variables
post_title = workflow.get_variable('postTitle')
post_type = workflow.get_variable('postType')
post_eurl = workflow.get_variable('eurl')
post_status = workflow.get_variable('postStatus')

#generate filename
file_name = datetime.datetime.now().strftime('%Y-%m-%d')+'-'+post_title.lower().replace(' ','-')+'.md'

#generate post title
post_title_case = post_title.title()
post_date = datetime.datetime.now().strftime('%Y-%m-%d %H:%M')

#generate post metadata
if post_type == 'link':
	post_header = 'Title: '+post_title_case+'\nAuthor: The Angry Drunk\nDate: '+post_date+'\nPostType: '+post_type+'\neurl: '+post_eurl+'\nStatus: '+post_status+'\n\n\n'
else:
	post_header = 'Title: '+post_title_case+'\nAuthor: The Angry Drunk\nDate: '+post_date+'\nPostType: '+post_type+'\nStatus: '+post_status+'\n\n\n'

#generate a file with the generated file name and content
editor.set_file_contents(file_name,post_header)

#return the filename to the workflow.
workflow.set_output(file_name)
Open Document ?
File Name
%var:Input
In Dropbox
OFF