Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Best way to code play dialogue format in EPUB? #70

Open
RachelComerford opened this issue Dec 6, 2018 · 7 comments
Open

Best way to code play dialogue format in EPUB? #70

RachelComerford opened this issue Dec 6, 2018 · 7 comments
Assignees
Labels
Best Practice use for Best Practice documentation questions and suggestions

Comments

@RachelComerford
Copy link
Contributor

RachelComerford commented Dec 6, 2018

Issue source: #eprdctn, https://twitter.com/LauraB7/status/1029371190274605056

Needed: Test HTML author - remember to include outliers, ie long names

Alt text for image from Tweet: Screenshot of dialogue from play. Left side has the name of the character speaking in a right aligned column and is followed by a significant space and then their dialogue in a new right aligned column.

@RachelComerford RachelComerford added the Best Practice use for Best Practice documentation questions and suggestions label Dec 6, 2018
@RachelComerford RachelComerford self-assigned this Dec 6, 2018
@teytag
Copy link
Collaborator

teytag commented Dec 6, 2018 via email

@RachelComerford
Copy link
Contributor Author

Proposed Solution: Use a <div> with display inline blocks https://codepen.io/bgedit/pen/MBRzoJ

HTML

<body>
  <div class="line">
  <div class="speaker" aria-label="speaker">Hansan</div>
  <div class="dialog">Baba, I need to talk to you.</div>
  </div>
    <div class="line">
  <div class="speaker" aria-label="speaker">Baba</div>
  <div class="dialog">Isn't that what we are doing right now?</div>
  </div>
</body>

CSS

body {
  font-size: 1.06em;
  line-height: 1.5;
  max-width: 711px;
  margin: auto;
  padding: 10px; }

div.speaker {
 width: 15%;
 min-width: 100px; 
 display: inline-block;
 margin-top: .5em;
 margin-right: 1em;
 text-transform: uppercase;
 font-weight: 600;
 float: left;
}

div.dialog {
 display: inline-block;
 width: 65%;
 margin-top: .5em;
 min-width: 400px;
}

div.line {
  display: block;
  margin-top: 1em;
}

Known exceptions to solution: Kindle may force justify lines or experience issues with float.

Reading system testing:

Accessibility advantages:

Accessibility disadvantages:

Mobile compatibility advantages:

Mobile compatibility disadvantages:

@dauwhe
Copy link
Contributor

dauwhe commented Dec 6, 2018

Note the HTML spec has a section on marking up conversations: https://html.spec.whatwg.org/multipage/semantics-other.html#conversations

@dauwhe
Copy link
Contributor

dauwhe commented Dec 11, 2018

I've made an EPUB that includes some of the example code above and put it in this repo at https://github.com/w3c/publ-cg/tree/master/best-practices/dialogue-best-practices-test

We have some complications:

  1. There are many ways to style dialogue, all of them valid.

  2. Dialogue varies greatly in structure, from Shakespeare plays in blank verse to Dog 911 on Twitter. Opinions differ on markup.

@garconvacher
Copy link

garconvacher commented Feb 22, 2019

Some A11Y tests on @dauwhe's EPUB with NVDA and VoiceOver (VO).

NVDA / W10 / Readium (Chrome extension)
VO / iOS / Books+Lisa (same results for both)
Screen readers + OS up to date.

content_001.xhtml

  <div class="line">
    <div class="speaker" aria-label="speaker">Hansan</div>
    <div class="dialog">Baba, I need to talk to you.</div>
  </div>
  • NVDA
    • TTS: 'Hansan (pause) Baba, ...'
    • Braille: 'Hansan' (line feed) 'Baba, ...'
  • VO
    • TTS: 'Hansan Baba, ...'
    • Braille: '(caps start)HANSANB(caps stop)aba, ...' (yes, HANSANBaba)
      Note: the braille codifications have different ways to indicate caps but the vast majority use a markup system. e.g.: UEB

content_003.xhtml

<p><span class="speaker" aria-label="speaker">Hansan</span> Baba, I need to talk to you.</p>
  • NVDA and VO
    • TTS: 'Hansan Baba, ...'
    • Braille: 'Hansan Baba, ...'

aria-label is ignored by both VO and NVDA on div or span.
Hack: With Chrome on Windows and Webkit on iOS, NVDA and VO need the fake role="text" on div and span to read the aria-label that will override the content. On iOS, this hack don't work with Books. Strangely, Books is the worst reading app to use with VoiceOver... lot of bugs... and it gets worser with every version of iOS :/

@teytag
Copy link
Collaborator

teytag commented Feb 22, 2019 via email

@garconvacher
Copy link

This don't work:

<style>
    div.speaker span::after {
      content: ": ";
      color: transparent;
      font-size: 0;
    }
</style>

  <div class="line">
    <div class="speaker"><span>Hansan</span></div>
  </div>

This do the trick:

<style>
    div.speaker span {
      color: transparent;
      font-size: 0;
    }
</style>

  <div class="line">
    <div class="speaker">Hansan<span>: </span></div>
  </div>

TTS: 'Hansan (pause) Baba, ...'
Braille: 'HANSAN: Baba, ...'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Best Practice use for Best Practice documentation questions and suggestions
Projects
None yet
Development

No branches or pull requests

4 participants