I have been trying to define a verbatim environment in plain TeX with |...| for inline and ||...|| for display. Optimally, with an easy way to alter so that the visibility of spaces can be toggled (e.g. commenting out a line of code or using a different character like *...* and **...**).
I know that tugboat.sty defines this (see lines 1632-1963), but it is a very long process and frankly quite hard to decipher. I was wondering what the easiest way to do this in plain TeX is.
I have also seen a few questions regarding verbatim in plain TeX (see Define a special verbatim commmand and How to display code snippets in plain TeX), but these both use commands (e.g. \verb{...} and \verbatim ...\endverbatim).
This is for my own curiosity, as way to better understand TeX, and for use in my own plain TeX documents.
