Note-taking apps are everywhere, but the only one I've found that can handle anything you throw at it — code, images, HTML, etc. — is CherryTree. By using a node-based structure, keeping your ideas, scraps and other bits organised is very straightforward.
Created by Giuseppe Penone and actively developed, CherryTree has an extensive set of constantly-expanding features.
Here's an abridged list:
- rich text (foreground color, background color, bold, italic, underline, strikethrough, small, h1, h2, h3, subscript, superscript, monospace)
- syntax highlighting supporting several programming languages
- images handling: insertion in the text, edit (resize/rotate), save as png file
- embedded files handling: insertion in the text, save to disk
- multi-level lists handling (bulleted, numbered, to-do and switch between them, multiline with shift+enter)
- simple tables handling (cells with plain text), cut/copy/paste row, import/export as csv file
- hyperlinks associated to text and images (links to webpages, links to nodes/nodes + anchors, links to files, links to folders)
- spell check (using pygtkspellcheck and pyenchant)
- print & save as pdf file of a selection / node / node and subnodes / the whole tree
- export to html of a selection / node / node and subnodes / the whole tree
- export to plain text of a selection / node / node and subnodes / the whole tree
- toc generation for a node / node and subnodes / the whole tree, based on headers h1, h2 and h3
- password protection (using http://www.7-zip.org/)
You can even choose the format CherryTree uses to save your data — either an SQL database (faster) or XML (human-readable).