How do nitrogen-doped carbon dots generate from molecular precursors? An investigation of the formation mechanism and a solution-based large-scale synthesis.