Bridge system notes written with BML.
Html can be generated from the .bml
files using the bml tools.
- Download the BML tools and this repository.
- Install Python v3 programming language, preferrably not system wide to make permissions
easier and make sure Python 3 is added to
PATH
via the installer options. - Install doit from public Python packages repository:
pip install --user doit
Ifpip
is not found then theScripts
directory needs adding to thePATH
environment variable, e.g. theC:/Users/$MyUser/AppData/Roaming/Python/Python38/Scripts/
directory if Python 3.8 was installed.pip
should be in there (using the correctMyUser
replacement). Thedoit
program will be installed to the same directory aspip
. - Install watchexec as per the instructions and ensure it's in the
PATH
To install withcargo
when you don't havecargo
, use rustup to install the Rust tooling ecosystem. Otherwise use one of the other suggestions.
All the programs doit
, python
, and watchexec
should be found from a command prompt (shell) at this point.
The bml tools should be specified by one of two ways:
- downloaded to the
dev/bml
directory within your home (user) directory, e.g.C:/Users/MyUser/dev/bml
- Setting an environment variable
BML_TOOLS_DIRECTORY
with the directory as the value
With those in place it should be possible to run a workflow that trys to build html
files from your bridge bml
files everytime you save changes to a bml file in this directory. Open a command prompt (shell) in this directory:
cd bridge-bidding-systems
watchexec --exts bml,css doit
- Watchexec is now monitoring this directory for any file system changes to files with the extension
.bml
(or.css
). - Whenever a change is found the
doit
program is run doit
looks atdodo.py
and runs all the tasks in there.- the
task_publish_main_bidding
indodo.py
will probably fail unless you have a 'W:' windows volume, could be deleted. It's meant for continuously publishing the output to a webserver directory. Untried, butwatchexec --exts bml,css doit ignore task_publish_main_bidding
could be what is needed.
The dodo.py
task automation program uses the bml2html.py
python program found in the bml tools.
So far, whenever a .bml
file is saved, the html output is rebuilt. This can be viewed in a browser but normally you
have to manually refresh the browser page to see any changes in the html as you are editing the bml file(s).
There's probably a number of reasonable approaches to this. The most convenient for myself was to open this
bridge-bidding-system
directory in Visual Studio Code, install the
Live Server extension for VSCode and open
a generated html file with the live server (command Live Server: Open with Live Server
). At that point any web
browser can point to http://127.0.0.1:5500/
and you will see any viewed html file live reload as changes are made.
The BML tools have my own changes applied to the
main BML tools repository. E.g. the html files have a .html
extension instead
of .htm
.