pretty.codes

Information

This tool can be used to copy code snippets as rich text (HTML) to be pasted into Google Docs or Google Slides without needing to spend more time formatting the text after pasting.

Features

  • Highlights code with a light theme so that it is visible with the default white background that Google Docs uses
  • Sets font to "Roboto Mono"
  • Sets font-size to 10pt
  • Sets line-spacing to 1.15
  • Prevents Google products from stripping a single indentation character from lines that have multiple leading white-spaces characters

Instructions

  1. Paste code snippet into editor or use editor to write a code snippet from scratch
  2. Copy contents (no need to select all first) by clicking the "copy" button or pressing ⌘C or ⌘S
  3. Paste with formatting (usually ⌘V) into Google Docs or Google Slides

Debug

You can view the raw (text and HTML) contents of your clipboard, in your browser's developer console, by focusing the "debug" control and pasting (⌘V).