Since there is no easy way (to my knowledge) to add inline code or a code block in the Text fields we should investigate this:

https://github.com/FlipperPA/wagtailcodeblock

https://github.com/coderedcorp/coderedcms/issues/305