Editorial Workflows

Fold projects without tag

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: Solution for https://forum.omz-software.com/topic/3845/workflow-to-fold-all-unfold-specific-headers-with-their-contents

Folds projects/headers and their contents/text if the project/header doesn't contain the selected tag.

Shared by: @jsamlarose

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import editor
import re

text = editor.get_text()
tags = sorted(set(re.findall('@\w+', text)))
if len(tags) == 0:
	import console
	console.hud_alert('No Tags Found', 'error')
	workflow.stop()
else:
	workflow.set_output('\n'.join(tags))
Select from List ?
Title
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
OFF
Set Variable ?
Variable Name
myTag
Value
Input
Document Text ?
Folded Text
  • Include
  • Replace with:
Repeat… ?
Repeat with
  • Every Line
  • Every Match of Regular Expression:
^#.*?$([\s\S]*?)(?=\n#.*?\n|\Z)
Match Group
0
Reverse
ON
If… ?
Run the block if
%repeat:text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
myTag
Fold Text ?
Fold
  • Selection
  • Range of Text:
(from:to)
%repeat:range
Placeholder Label
Default
…End If
…End Repeat