• peterh86

    Great upgrade Ole. Was well worth waiting for.

    posted in Editorial read more
  • peterh86

    Don't worry, Ole the dev is like that. Editorial 1.1 seemed too late as well. When it came out was great.

    posted in Editorial read more
  • peterh86

    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.

    posted in Editorial read more
  • peterh86

    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.

    posted in Editorial read more
  • peterh86

    You can write the css file name as the first line of the document, then you need to strip of that first line later.

    posted in Pythonista read more
  • peterh86

    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 Requests to get the webpage html, then search for links ending in .pdf and return them in a list. I imagine you could use Requests to download the pdfs as well.

    posted in Editorial read more
  • peterh86

    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:

    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.

    posted in Editorial read more
  • peterh86

    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:
    http://www.editorial-workflows.com/workflow/5894304400670720/UxmTPJfJ_W0

    posted in Editorial read more
  • peterh86

    Yes, there are posted workflows to convert html to other formats, like PDF. Search the workflows website for the format you want to convert to. I don't remember ODP.

    posted in Editorial read more
  • peterh86

    Great

    posted in Editorial read more
  • peterh86

    A possible workflow:

    1. A python script to remove the YAML and convert between Editorial and Pandoc Markdown.
    2. Call the action Convert markdown to HTML or Convert multimarkdown to HTML
    3. Add a custom CSS if you want.
    4. Call the action Show HTML to see the preview.

    It all happens within Editorial, offline. However I don't know Pandoc markdown, and this might be too simple for what you want. Another however, if you asked then perhaps writing Python is not what you want to do.

    posted in Editorial read more
  • peterh86

    The iOS app iCab mobile lets you make a screenshot from a menu item, so this is possible from within an app.

    posted in Pythonista read more
  • peterh86

    I've got Multimarkdown turned on in settings. I type some fenced code like this:

    empty line
    three backticks
    code line 1
    code line 2
    three backticks
    empty line
    

    The syntax highlighting always shows me a code block, as I expect. But Editorial's preview and the output from the action Convert Multimarkdown have two problems:

    1. I see code line 1 code line 2 all on the same line, because returns (new-lines) are ignored.
    2. If there is an empty line anywhere in the fenced code block, the fenced code is treated as normal markdown, not fenced code.

    These problems are caused by Multimarkdown wrapping the fenced code with <p><code> tags, not <pre><code>. And if there is an empty line in the fenced code, it puts a <p> </p> there.

    posted in Editorial read more
  • peterh86

    ... and with free beer, Editorial would be the greatest text editor in the universe.

    This doesn't answer your question, but here's a workflow that uses the iOS app texpad to do LaTeX from markdown: http://editorial-app.appspot.com/workflow/5245394703351808/W5YhtQWbp0g

    It's a bit crude, you need to manually paste the LaTeX into texpad, but the result is superb. All done on your iPad.

    posted in Editorial read more
  • peterh86

    I made a workflow to make a static website: http://editorial-app.appspot.com/workflow/6453713958862848/81eiZlBdpKA

    This is a onepage website, needs modifying to be multipage.

    Also Google for the Python code I based this on: Nicoletta by Roberto Alsina.

    posted in Editorial read more
  • peterh86

    Editorial is unicode underneath, so it handles all characters fine, including control characters. The problem is entering the control character, because you can't with the standard iOS keyboards.

    There are a number of (free) iOS character map apps that let you select a Unicode character and copy it, so you can paste it into editorial. The character appears in editorial as 2 or 3 tiny letters, like SOH or whatever. I have the app CharacterMap, but I just noticed that this doesn't seem to work with iOS 8, so I'll need to replace it. Make sure the character map app you get has the ASCII control characters in it, some are just subsets.

    Another approach is to find a third-party iOS 8 keyboard app that has control characters, I imagine programmers keyboards might let you type control characters directly into editorial. But I guess programmers don't use control characters much these days.

    posted in Editorial read more
  • peterh86

    I wouldn't try to write this from scratch, I'd Google for similar code and change it to suit. There is a Python FTP client for Editorial at:

    http://editorial-app.appspot.com/workflow/6072079405285376/DrV2vx1eiJQ

    though you might find it hard to see the code if you don't have Editorial.

    posted in Pythonista read more
  • peterh86

    I'm not sure of all this, but here goes:

    The iPad drive has a top directory with subdirectories and subsubdirectories and so on, just like a Linux or windows hard drive partition. Each app has one of these subdirectories as its 'root' directory, plus whatever subsubdirectories it creates in there (to store its local files).

    I think that when you jailbreak an iPad you can have access to all of these directories.

    However, for an unjailbroken iPad, iOS restricts what an app can do outside its 'root' directory. IOS is based around apps, not around files like most other operating systems. This is why you need to 'open in' a file to allow another app to use it. So, the idea of plugging an iPad into a PC, as an external drive, and seeing all the directories in the iPad is foreign to iOS. I think that when you do this, you actually see your photos. All this is for security, and I'm pleased that it works like this.

    Maybe iTunes on a PC lets you see all directories, but I have never used this. Also, some iOS file-ttransfer apps let you see the app's file directory and any subdirectories on a PC. For example the app Documents uses WebDAV to present its directories on a PC, where you can read, copy and delete files on the iPad. But only Document's files.

    posted in Editorial read more
  • peterh86

    I use the scratchpad or a python script in a workflow to run short sequences of Python code to change and list directories, then delete files. I use os.chdir, os.getcwd, os.listdir and os.remove. It's not pythonistic but it gets the job done.

    Is this what you mean?

    posted in Editorial read more
  • peterh86

    You need a python script. Check out python functions os.walk, or (better to grab your .md files) glob.glob. You then need a loop to read the files that these functions return.

    This workflow:

    http://editorial-app.appspot.com/workflow/6453713958862848/81eiZlBdpKA (in the last action)

    uses glob.glob to find all .md files in a Dropbox folder, then has a loop to read them and join them together. You could use it as an example and modify it.

    posted in Editorial read more
Internal error.

Oops! Looks like something went wrong!