3 Creating Template Files
Craig Oates edited this page 4 years ago

I call these plain-text (.txt) files "template files" for two reasons. The first one is they provide new developers with a template to reference when/if they build their own. The second is they are actual templates -- of sorts. WetPancake (W.P.) cannot generate text of its own accord. It needs a reference point/template first so it has something to base its output on, which is what these files do.

To help explain the second point consider the following...

You are designing a website for a German law firm. With the site still in the design stage, you are using dummy data. So, you decide to use W.P. to generate some Lorem Ipsum text. In its default state, W.P. does not have any "template" (.txt) files with German text -- it's all in English. On top of that, the text in the .txt files do not include anything which resembles traditional "law speak". Because of that, W.P. will produce text which will look out of place in your designs -- just like actual Lorem Ipsum. To fix this, you change the template (.txt) files W.P. is working from. Which causes W.P. to generate more appropriate text for the website your designing.

As an aside, it is worth pointing out how W.P. uses the template files. It does it by reading the text in the file and creating a Markov Chain from it. The chain then becomes the reference point for the text W.P. produces. The original file is no longer needed after the initial reading and forming of the Markov Chain. If you are unsure what a Markov Chain is and how it use these template (.txt) files, please use the following link:

For the best results, I recommend you stick to the following guidelines:

  1. No double spaces.
  2. No multiple line breaks.
  3. No Unicode -- aim to keep to ASCII characters.
  4. Use punctuation sparingly.

To get a sense of how a template (.txt) file should look, you can read the files W.P. already uses, The link for the folder they are kept in is as follows:

A good way to see the types of results these files create is by using "Script.fsx" with F# Interactive (FSI). You can, also, use the console project (WetPancakeCLI) which is another project within the repository. More information for both is available at: