juan_gandhi: (VP)
[personal profile] juan_gandhi
  def questionHTML(i: Int, q: String) =
    <span>
      <h3>Question {i+1}</h3>{q}
      <br/><br/><br/><br/><br/><br/>
  </span>

  def variantHTML(v: List[String]) =
    <p style="page-break-after:always;">
      <h1><center>{title}</center></h1>
      {v.zipWithIndex map {case(q,j) => questionHTML(j,q)}}
    </p>

  def html(variants: List[List[String]]) = {
    <html><body>{
      variants map variantHTML
    }</body></html>
  }

Date: 2014-12-07 12:01 am (UTC)
From: [identity profile] nponeccop.livejournal.com
неполнотой своего DSL, которая способствует переносу всей логики за пределы шаблона.

сомнительное удовольствие, но субъективно - помогает в поддержке.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

July 2025

S M T W T F S
  12345
6789 1011 12
13141516171819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 16th, 2025 01:12 am
Powered by Dreamwidth Studios