Editorial Workflows

prepend nikola header

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: Prepends a Nikola-formatted metadata header to the top of the current document. If one already exists then the date is refreshed.

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Set Variable ?
Variable Name
DateLineRE
Value
^\.\. date\: .*$
Document Text ?
Folded Text
  • Include
  • Replace with:
Extract Range ?
Range (from:to)
0:300
Find ?
Search for
DateLineRE
Match Group (RegEx)
0 (entire match)
Search Type
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Output
  • Found Text
  • Range of Text (from:to)
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
date
Get Current File Name ?
Include Folder
OFF
Include Extension
OFF
Set Variable ?
Variable Name
Slug
Value
Input
Find / Replace ?
Find
-
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
Set Variable ?
Variable Name
Title
Value
Input
Generate Text ?
Text
<!-- .. title: Title .. slug: Slug .. date: date .. tags: code .. type: text -->
Set Variable ?
Variable Name
Header
Value
Input
Move Caret ?
Direction
  • Backward
  • Forward
  • Start/End of Document
  • Start/End of Line
  • Number of Characters:
1
Replace Selected Text ?
Replacement Text
Header
…End If
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import datetime

now = datetime.datetime.now().isoformat()

workflow.set_output(now)
Set Variable ?
Variable Name
Date
Value
.. date: Input
Document Text ?
Folded Text
  • Include
  • Replace with:
Find ?
Search for
DateLineRE
Match Group (RegEx)
0 (entire match)
Search Type
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Output
  • Found Text
  • Range of Text (from:to)
Select Range ?
Range (from:to)
Input
Relative to
  • Entire Document
  • Current Selection
Replace Selected Text ?
Replacement Text
Date