Jean Jourdain's solution will work with some fine point additions. 

1. The Strip_YAML.pl and Markdown.pl files have to have their file execute 
permission set so the piping script can invoke those scripts for execution. 
Where you have those two scripts isn't critical but for convenience of 
using them as stand alone BBEdit text filters you can place them in 
BBEdit's Text Filters folder ~/Library/Application Support/BBEdit/Text 
Filters/. (Or you can place them in BBEdit's Preview Filters folder if you 
want the option of using them as separate stand alone Preview filters as 
well as the combined piped script filter.) 

2. The piping script has to be placed in BBEdit's Preview Filters folder, 
~/Library/Application Support/BBEdit/Preview Filters/, so the script's file 
name will be included in the Preview window's "Filter:" pop down menu. Once 
that script's file name has been selected from the Filter: popup menu 
subsequent invocations of Markup -> Preview in BBEdit will automatically 
run that script with the contents of the frontmost window when Markup -> 
Preview in BBEdit is chosen. You don't necessarily have to have that 
script's file execute permission set.

3. If you use the file name with a space in it as your script github link 
shows (i.e., "Strip YAML.pl"), you'll need to use quoting or space escaping 
so the shell will interpret the file path as a single contiguous string 
instead of multiple space separated strings.

On Friday, April 4, 2025 at 9:29:16 AM UTC-7 jj wrote:

>
> Hi Christopher,
>
> As both your scripts read from stdin and write to stdout, 
> you could probably pipe them in a third script like so:
>
>
>
>
> *    #!/usr/bin/env zsh        /path/to/perl Strip_YAML.pl | /path/to/perl 
> Markdown.pl*
> and use it as a text filter.
>
> Note that BBEdit is already equipped to preview Markdown files.
> See the documentation in BBEdit Help > User Manual and search for 
> 'Markdown'.
>
> HTH,
>
> Jean Jourdain
> On Thursday, April 3, 2025 at 3:34:13 AM UTC+2 Christopher Finazzo wrote:
>
>> I have a script 
>> <https://gist.github.com/chrisfinazzo/655ecb941087741c553ebc01e71383a8> 
>> that strips out front matter from a file when it is shown in the HTML 
>> Preview. I also want to visually inspect my links to make sure that they 
>> display correctly, so I also pass files through Markdown.pl 
>> <https://daringfireball.net/projects/markdown/> inside the preview 
>> window.
>>
>> Is there a way to run 2 scripts in parallel inside the preview to 
>> accomplish this?
>>
>> On paper, this *should *work by combining the two, but I'm rather lost 
>> as to how to make it happen.
>>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or believe that the application isn't working correctly, please email 
"[email protected]" rather than posting here. Follow @bbedit on Mastodon: 
<https://mastodon.social/@bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/bbedit/5c419e2e-04db-451d-9f66-7b6de03e856en%40googlegroups.com.

Reply via email to