[doc] Move inheritance to advanced usage and add an example.