Skip to content

Commit 435e226

Browse files
committed
New page for bogbat program v0.1.0
1 parent 2362c38 commit 435e226

File tree

1 file changed

+175
-0
lines changed

1 file changed

+175
-0
lines changed

_software/bogbat.html

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
---
2+
layout: "programs-tplt"
3+
group: apps
4+
priority: 1.8
5+
version: "0.1.0"
6+
os: "Windows 7 SP1 & later"
7+
release-date: "2025-06-05"
8+
title: "BogBat"
9+
precis: "A bog-basic template replacement program."
10+
summary: "Command line program that replaces simple templates in text files with data values."
11+
meta-title: "BogBat: template replacement program | Open Source | 32/64 bit"
12+
meta-desc: 64 bit Windows command line program that reads in a template file and a data and writes an output file comprising the template file with all templates replaced by data from the data file."
13+
download-base-url: "https://github.com/ddabapps/bogbat/releases/tag/v"
14+
repo-url: "https://github.com/ddabapps/bogbat"
15+
want-header-buttons: true
16+
copyright-date: "2025"
17+
status: "current"
18+
---
19+
20+
<section class="panel panel-default">
21+
<div class="panel-heading">
22+
<h2 class="panel-title">
23+
Overview
24+
</h2>
25+
</div>
26+
<div class="panel-body">
27+
<p>
28+
<em>BogBat</em> is a simple 64 bit Windows command line program that takes a text file containing templates and a data file as input and generates an output file with each template replaced by data value defined in the data file.
29+
</p>
30+
<p>
31+
This program is very simple. It just replaces templates with text values. There are no loops, no functions, no text processing and no intelligent handling of white space around templates. The program's simple nature led to the name: the <strong>Bog</strong> <strong>Ba</strong>sic <strong>t</strong>emplate program.
32+
</p>
33+
34+
<h3>
35+
Basic usage
36+
</h3>
37+
38+
<p>
39+
The following command line shows the normal way to use <em>BogBat</em>.
40+
</p>
41+
<pre class="samp indent">BogBat -d:data-file -t:template-file -o:output-file</pre>
42+
<p>
43+
This causes <em>BogBat</em> to read a data file named <code>data-file</code> and a template file named <code>template-file</code> and to output a file named <code>output-file</code> that results from replacing any templates in <code>template-file</code> with data from <code>data-file</code>.
44+
</p>
45+
<p>
46+
You <strong>must</strong> provide a data file on the command line, but if either the template file or output file is not present then the template text is read from standard input and the output is sent to standard output. Of course, either standard input or standard output can be redirected so:
47+
</p>
48+
<pre class="samp indent">BogBat -d:data-file &lt;template-file &gt;output-file</pre>
49+
<p>
50+
works exactly the same as the previous example.
51+
</p>
52+
53+
<h3>
54+
File formats
55+
</h3>
56+
57+
<p>
58+
The data file must have entries of the form <code>key=value</code>, with each entry on a different line. Blank lines and lines that begin with a <code>#</code> character are ignored. Spaces before <code>key</code> and between <code>key</code> and <code>=</code> are ignored. Spaces after the <code>=</code> sign are significant and are included in <code>value</code>.
59+
</p>
60+
<p>
61+
Template files are simple text files that contain templates. By default templates are delimited by <code>{%raw%}{{{%endraw%}</code> and <code>}}</code> symbol pairs. Any text inside the delimiters is taken to be one of the <code>key</code> values in the data file. The whole template is replaced by the <code>value</code> from the data file that corresponds to <code>key</code>. For example, if we have a template file with content:
62+
</p>
63+
<pre class="samp indent">The {%raw%}{{{%endraw%} foo }} sat on the {%raw%}{{{%endraw%} bar }}.</pre>
64+
<p>
65+
And data file with content:
66+
</p>
67+
<pre class="samp indent">foo=cat
68+
bar=mat</pre>
69+
<p>
70+
Then running <em>BogBat</em> with the two files above produces the output:
71+
</p>
72+
<pre class="samp indent">The cat sat on the mat.</pre>
73+
<p>
74+
If any <code>Key</code> has no value after the <code>=</code> sign, or if the key referenced in a template does not exist then the template is deleted from the output.
75+
</p>
76+
<p>
77+
By default all input files are assumed to be in UTF-8 format (either with or without UTF-8 preambles) and the output file is written in UTF-8 without a preamble. The text file encodings and use of preambles can be overridden using command line options.
78+
</p>
79+
<p>
80+
The <code>{%raw%}{{{%endraw%}</code> and <code>}}</code> characters used to delimit templates can be altered using a command line option. This is useful since there is no method of including the opening delimiter literally in the output so changing to a different delimter that doesn't appear literally in the text is the only way round this.
81+
</p>
82+
83+
<h3>
84+
Getting help
85+
</h3>
86+
87+
<p>
88+
All the available command line options can be displayed using the command:
89+
</p>
90+
<pre class="samp indent">BogBat --help</pre>
91+
<p>
92+
The output from this file is comprehensive and will scroll out of the console window. The output is sent to standard error, so can't be paged by the <code>more</code> command. You can however send the output to a text file using the following command:
93+
</p>
94+
<pre class="samp indent">BogBat --help 2>my-file.txt</pre>
95+
96+
<h3>
97+
Copyright and license
98+
</h3>
99+
100+
<p class="callout callout-info">
101+
<span class="fa fa-copyright fa-pull-left fa-3x"></span><em>BogBat</em> is copyright &copy; {{ page.copyright-date}} by <a href="{{ site.data.core.gravatar-url }}" aria-label="{{ site.data.core.gravatar-link-title }}">Peter Johnson</a>. The program and its source code are released under the terms of the <a href="https://delphidabbler.mit-license.org/{{page.copyright-date}}-/">MIT License</a>.
102+
</p>
103+
</div>
104+
</section>
105+
106+
<section class="panel panel-default">
107+
<div class="panel-heading">
108+
<h2 class="panel-title">
109+
Download
110+
</h2>
111+
</div>
112+
<div class="panel-body">
113+
<p>
114+
This program is hosted on GitHub in the <code><a href="{{ page.repo-url }}">ddabapps/bogbat</a></code> repository. The program can be downloaded from the repository's <em>Releases</em> tab.
115+
</p>
116+
<p>
117+
Each release gives the option of downloading either the program's executable code or the source code. Your options are:
118+
</p>
119+
<ul>
120+
<li>
121+
Choose <code>bogbat-exe-{{page.version}}.zip</code> to download a zip file containing the program. It is named <code>BogBat.exe</code>. There is no installer. Just extract the program's <code>.exe</code> file from the <code>.zip</code> file and copy it to a folder on your system or on an external drive. It can be run from there.
122+
</li>
123+
<li>
124+
Choose <code>Source&nbsp;code.zip</code> to download the source code in <code>.zip</code> format.
125+
</li>
126+
<li>
127+
Choose <code>Source&nbsp;code.tar.gz</code> to download the source code as a g-zipped tarball.
128+
</li>
129+
</ul>
130+
<p class="alert alert-info">At present <em>BogBat</em> is only available as a 64 bit program. If there is any demand for a 32 bit version that may be considered for a future release. To request a 32 bit version you'll need to <a href="https://github.com/ddabapps/bogbat/issues" class="offsite">raise an issue</a>.</p>
131+
<p class="text-center">
132+
<a class="btn btn-primary" role="button" href="{{ page.download-base-url }}{{ page.version }}" aria-label="Go to release v{{ page.version}} on GitHub">Get <span class="hidden-xs">release </span>v{{ page.version }} from GitHub</a>
133+
</p>
134+
</div>
135+
</section>
136+
137+
<section class="panel panel-default">
138+
<div class="panel-heading">
139+
<h2 class="panel-title">
140+
Documentation
141+
</h2>
142+
</div>
143+
<div class="panel-body">
144+
<p>
145+
The following documentation is available. All of it opens on GitHub.
146+
</p>
147+
<ul class="list-group">
148+
<li class="list-group-item">
149+
<span class="fa fa-fw fa-x-pad-right fa-file-text-o" aria-hidden="true"></span><a href="https://github.com/ddabapps/bogbat/blob/main/README.md">Read Me<span class="sr-only"> (Markdown file)</span></a> &ndash; contains general information about the program.
150+
</li>
151+
<li class="list-group-item">
152+
<span class="fa fa-fw fa-x-pad-right fa-file-text-o" aria-hidden="true"></span><a href="https://github.com/ddabapps/bogbat/blob/main/CHANGELOG.md">Change Log<span class="sr-only"> (Markdown file)</span></a> &ndash; lists significant changes made in each program release.
153+
</li>
154+
</ul>
155+
</div>
156+
</section>
157+
158+
<section class="panel panel-default">
159+
<div class="panel-heading">
160+
<h2 class="panel-title">
161+
Bugs &amp; Feature Requests
162+
</h2>
163+
</div>
164+
<div class="panel-body">
165+
<p>
166+
You can report bugs or suggest new features using the <em>BogBat</em> <a href="https://github.com/ddabapps/bogbat/issues" class="offsite">issue tracker</a> on GitHub.
167+
</p>
168+
<p>
169+
Please review existing bug reports and feature requests before creating a new issue. If an issue already exists you may be able to help by adding a further comment.
170+
</p>
171+
<p class="alert alert-info glyph">
172+
You will need a GitHub account if you want to create or edit an issue.
173+
</p>
174+
</div>
175+
</section>

0 commit comments

Comments
 (0)