Editorial Workflows

Jekyll Micro Compose

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: Creates the front matter of a Jekyll post to an external link a la a Daring Fireball linked list post.

Shared by: Martyn Chamberlin

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Request Text Input ?
Title
Title
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
post_title
Value
Input
Request Text Input ?
Title
Link
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Extract URLs ?
Output
  • Only URLs
  • URLs and Ranges (Separated by Tab)
Set Variable ?
Variable Name
link
Value
Input
Run Python Script ?
Source Code
#coding: utf-8
import workflow


filename = workflow.get_variable('post_title').replace(' ', '-').lower()

workflow.set_output(filename)
Set Variable ?
Variable Name
filename
Value
Year: 2001-Month: 01-Day: 01-Input.md
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import datetime

# Date logic adapted from http://stackoverflow.com/a/24740202/371228

# Get current local time and UTC time
localnow = datetime.datetime.now()
utcnow = datetime.datetime.utcnow()

# Compute the time difference in seconds
tzd = localnow - utcnow
secs = tzd.days*24*3600 + tzd.seconds

# Get a positive or negative prefix
prefix = '+'
if secs < 0:
	prefix = '-'
	secs = abs(secs)

# Return the local time and the difference
suffix = "%s%02d%02d" % (prefix, secs/3600, secs/60%60)

workflow.set_output(suffix)
Set Variable ?
Variable Name
post_timezone
Value
Input
Document Text ?
Folded Text
  • Include
  • Replace with:
Set Variable ?
Variable Name
text
Value
--- layout: post title: post_title date: Year: 2001-Month: 01-Day: 01 Hour: 01 (24h):Minute: 01:Second: 01 post_timezone link: link --- Input
Get Current File Name ?
Include Folder
OFF
Include Extension
ON
Set Variable ?
Variable Name
old_file
Value
Input
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import os

# os.remove(workflow.get_variable('old_file'))
Create Document ?
Filename
filename
Content
text
Open in Editor
ON