GithubHelp home page GithubHelp logo

thecrawler1 / hhp-render Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thlorenz/hhp-render

0.0 0.0 0.0 1.19 MB

Renders PokerHands parsed with hhp to different formats, i.e. PokerStars and message boards.

Home Page: https://github.com/thlorenz/hhp-render

License: MIT License

JavaScript 98.51% Makefile 1.16% CSS 0.34%

hhp-render's Introduction

hhp-render build status

Renders PokerHands parsed with hhp to different formats, i.e. PokerStars and message boards.

Usage

const parse = require('hhp')
const analyze = require('hha')
const { script, summary } = require('hha')
const { renderHtml } = require('hhp-render')

const txt = fs.readFileSync(file, 'utf8')
const parsed = parse(txt)
const analyzed = analyze(parsed)
const scripted = script(analyzed)
const summarized = summarize(scripted)

const rendered = renderHtml({ summary })
console.log(rendered) // prints hand in html format

Status

Renders to html, different forums and PokerStars. Note that only for PokerStars a binary interface has been exposed. Also all renderers require a script produced with hha except for PokerStars which renders a hand that was parsed with hhp but not analyzed.

hhp-render <source-dir> <target-dir> --noreveal

  Converts hand histories inside source dir to
  PokerStars format and writes them to the target dir.

  If --noreveal is NOT supplied revealed hands will be
  included as mucked hands.

Installation

npm install hhp-render

renderPokerStars

Renders an hhp parsed hand in PokerStars format.

Parameters

  • hand Object the parsed hand
  • $0 Object options
    • $0.muckRevealed Object? if true includes cards revealed via Ignition as mucks (optional, default true)

Returns string hand rendered to be importable as PokerStars hand

renderHtml

Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to HTML format.

Parameters

  • $0 Object the configuration of the renderer
    • $0.text String? text to start with (optional, default '')
    • $0.summary Object the parsed then analyzed, scripted and summarized
    • $0.amountAsBB Boolean? show all amounts in big blind dominatians (optional, default false)
    • $0.showHeroCards Boolean? show hero cards as part of hands (i.e. don't hide in spoilers) (optional, default true)

Returns String the rendered hand

renderFacebook

Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to facebook format.

Parameters

  • $0 Object the configuration of the renderer (same as renderHtml)

Returns String the rendered hand

forums.renderTwoPlusTwo

Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to 2+2 forum format.

Parameters

  • $0 Object the configuration of the renderer (same as renderHtml)

Returns String the rendered hand

forums.renderPocketFives

Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to pocket fives forum format PokerXFactor, CardRunners, IntelliPoker formats are identical.

Parameters

  • $0 Object the configuration of the renderer (same as renderHtml)

Returns String the rendered hand

License

MIT

hhp-render's People

Contributors

thecrawler1 avatar thlorenz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.