PalMate was written in Visual Basic 5.0 and if you're interested you can download the source code.
Visual Basic doesn't produce the fastest code and makes rather large files, but for amateurs like me it is relatively easy to use.
What PalMate basically does is to write an ini command file (used by Palview) and a CSS stylesheet based on your instructions. When you want to preview the webpage, PalMate politely asks Palview to make the page telling it what pgn and ini command file to use. If it is a magazine, the name of the Html template file will also be passed on to Palview.
Of course it is a bit more complex than that, so let's see what happens step by step.
When you tell PalMate to create a new webpage, PalMate in return asks you to select a page style. A "style" is a combination of an ini file and a stylesheet plus some extra information like e.g. path to background image and maybe path to crosstable or iframe stylesheets. The ini file and page stylesheet have the same "first name" as the PalMate style, e.g. "frames.ini" and "frames.css".
PalMate stores the style's ini and css files in the subdirectory "Resource". Here's also a list (layouts.lst) with the available styles and the extra information needed by PalMate. Crosstable stylesheets are saved in the subdirectory "CrossCss" and iframe stylesheets in "IframCss".
When you have selected a style and told PalMate where to save the webpage files, PalMate copies the original stylesheet from the resource directory to the designated target directory. Unless you choose to save the style, all changes to the CSS stylesheet will be written to this copy only. That means you can work on and change a copy a css stylesheet and an inifile and save the changes to your project only - unless you save the style, the original css and ini files will not be changed.
The ini file isn't copied like the stylesheet, but PalMate makes a backup (e.g. "frames.bni") and if the style is NOT saved, the ini file is restored to its original state. Backup files are deleted when you quit PalMate.
When you're asked to select the pgn source file(s), different things can happen depending on what you choose.
If you select one or more files PalMate will ask if it is OK to copy the files to the target Html directory. This will save some time when previewing pages, because Palview always creates the Html pages in the directory of the source pgn. If this directory is different from the target Html directory PalMate will copy the webpage files to the Html target folder and delete the ones created in the pgn folder.
If you select to convert some games (not all), PalMate will parse the pgn file and ask you to select the games. The selected games will be copied to a new file with a name of your choice.
When you want to preview or save a webpage PalMate will update the ini file and the stylesheet(s) with the latest changes and call Palview to make the webpage (and maybe a separate JavaScript file). If Palview encounters any errors in the pgn file it will create a logfile with an error message, and this will be displayed by PalMate. If everything worked fine, PalMate will - if necessary - copy the Html files to the target directory. When this has been done the page will be displayed in the built in browser.