Sure - you just add a public property of type XhtmlDocument and this will result in a content editor to be shown to the user when editing your Razor Function.
Here is an example of a Razor function with a XhtmlDocument property (line 14).
Here is an example of a Razor function with a XhtmlDocument property (line 14).