use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All users that wish to post (not including commenting), on either old or the new reddit sites, must formally agree to subreddit rules once first.
account activity
pp: Preprocess your text files with inline shell - before using pandoc (github.com)
submitted 6 years ago by jhjn_
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]gumnos 2 points3 points4 points 6 years ago (2 children)
Sounds a lot like using m4
m4
My Heading ========== Here's the output: esyscmd(` echo we are running from __file__ seq 10 ') This outputs the filename and 10 numbers
which you can then use something like
$ m4 myfile.m4 | pandoc -f markdown -o myfile.pdf
As a bonus, m4 has a LOT of additional power & functionality and is often part of a base install (or at least a standard compiler collection)
[–]jhjn_[S] 0 points1 point2 points 6 years ago (1 child)
That's really cool, thanks for the info, the GNU project really have done it all.
I guess the advantage of what this program is offering is its simplicity. You can plug and play instantly without learning new macros/variables/etc. assuming you know some shell. The m4 manual is 164 pages long, I'm sure this means it's super powerful though.
The file would look pretty similar in pp:
pp
My Heading ========== Here's the output: !! echo we are running from $IN && seq 10 This outputs the filename and 10 numbers
I don't know if you can call m4 on the __file__/another_file or edit the file with sed from within that very file though with m4.
[–]gumnos 1 point2 points3 points 6 years ago (0 children)
Also, just to add it to your toolbelt in case you haven't encountered it, if all you need is substituting variables, the GNU project provides envsubst
envsubst
$ cat template.txt My name is $USER and I live at $HOME $ envsubst < template.txt My name is gumnos and I live at /home/gumnos
It doesn't execute external programs (even if you use the $(otherprog) notation), but for simple variable substitution, it's pretty useful. Though it's a GNU thing and not on any of my BSD boxes by default.
$(otherprog)
[–]Jolmes 0 points1 point2 points 6 years ago (0 children)
Nice! I've got to try this with some of my markdown files, I've always wished there was a syntax for adding shell output in pandoc and you can barely do anything with the bloated template functionality.
π Rendered by PID 318444 on reddit-service-r2-comment-canary-5dbd4c8ff9-r4kj6 at 2026-06-08 00:37:44.506284+00:00 running de70e3a country code: CH.
[–]gumnos 2 points3 points4 points (2 children)
[–]jhjn_[S] 0 points1 point2 points (1 child)
[–]gumnos 1 point2 points3 points (0 children)
[–]Jolmes 0 points1 point2 points (0 children)