Skip to main content

markdown extension for bridge PBN & xinrui

Project description

mdbridge

markdown extension for writing bridge article, a fast way to write qualified articles from existing xinrui url and bbo lin url

<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
https://www.bridgebase.com/myhands/fetchlin.php?id=765880487&when_played=1610464081
deal
auction
</pre>

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)

Samples

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 or pandoc 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdbridge-0.3.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdbridge-0.3.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file mdbridge-0.3.1.tar.gz.

File metadata

  • Download URL: mdbridge-0.3.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.5

File hashes

Hashes for mdbridge-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0bf4c4b9bbb9f365c8cddcabbb8cd91175ee80a542736f13032c75a70f8a1a7b
MD5 aca9caac4190e41bb430e4011e51bdeb
BLAKE2b-256 336fb00d241f02a8e537f73c1f50a0f3e3b446275d580499611256d6d9c87fa8

See more details on using hashes here.

File details

Details for the file mdbridge-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: mdbridge-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.5

File hashes

Hashes for mdbridge-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2bdebbcdb5e6c56a4bfda4138b013083a125883915951d051779754a117fd385
MD5 ef8bee113da2805481d7c047e81c4db3
BLAKE2b-256 1dc9229a482e86a98ce57578d187029ba4e0624090319e43e8794cafad655fc2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page