• omz

    I made this a while ago:

    https://gist.github.com/omz/aca3f4877d3f565239d8

    Video demo:

    https://twitter.com/olemoritz/status/713104304366886916

    Maybe it's a starting point for what you want to do. I should add that this is using completely unsupported, private API, and it might break anytime, but it still seems to work on iOS 10.3.

    posted in Pythonista read more
  • omz

    To my knowledge, this isn't possible because the framework would have to be code-signed by Apple.

    posted in Pythonista read more
  • omz

    import os, editor, json
    
    with open(os.path.join(editor.get_workflows_path(), 'Commands.edcmd'), 'r') as f:
        workflow_infos = json.load(f)
        workflow_titles = [w['title'] for w in workflow_infos]
    print '\n'.join(workflow_titles)
    

    posted in Editorial read more
  • omz

    I've updated the workflow to remove leading and trailing line breaks from header/footer text, as they are indeed rendered as a black box (multiple lines are not supported at all, sorry).

    Depending on how you generate the header text, it might also be easy to avoid having it end with a line break.

    posted in Editorial read more
  • omz

    You can use snippets to enter those characters more quickly. Simply add a snippet that contains {==[Selected Text]==} (where [Selected Text] is a placeholder from the Variables... popup). Then you can select some text, insert the snippet, and the selection will be surrounded by {== and ==}.

    Regarding your other question, it's not possible to customize this syntax.

    posted in Editorial read more
  • omz

    Editorial has some support for CriticMarkup, and you can highlight a piece of text using this syntax: {==highlighted text==}. This works both in the editor, and in the preview. You can also use {++text++} for additions (highlighted in green) or {--text--} for deletions (red).

    posted in Editorial read more
  • omz

    I've taken @ccc's basic approach, and turned it into a complete workflow:

    http://www.editorial-workflows.com/workflow/5807752689483776/zRswEIOv3yY

    The core of this is a custom (Python) action that takes a PDF (generated by the standard "HTML to PDF" action), and adds header/footer text on every page. The text can include regular workflow variables (client name, date...) and page numbers – {p} is automatically replaced by the current page number, and {n} is replaced by the total number of pages.

    A couple of other things, like font size, margins etc. are also easily configurable by editing the workflow.

    posted in Editorial read more
  • omz

    @ccc For some reason, PdfFileReader.pages doesn't seem to work properly. Possible workaround:

    fg_reader = PyPDF2.PdfFileReader(fg_file)
    fg_pages = [fg_reader.getPage(i) for i in range(fg_reader.getNumPages())]
    for page in fg_pages:
        # ...
    

    posted in Editorial read more
  • omz

    Of course it's not okay (and illegal) to publish someone else's code with a license that the original author never intended. You can't just assume that everyone uses the MIT license, just because it's common.

    In @abcabc's defense though, it is fairly unusual to post source code publicly, and not apply any open-source license. This makes it impossible to collaborate in any meaningful way, and if collaboration is not desired, it's not clear what the purpose of posting the code in the first place would be.

    That said, this is @tileyon's decision, of course. Btw, it's possible to edit existing posts, in case you want to remove your code from this forum.

    posted in Pythonista read more
  • omz

    @jumpbeen So far, I can't reproduce the behavior you're describing. Which iOS version are you using? What kind of device?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!