Editorial Workflows

Change MD Ref Mark

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: Workflow to rename Markdown link reference markers.

Displays a list of all reference style Markdown references. After selecting a marker, enter the new marker name

Note: the marker list search is a little lazy.

Fixed a dumb mistake. Now shows all marks reference marks.

::: Made by Macdrifter.com
::: Version 1.1

Shared by: Macdrifter.com

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Get all reference marks ?
Source Code
#coding: utf-8
import workflow
import editor
import re


action_in = workflow.get_input()

reg_pattern = r'^\[([^^\]]+)\]:\s+(.+)$'

full_text = editor.get_text()
match_string = ''


reg_obj = re.compile(reg_pattern, re.MULTILINE)

for m in reg_obj.finditer(full_text):
	match_string += str(m.group(1)) + '\n'


#TODO: Generate the output...
action_out = action_in

workflow.set_output(match_string)
Select from List ?
Title
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
OFF
Set Variable ?
Variable Name
oldMarker
Value
Input
Request Text Input ?
Title
New Marker
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
newMarker
Value
Input
Document Text ?
Folded Text
  • Include
  • Replace with:
Find / Replace ?
Find
[oldMarker]
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
[newMarker]
Custom Replace Document Text ?
Source Code
#coding: utf-8
import workflow
import editor

action_in = workflow.get_input()

editor.replace_text(0, editor.get_text().__len__(), action_in)

#TODO: Generate the output...
action_out = action_in

workflow.set_output(action_out)