bridge (contract game) utils for PBN & xinrui & bbo
Project description
Introduction
There are several utity tools for writing bridge articles
Key features (beta release)
- support xinrui url, bbo lin url (bbo soon)
- generate well tuned latex/html bridge layout (card diagram)
- generate all kinds of ebook (
.pdf
/.mobi
/.epub
/.html
/.latex
) with related toolchains (pandoc
,multimarkdown
)
Install
pip install bridge-utils
Usage
for student newsletter
This is for http://xrgopher.gitee.io/studentbridge
update raw txt (mostly suits S4
-> â 4
)
zyj-update README.txt
Using README.txt, all the materials are combined into README.md
with xinrui links, then generate HTMLs
zyj-convert README.md
Then README.html
and README.pbn.html
are generated
Article Samples
- Ramsey's article for xinrui bridge (Chinese), see ramsey.md and ramsey.pdf
How to use it
Generally, follow below steps
- write it in special format with markdown
- use
mdbridge
tool to generate intermediate markdown file - use
multimarkdown
orpandoc
to generate related format files - generate final ebook
See below
# sample.md
<pre lang="bridge">
http://www.xinruibridge.com/deallog/DealLog.html?bidlog=P;1N,P,3N,P;P,P&playlog=W:6H,TH,KH,5H;E:9H,AH,3H,JH;S:TD,8D,2D,6D;S:KD,QH,5D,3D;S:7D,4C,JD,4D;N:QD,9D,2C,8S;N:AD,3S,5S,6S;N:KC,6C,3C,8C;N:2S,4S,KS,AS;W:8H,9C,2H,5C;W:7H,TS,9S,7C;W:4H,TC,7S,JS;W:JC,QS,QC,AC;&deal=9743.K92.9643.Q6%20KJ5.A5.KT7.A7532%20A86.Q87643.8.J84%20QT2.JT.AQJ52.KT9&vul=None&dealer=E&contract=3N&declarer=S&wintrick=8&score=-50&str=%E5%9B%A2%E4%BD%93%E8%B5%9B%20%E7%AC%AC10%E8%BD%AE%20%E7%89%8C%E5%8F%B7%2014/16&dealid=794018966&pbnid=221536004
deal|cards=NS|ul="<str>"|ll=<str>|ur=<str>`
</pre>
$ pip install mdbridge
$ mdbridge2latex sample.md
sample.bridge-tex is created
$ multimarkdown -t latex meta.txt sample.bridge-tex -o sample.tex
$ xelatex article.tex # article.tex is not released yet
The complete guideline will be released soon.
markdown format
define the deal from url first
http://www.xinruibridge.com/deallog/DealLog.html?bidlog=P,2N,P%3B3C,P,3N,P%3B6N,P,P,P%3B&playlog=E:KD,3D,4D,JD%3BE:2D,5D,7D,AD%3BN:JS,6S,5S,8S%3BN:KS,4S,7S,2S%3BN:3S,TS,AS,8H%3BS:QS,TD,4C,9S%3BS:KH,JH,4H,2H%3BS:AH,TH,9H,3H%3BS:QH,9D,8C,5H%3BS:2C,JC,QC,6C%3BN:KC,9C,6D,5C%3BN:AC,7H,6H,3C%3BN:7C,QD,8D,TC%3B&deal=82.JT8.T974.JT53%20KJ3.94.AJ.AKQ874%20T964.7532.KQ2.96%20AQ75.AKQ6.8653.2&vul=All&dealer=W&contract=6N&declarer=N&wintrick=11&score=-100&str=%E7%BE%A4%E7%BB%84IMP%E8%B5%9B%2020201209%20%E7%89%8C%E5%8F%B7%204/8&dealid=995050099&pbnid=345464272
auction
customize the deal
deal|cards=NS|ul="<str>"|ll=<str>|ur=<str>
Two-Hand Diagram
deal|cards=NS
All-Hands Diagram
deal
Partial deal
deal=.xxxx..xxx&.T4.A.AK87&-&.AKQ6.865.
Partial deal with extra information
deal=.xxxx..xxx&.94.A.AK87&-&.AKQ6.865.|ll="NS 4/12&EW 0"|ur="match 4/8"
Collaborator
- Ramsey @ xinrui : mainly for latex template and tune the card diagrams
Reference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bridge-utils-0.0.13.tar.gz
(22.9 kB
view hashes)
Built Distribution
Close
Hashes for bridge_utils-0.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c8b6f53ffa51845ec11b56fe6eca0b93621e6f033daf04e5a48d19fe6ec5fe4 |
|
MD5 | b49b6d2aa4491ab82e0a9eb2282d99af |
|
BLAKE2b-256 | 8ecb55185a10788f0da4900cae5ac7fdb9b80f6a8bd65701458df9d718fbc416 |