Are you familiar with carbon.now.sh? This application is something similar, You can convert your code to a beautiful windowed image with highlighting feature. Also this application is using Highlighter library as it's core. With the power of SwiftUI you can run the same code both on iOS and macOS.
Licensed under the GNU GENERAL PUBLIC LICENSE Version 3.