Great upgrade Ole. Was well worth waiting for.
Latest posts made by peterh86
RE: Editorial v1.2 is now up on the Apple App Store... Go get it!
RE: How to share functions between Editorial workflows
Check out sub-workflows. If you have a sub-workflow with a Python script then you can use it in several workflows. Just as you want.
RE: Total beginner
Yes, I agree with rvojta, jump in.
I Google my questions, with python at the start, to find how others do it. First I find a python script that does approximately what I want, using Google or by searching this forum or the extra workflows website. Then I change the script bit by bit, googling all the way. I think python is so complicated that you can't learn it in the usual way and then write scripts from scratch.
RE: .pdf links from a website
Yes, but i can't help in detail. It probably requires a workflow with just a Python script.
Given the webpage address, you'd use
Requeststo get the webpage html, then search for links ending in
Requeststo download the pdfs as well.
Other ways to convert Markdown/HTML to PDF in iOS
I've been experimenting with workflows to convert Markdown/HTML to PDF, using a CSS and wanting to set page breaks. Here's what I found:
Using a cloud service - Docverter
The free services usually have limited features, though Docverter seemed promising. I wrote a workflow to use It, based on Caleb McDaniel's Pythonista script here http://wcm1.web.rice.edu/pandoc-on-ios.html. Docverter supports @page, page breaks, page-break-after:avoid (to keep headings on the same page as the following paragraph) and links in a displayed PDF are live.
Sadly it always lost the last few sentences I sent it, and my Python/internet skills are not good enough to find where the problem is. I found other problems:
- Caleb's script sent the CSS and markdown as two files, but I found this was not reliable. I converted to HTML, with a CSS, so I only needed to send one file. even so, it occasionally failed.
- There are only a couple of fonts available, presumably for copyright reasons, though you can use @fontface to send other font files.
- I couldn't see how to hyphenate, so either the right margin is very ragged, or you justify it and get terrible gaps in the text.
- It doesn't handle images wider that the print area well (does not scale down properly)
Using an iOS HTML converter app
There are many apps to convert HTML to PDF. The support seems to be for CSS2.1, so you can' t use @page but you can use page breaks. Unfortunately all apps seem to have a bug with page-break-before:always and most have a bug with page-break-before:always (insert two page breaks), so most aren't suitable. I used:
- PDF-Converter (Readdle) as described here http://editorial-app.appspot.com/workflow/5660638047109120/vHXf1o0Is1o (in the webbrowser.open, change rhttp to pdfhttp). The top and bottom margins are a bit small for a printed page. And since iOS 7, this only gives me US paper size, which I don't want. I think it is arrogant of a developer not to allow for A4 paper as well.
- PDF This Page (Julian Yap) This is what I use now. The top and bottom margins are better, and you can select US or A4 pages. My workflow for this is here: http://editorial-app.appspot.com/workflow/5789374323097600/pWAw-_K2jfY
Neither of these apps let you add a header or footer, or set the top and bottom margins and you can't hyphenate. Page-break-after:avoid doesn't work and links in a displayed PDF are not live. Images do work well.
So, I'm still looking for the perfect app for this.
RE: Other ways to convert Markdown/HTML to PDF in iOS
Now the best way is to use Ulysses for iPad. It adjusts the width of the whitespace between words and between letters so the PDF looks great; CSS-based PDF converters usually don't do this. And it handles images easily.
Later versions of Ulysses will have an X-callback scheme, so maybe we can send Markdown from Editorial to be converted to PDF.
I don't like the available styles much, so I wrote a workflow so I can edit them on the iPad: