How to display gobans in our forums: [goban]

How to display gobans in our forums: [goban]  

  By: climu on July 17, 2017, 4:56 p.m.

Here is a showcase of how we can display a goban in our forum posts.

The proper way to show a goban is with the [goban]. Just replace [goboon] with [goban] to show a goban.

Basic usage

Basic usage is [goboon sgf=sgf_url][/goboon] where sgf_url is the url of a sgf file. For now one can only use a sgf file that is hosted on OSR server (url start with https://openstudyroom.org/). Since one can attach a sgf file to a forum post, it's no big deal.

When the post only have one attachment and this attachment is a sgf file, it's no need to specidy the sgf argument. [goban] will work.

Move number

If you want to initialise your goban on a specific move, just enter move=move_number.

Simple layout

One can choose to show only a goban and hide the comments and game-info boxes by adding the option simple=true

Choose width

One can choose the goban width (and hence height) with the option width=value. Where value is pure css width such as:

  • 600px
  • 50%

Hide coordinates

Coordinates are show by default but one can choose to hide them by using: coord=false

Static Diagram

One can choose to render a static diagram by using diagram=true.
IWith static diagram, you can choose what section of the diagram will be render using limits=top, right, bottom, left. Each limit indicate the number of row/line to be skipped.

Note that the limits option is NOT compatible with coordinates. Hence using it will automaticly deactivate the coordinate around the goban.

Text adaptation: float

Default behavior is the goban taking all the width of the page: no text adaptation. If you want the goban to be on the left or right of the page and the text to addapt on the other side, one can use the float=left

Comments

You can write some comments between [goboon] and [/goboon] like that: [goboon]some coments here[/goboon].

In the comments, coordinates and move number will be interact with the goban with the folowing syntax:

  • move 13 for move number
  • a15 or A15 for coordinates

See the examples in next post.


 Last edited by: climu on Jan. 23, 2018, 9:17 p.m., edited 18 times in total.

Exemples  

  By: climu on Aug. 11, 2017, 8:22 a.m.

Examples :

Post only have one sgf file attached so we don't need to tell the sgf url.

A diagram with width=300, and some limits

[goboon diagram=true width=300px move=17 limits=0,9,12,0 ][/goboon]

[goban diagram=true sgf=https://openstudyroom.org/media/machina/attachments/ke-jie-huang-jingyuan_1FZEQaf.sgf width=300px move=17 limits=0,9,12,0][/goban]

A basic goban with set to move 11

[goboon move=11][/goboon]

[goban move=11][/goban]

A simple goban with width= 400px set to move 3 and no coordinates, float left

[goboon sgf=https://openstudyroom.org/media/machina/attachments/ke-jie-huang-jingyuan_1FZEQaf.sgf simple=true width=400px coord=false move=3 float=right]

Move 5: Black enclosure at O16 is alphago style !

Move 24 is a cut [/goboon]

[goban sgf=https://openstudyroom.org/media/machina/attachments/ke-jie-huang-jingyuan_1FZEQaf.sgf simple=true width=400px move=3 coord=false float=right]

Move 5: Black enclosure at O16 is alphago style !

move 24 is a cut.[/goban]


 Last edited by: climu on June 17, 2020, 6:10 a.m., edited 41 times in total.

Re: How to display gobans in our forums  

  By: climu on Aug. 11, 2017, 11:20 p.m.

Some update:

  • we can set minimal layout with simple="true"
  • we can choose goban width (and hence height) with width=700px/%
  • coordinates are shown by default but can be deactivated with coord="false"
  • goban is shown in preview.

working on:

  • allow users to add a static diagram
  • Allow users to edit the sgf directly in the online sgf viewer

 Last edited by: climu on Aug. 12, 2017, 10:13 a.m., edited 3 times in total.

Re: How to display gobans in our forums: [goban]  

  By: climu on Aug. 12, 2017, 10:17 a.m.

More updates:

  • using diagram="true" one ca render a static diagram.
  • With diagram, one can choose the limit of the board to be shown with the optional key limits="top,right,bottom,left'
  • one can add coments to a goban as such [goboon]some coments[/goboon]. In such comments, coordinates will be higlited and move number too.

Working on:

  • Choosing goban adaptation with the tex (float left or right).
  • Allow users to edit the sgf directly in the online sgf viewer

 Last edited by: climu on Sept. 18, 2017, 5:25 p.m., edited 1 time in total.

Re: How to display gobans in our forums: [goban]  

  By: climu on Aug. 23, 2017, 9:32 p.m.

Update:

  • Coments are not working. A bug in Shortcode.js it seems. We deactivate comments for now.
  • Adaptation works now

Working on:

  • We need to use a proper python parser now since Shortcode.js is bugging. In other words, we need to rewrite almost everything.

 Last edited by: climu on Aug. 23, 2017, 9:33 p.m., edited 1 time in total.

Re: How to display gobans in our forums: [goban]  

  By: climu on Sept. 18, 2017, 5:27 p.m.

We just rewrite our a js parser from scratch.

updates:

  • One needs to close the tag. [goboon] doesn't work but [goboon][/goboon] does.
  • we can add comments [goboon]comments[/goboon]!

TODO:

  • Comments can only have one line for now :(

 Last edited by: climu on Sept. 18, 2017, 9:08 p.m., edited 2 times in total.

Re: How to display gobans in our forums: [goban]  

  By: climu on Sept. 20, 2017, 3:34 p.m.

Update: multiline coments are working now !

TODO: allow users to edit sgf directly in the forum.