Editorial Workflows

Prettify HTML

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: Prettifies the contents of the current HTML document.

Assumes the current file is HTML

Shared by: Johan Tez

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Document Text ?
Folded Text
  • Include
  • Replace with:
Run Python Script ?
Source Code
#coding: utf-8
import workflow
from bs4 import BeautifulSoup

action_in = workflow.get_input()

#TODO: Generate the output...

doc_text = action_in
soup = BeautifulSoup(doc_text)
pretty_html = soup.prettify()

workflow.set_output(pretty_html)
Set Variable ?
Variable Name
pretty_html
Value
Input
Select Range ?
Range (from:to)
0:
Relative to
  • Entire Document
  • Current Selection
Replace Selected Text ?
Replacement Text
pretty_html