Args of Custom Processor

johseb's Avatar

johseb

03 Jun, 2019 11:31 AM

I'm using Pandoc as my Custom Processor and I'm facing the following (minor) issues:

  1. My list of args/filters is quite long and moving left/right to read or modify the string is a hassle
  2. I often need to modify the string to include or exclude arguments and filters and now I have to search the arg and delete it, then I forget the syntax when its time to include it again, etc

My proposal is to have a "modular" approach:
include several "Args" fields which will be combined (space separated) by Marked 2 when launching the processor. Each of them will be complete of a checkmark to quickly enable/disable it.

  1. Support Staff 1 Posted by Brett on 03 Jun, 2019 10:10 PM

    Brett's Avatar

    Thanks for the suggestion. It's a good solution to your problem, but I'm not sure it's needed by enough users to justify the extra interface. The easiest solution to long argument fields is to call a shell script instead, then edit the arguments in a text editor where you can see them all. I get that individually toggling arguments on and off would be handy if you're changing parameters frequently, but I just question whether enough users are in that position to make it a feature.

    To use a shell script, just create a processor.sh file (with whatever name) and include something like:

    #/bin/bash
    
    cat | /usr/local/bin/pandoc -all -my -arguments
    

    Make it executable and point Marked to that instead of Pandoc. You could even pass arguments to that from Marked and reference them as $1, $2, etc. (the actual content is passed via STDIN, thus the cat), so that the ones you change most often could be sent from Marked and all of the defaults would be automatic. It would at least save space in the text field...

    Hope that helps!

    -Brett

    P.S. I do have hopes and dreams of fleshing out a much better custom processor interface, with multiple processors, each with their own config panels, and even a predicate builder that allows Marked to determine whether or not/which processor to run in different circumstances. Right now that's way down the line on the roadmap, but I'll keep the multi-field arguments idea in mind for that.

  2. 2 Posted by johseb on 03 Jun, 2019 11:01 PM

    johseb's Avatar

    Thanks for your reply and your suggestions.
    I'll try them out asap.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac