- Markdown tools: such as kramdown can be used to turn Markdown files into HTML files that can be printed.
- Safari’s Reader mode : With many pages, Safari displays a “Reader” button in the address bar. Clicking it usually removes all clutter around content. You can print a page in Reader mode. Disadvantage of this solution (especially compared to the next one): You lose most of the syntax highlighting of source code.
- Bookmarklet : Create a bookmark with the following URL, click it and everything around the content is removed.