(For a lightweight introduction to writing a McStas component you may also have a look at http://ven2010.essworkshop.org/storage/Writing_a_component/Writing%20a%20component%20large.m4v this m4v video from an old ESS workshop webpage)
First, let us discuss the overall structure of a McStas component, illustrated by the one of the simplest components, Slit.comp. The component realises an aperture or slit, in this case either a rectangular or circular opening in an absorbing material slab.
First we will have a look at the documentation header below. The various '''%-tags''' are parsed by mcdoc to define component online documentation like this [ http://mcstas.org/download/components/optics/Slit.html ]
The first part including the '''%I''' information tag signifies who wrote the component and where.