Minecraft wiki entry for Water-powered_boat_transportation, associated text: Stone represents the water channel.
The water flow direction is up in these illustrations.
The buttons are shown unattached in the diagrams. Each button is actually attached to the channel wall nearest to the button.
The incoming water is assumed to be diagonal flow up toward the temporary dirt block.