Two 14/2 cables for a Ceiling Fan with Two Separates Switches for the Light and Fan
&quot;the white wires are tied together at the ceiling fan box and switch box&quot; that's a Code violation.  That's called paralleling, which NEC 336.20 complexly says &quot;heck no&quot;.
Tying all safety grounds together is the right thing to do.  Tying all neutrals together is definitely not - it violates 336.20 and 300.3.  However, in 99.9% of boxes, tying all neutrals together is correct - you can see where this area is prone to error.  Pros who practice entirely in one narrow area tend to drift into bad habits.  Particularly in residential, where neutral and ground seem like the same thing since they all go to the same bar in the panel.
You're OK as long as the fan is a fan ONLY, and the lights are separate.
In that case, you keep the neutrals separate in the fan's box.  The fan hot &amp; neutral serve only the fan... the light hot &amp; neutral pass through that box and serve only the lights.  That's copacetic.
The diagram you found presumes a fan+light combo. And it's wrong.
The diagram you found is for power at the fan/light. Your power comes to the switch, and you want to treat that as a minor difference - no, it's pivotal.
Also, like most diagrams on the Web, it ignores the NEC 2011 code change which requires neutral at the switch.  People who are good at drawing diagrams are not good at following Code.
However you have several no-rewire options.
Light is subsidiary to fan (or vice versa)
In this application, a master switch turns on/off everything. When that switch is on, a subsidiary switch will turn on/off only the light.  (or only the fan).   This master switch cannot be a dimmer, fan speed control or anything other than a plain on/off switch (it can be smart).
Further, subject to AHJ interpretation, if this is the only light in the room, the master must turn on the light. (leaving the fan as subsidiary).  Every habitable room must have a light switch which works (for benefit of guests and first responders). That's not allowed to be a puzzle.
Use one /2 cable as the switched-hot to the entire fan/light assembly.  So this cable switches on both fan and light.  Neutral is present at the switch box, so that is covered.
As far as the second /2, you configure that as a switch loop (always-hot and switched-hot) to control the light.  (or the fan if you prefer).
The subordinate switch, which controls only the light, can be dimmable - but it cannot need neutral because it has no access to neutral.  It cannot &quot;poach&quot; the neutral from the other cables, because switch loops can't do that and it would be a NEC 300.3 violation. (imbalanced currents in the cable).
Separate neutrals at the light/fan assembly
This requires a light/fan that is specifically wired for this so it significantly constrains your choice of light/fan.  The fan in your diagram would not cut the mustard, however, there are fans that would, particularly ones that take retrofit light kits.
Note that each of the /2 cables has a hot and a neutral.  The hots will be switched-hots; one for the lamp, one for the fan.  I would even re-mark these with colored tape:
Cable 1 is &quot;fan-hot&quot; and &quot;fan-neutral&quot;, I'd use red and white.
Cable 2 is &quot;lamp-hot and lamp-neutral&quot;, I'd use blue and gray.
The fan hot and neutral go to cable 1.   The light hot and neutral go to cable 2.  The neutrals ARE NOT tied together in the fan area; they are already tied together at the switch and cannot be tied both places.
Current travels in loops (hence 300.3).  All fan current returns on the fan neutral in that same cable.  All lamp current returns on the lamp neutral.  Thus we comply with 300.3.
You are at liberty to use any type of dimmer, smart switch, motion sensor, speed control or anything you please at the switches.