Editorial Workflows

Servr - Editorial edition

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: Servr - Editorial edition is a simple web server for your Editorial Markdown, MultiMarkdown, or HTML documents. One example usage case is sharing your Editorial documents with someone on the same WiFi network. Servr automatically converts everything to HTML. Have fun serving!

Shared by: Gerzer

Comments: Comment Feed (RSS)

Tutorial Doctor — 10 Aug 2014
How do I choose a private IP, or a port? Perhaps a help section? Or perhaps randomly generate the IP? I am new to this.
Gerzer — 15 Aug 2014
You can choose whichever port number you want as long as it's available. I would recommend choosing any simple port number less than 10000, and see if you get an error. Most likely, you won't get an error, meaning the port is available, but you never know.

You can find your private IP by tapping the iOS Settings app, tapping Wi-Fi, and tapping the little (i) next to the name of the network you are currently on. It will be under IP Address, and will probably start with 192.168.

If you aren't on Wi-Fi, you can leave the IP field in Servr blank, and in the browser, type in localhost:3333 (replace 3333 with whatever port number you chose).

If you did type in your IP, the address you type in to the browser will be 192.168.1.1:3333 (replace 192.168.1.1 with your private IP, and replace 3333 with the port number).

Hope this helps!
Tutorial Doctor — 30 Oct 2014
Thanks! That is cool! I am adding your response to a help menu for the workflow.

Thanks again.

+ Add Comment

Workflow Preview
Show Alert ?
Title
Welcome
Message
Welcome to Servr - Editorial edition!
Button 1
OK
Output Value
Input
Button 2
(don't show)
Output Value
Button 3
(don't show)
Output Value
Show Cancel Button
ON
Request Text Input ?
Title
Private IP address
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
IP
Value
Input
Request Text Input ?
Title
Port
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
Port
Value
Input
Select from List ?
Title
Format
List (Lines)
HTML Markdown MultiMarkdown
Multiple Selection
OFF
Show in Popover
OFF
Set Variable ?
Variable Name
Format
Value
Input
If… ?
Run the block if
Format
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Markdown
Document Text ?
Folded Text
  • Include
  • Replace with:
Convert Markdown ?
Markdown Extras: Footnotes
ON
…Auto-Links
ON
…Strikethrough (~~x~~)
ON
…Superscript (^x)
ON
…Tables
ON
…Smart Quotes etc.
ON
…Strip Metadata Headers
OFF
Set Variable ?
Variable Name
HTML
Value
Input
…End If
If… ?
Run the block if
Format
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
MultiMarkdown
Document Text ?
Folded Text
  • Include
  • Replace with:
Convert Multi-Markdown ?
Template
Input
Smart Quotes
ON
Set Variable ?
Variable Name
HTML
Value
Input
…End If
If… ?
Run the block if
Format
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
HTML
Document Text ?
Folded Text
  • Include
  • Replace with:
Set Variable ?
Variable Name
HTML
Value
Input
…End If
Run Python Script ?
Source Code
import workflow
import console
html = workflow.get_variable('HTML')
ip = workflow.get_variable('IP')
port = workflow.get_variable('Port')
from wsgiref.simple_server import make_server
def app(environ, start_response):
	status = '200 OK'
	headers = [('Content-type', 'text/html')]
	start_response(status, headers)
	return [str(''.join(html.split('\n')))]
httpd = make_server(ip, int(port), app)
console.show_activity('Serving at address ' + ip + ':' + port + '...')
httpd.serve_forever()