Editorial Workflows

Normbrief DIN 5008

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: Mit diesem Workflow kann man mittels Markdown private Briefe oder auch Geschäftsbriefe nach DIN 5008 verfassen. Dabei wird das Anschriftsfenster von Briefumschlägen berücksichtigt. Der Briefkopf mit Bank- und Kontaktdaten erscheint in einer zweiten Spalte.

V1.0.2

Basiert auf diesem Stylesheet:
https://github.com/mac-and-i/Normbrief-mit-Markdown

Shared by: Mac & i

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Set Variable ?
Variable Name
htmlhead
Value
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> /* Normbrief DIN 5008 mit Markdown --------------------------------------------------------------- by Wolfgang Reszel for Mac & i (www.mac-and-i.de) https://github.com/mac-and-i/Normbrief-mit-Markdown/ v1.0.2 from 2014-03-13 */ /* @group Basis --------------------------------------------------------------- */ html { width: 198mm; /* Üblichen Druckrand abziehen (2*6mm) */ padding: 0; margin: 0; } body { font: normal 10.5pt/1.4em Avenir,Helvetica,Arial,sans-serif; /* 45-6mm 25mm-6mm */ margin: 39mm 0 9mm 19mm; padding: 0; width: 165mm; color: #000; } div#wrapper { height: 100%; display: inline; } a { color:#000; } p { margin: 0 0 1em 0; } h1, h2, h3, h4, h5, h6 { margin: 1.5em 0 0.5em 0; line-height: 1.2em; } h4 { font-size: 115%; } h5, h6 { font-size: 100%; } hr { border: none; } body hr:first-child, #wrapper hr:first-child { display: none; } blockquote { border: 0; margin: 0; padding: 0; color: #000; } blockquote+hr+blockquote+hr { clear: both; } figure, img { margin: 0 1em 1em 1em; display: block; } img { max-width: 100%; border: none; } figure img { margin: 0; display: inline; } figcaption { font-size: 90%; margin-bottom: 0.5em; } .poetry pre { display:block; font-family:Georgia, Garamond, serif!important; font-size:110%!important; font-style:italic; line-height:1.6em; margin-left:1em } .poetry pre code { font-family:Georgia, Garamond, serif!important } /* @end */ /* @group Kontaktdaten/Briefkopf --------------------------------------------------------------- */ blockquote { width:65mm; float:right; margin:0 0 2em 0; } blockquote a { text-decoration: none; } blockquote h1 { font-size: 120%; margin: 0; } blockquote+hr { display: none; } /* @end Kontaktdaten/Briefkopf */ /* @group Adressfeld --------------------------------------------------------------- */ blockquote+hr+blockquote { width:80mm; float:left; margin:0; } blockquote+hr+blockquote h2 { height: 10mm; width: 80mm; font-weight: normal; font-size: 80%; margin:0; } /* @end Adressfeld */ /* @group Fließtext --------------------------------------------------------------- */ /* 1. Zeile: Datum rechtsbündig */ blockquote+hr+blockquote+hr+blockquote { float: right; clear: both; width: 65mm; } blockquote+hr+blockquote+hr+blockquote+* { clear:both; } /* Betreffzeile */ blockquote+h3 { font-size: 100%; margin-bottom: 2em; } /* @end Fließtext */ /* @group Unterschrift */ p+blockquote, p+hr+blockquote, img+blockquote, figure+blockquote, ol+blockqoute, ul+blockquote { float: none; margin-top: 2em; line-height: 2em; } p+blockquote p+p:last-child, p+hr+blockquote p+p:last-child, img+blockquote p+p:last-child, figure+blockquote p+p:last-child, ol+blockqoute p+p:last-child, ul+blockquote p+p:last-child { margin-top: 3em; } /* @end */ /* @group Fußnoten --------------------------------------------------------------- */ .reversefootnote, #footnotes a, a.footnote { text-decoration: none; } .footnotes, #footnotes { margin-top: 2em; border-top: 1px solid #888; padding-top: 1em; font-size: 80%; } .footnotes ol { margin: 0; } .footnotes hr { display: none; } sup, sub, p>a.footnote { height:0; line-height:0.8; vertical-align:super; font-size:.8em; } sub { vertical-align: sub; top: -1px; } /* @end */ /* @group Listen --------------------------------------------------------------- */ dd { margin-bottom:1em } ul { list-style-type: square; } li > p:first-child { margin:0 } ul, ol { padding-left: 1.5em; } ul ul,ul ol { margin-bottom:.4em } /* @end Listen */ /* @group Tabellen --------------------------------------------------------------- */ caption,col,colgroup,table,tbody,td,tfoot,th,thead,tr { border-spacing:0 } table { border: none; border-collapse:collapse; margin: 2em 0; padding:0; width: 100%; } h1+table, h2+table, h3+table, h4+table { margin-top: 0; } table th:first-child { width: 50%; } table th,table td { line-height:1.8em; padding:0 1em; border: none; border-bottom:1px solid #888; border-right:1px solid #888; } table th:first-child,table td:first-child, table th:last-child,table td:last-child { padding: 0; } table th:last-child,table td:last-child { border-right: none; } table tr:last-child td { border-bottom: 0; } table thead { border-bottom:2px solid #000 } table tbody { border-top:1px solid #888 } table tbody:last-child { border-top: 2px solid #000; } /* @end Tabellen */ /* --------------------------------------------------------------- */ @media print { img, pre, blockquote, table, figure { page-break-inside: avoid } .reversefootnote { display: none; } } </style> </head> <body>
Set Variable ?
Variable Name
htmlfoot
Value
</body> </html>
Maybe convert to markdown, then preview/share ?
Source Code
#coding: utf-8
import codecs
import console
import editor
import markdown
import os
import workflow

htmlhead = workflow.get_variable('htmlhead')
htmlfoot = workflow.get_variable('htmlfoot')

text = editor.get_text()
text = htmlhead + markdown.markdown(text, extensions=['tables', 'attr_list']) + htmlfoot

tmpfile = 'Normbrief mit Markdown nach DIN 5008.html'
f = codecs.open(tmpfile, 'w', encoding='utf-8', errors='replace')
f.write(text)
f.close()

console.quicklook(os.path.abspath(tmpfile))
os.remove(tmpfile)