How do I draw lines on the edges of meshes?

I simply want to draw custom lines on the edges of meshes, for example on a cube, while hiding the segments that are invisible to the game's camera. To create a toony look. A bit like the standard toon shader that's included, but I also want to draw lines on edges that you see in the middle of the mesh, not only at the currently visible borders.

The standard toon shaders approach to drawing the outlines is to draw the backfacing triangles of the shape in the outline color, and scale them up a little using the normals. This won't work for drawing edges in the middle of the mesh, though.

One approach to do that is to render the normals to the screen color buffer (using shader replacement, and a custom shader to render the normals to the screen), and then, using an image post-processing effect, to detect pixels where the normals are very different from the neighbor pixels, and draw those in the outline color.