Where is the howto write a scanner document?

Plex call the scanner functions onc3 for root folder and once per subfolder and the scanner add files in series and seasons and ep number in plex. Plex launch the metadata agent to fetch serie and ep summaries rating genre tags and posters…