BBO Discussion Forums: BML - Bridge Bidding Markup Language - BBO Discussion Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

BML - Bridge Bidding Markup Language A way to write system notes

#1 User is offline   Kungsgeten 

  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 943
  • Joined: 2012-April-15
  • Gender:Male

Posted 2013-March-31, 16:24

Hi!

BML is a way to create system notes, via a simple text file, and export it to HTML, LaTeX (which could then be converted to .pdf) and Full Disclosure (Full Disclosure is a way to get your bids alerted automatically while bidding on BBO).

I've written before on BBF about BML, in the "Full Disclosure & Dealer" forum. Now the code is completely rewritten, and since it no longer targets only Full Disclosure, I post about it here.

You can read more about the project, download it and try it out yourself, at GitHub. Here's an example of some BML syntax:

#+TITLE: SAYC

#+AUTHOR: Kungsgeten

#+DESCRIPTION: Natural system with 5+ majors and best minor. 15-17 NT range and weak twos.

* Introduction

  SAYC stands for Standard American Yellow Card. An opening at the
  1-level is usually done with 12+ hcp, but not enough for a game
  force.  Here's the opening structure:

  1CD 3+ suit, 12+ hcp
  1HS 5+ suit, 12+ hcp
  1N  15--17 hcp
  2C  Game forcing or 22--24 balanced
  2X  Weak
  2N  20--21 hcp
  3X  Preemptive

  With 3-3 minors, open 1!c. With 4-4 minors, open 1!d. With a 6 card
  minor and a 5 card major, open with the major unless strong.

* The NT module

  Here's the continuations after a 1NT opening:

  1N---
  2C Stayman
    2D No 4 card major
      2HS Invitational, 5+ suit
      2N  Invitational
      3CD 5+ suit, game forcing
      3HS Smolen
      3N  To play
    2HS 4+ suit
  2red Transfer, 5+ major
  2S Minor suit Stayman
    2N Longer diamonds or equal minor length
    3C Longer clubs
  2N Invitational
  3CD Invitational, 6+ suit
  3N To play

  The 1NT opening may include a 5 card major.

** Transfers

   After a transfer, the following scheme is used:

   1N-2D;
   2H Transfer accept
     2S 5-5 majors, invitational
     2N Invitational
     3CD Natural game force
     3H Invitational, 6+!h
     3N To play
   3H Super accept

   1N-2H;
   2S Transfer accept
     2N Invitational
     3CD Natural game force
     3H 5-5 majors, game forcing
     3S Invitational, 6+!s
     3N To play
   3S Super accept


Here's the html output: SAYC html

And the .pdf generated from the LaTeX output: SAYC pdf
0

#2 User is offline   kenberg 

  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 11,224
  • Joined: 2004-September-22
  • Location:Northern Maryland

Posted 2013-April-01, 07:15

Let's assume, correctly, that I am interested. Let's also assume, maybe correctly, that I am an idiot. By which I mean you should not at all fear that I will be insulted if you explain very simple things to me.
I went to the site, and it said I should download Python3. OK, I have a Python book around somewhere, but it's one of those things I may read sometime. I clicked on the Python link and then on the Python3 link. A lot of stuff there, but I found "Download". Download is not an active link, but there are several active links beneath it. For example there is
Uh huh. I have no idea what this means. MSI? sig? debug information files? I am sitting at a Windows7 with 64 bit technology (I think I said this right). Maybe this is the right thing to download? Both of them? Just asking, before I do a solo flight that I might regret.



Ken
0

#3 User is offline   mycroft 

  • Secretary Bird
  • PipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 7,429
  • Joined: 2003-July-12
  • Gender:Male
  • Location:Calgary, D18; Chapala, D16

Posted 2013-April-01, 11:59

You will need the 64bit MSI installer (MSI is windows for "installer package").

You shouldn't need the debug information files unless something crashes when you run it, or you're going to program Python.

Do make sure you get the Python 3 interpreter rather than the 2.7 one; they are different enough (although both in common use) that if the OP says you need 3, you need 3.
When I go to sea, don't fear for me, Fear For The Storm -- Birdie and the Swansong (tSCoSI)
0

#4 User is offline   Kungsgeten 

  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 943
  • Joined: 2012-April-15
  • Gender:Male

Posted 2013-April-01, 12:00

I do not think you're an idiot at all :) The file you want is the installer, in this case the "Windows X86-64 MSI Installer" that you linked to. People with 32bit Windows should use this instead.
0

#5 User is offline   kenberg 

  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 11,224
  • Joined: 2004-September-22
  • Location:Northern Maryland

Posted 2013-April-01, 18:09

Thanks.
Ken
0

#6 User is offline   Cthulhu D 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,169
  • Joined: 2011-November-21
  • Gender:Not Telling
  • Location:Australia
  • Interests:Overbidding

Posted 2014-November-21, 05:44

Edit 3:

New question: Can you give me some worked examples of the #hide command?

I want to hide all the stupid superaccept continuations from displaying except in FD, but I use #CUT and #PASTE to put them in - does this work?

#CUT NTtransfer
2\R Transfer
2\M Transfer accept
2N 4333 max
3C Doubleton, Max, 4 card support
3D Doubleton, Max, 4 card support
3\M Nusiance accept
4\M 5 card super accept
#ENDCUT







Resolved bug below:
Spoiler

0

#7 User is offline   Siegmund 

  • Alchemist
  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,764
  • Joined: 2004-June-15
  • Gender:Male
  • Location:Beside a little lake in northwestern Montana
  • Interests:Creator of the 'grbbridge' LaTeX typesetting package.

Posted 2014-November-22, 18:24

How customizable is the BML-to-HTML-or-LaTeX post-processing? Suppose, for instance, I didn't want 4-color suit symbols, or I wanted the rebids only indented half as far, etc.

I suppose what I really mean is "how much Python would a person have to learn to do this" -- instead of doing search and replace on the output or something.
0

#8 User is offline   Cthulhu D 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,169
  • Joined: 2011-November-21
  • Gender:Not Telling
  • Location:Australia
  • Interests:Overbidding

Posted 2014-November-25, 03:59

View PostSiegmund, on 2014-November-22, 18:24, said:

How customizable is the BML-to-HTML-or-LaTeX post-processing? Suppose, for instance, I didn't want 4-color suit symbols, or I wanted the rebids only indented half as far, etc.

I suppose what I really mean is "how much Python would a person have to learn to do this" -- instead of doing search and replace on the output or something.


It's a pretty simple set up. For example, changing the suit symbols in html is this 7 lines of code:

text = matchobj.group(0)
text = text.replace('C', '<span class="ccolor">&clubs;</span>')
text = text.replace('D', '<span class="dcolor">&diams;</span>')
text = text.replace('H', '<span class="hcolor">&hearts;</span>')
text = text.replace('S', '<span class="scolor">&spades;</span>')
text = text.replace('N', 'NT')
return text

You just need to change the Spans, or the CSS style sheet. Easy.

The BSS one is the most complex (the way he's implemented it, you need to understand recursion), but you just want to change the LATEX and HTML and that is very simple.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users