New Braille File Format for DBT Users

Version 2.1 for DBT 12.7 dated 9/04/2023

Introduction

Duxbury Systems has the goal of allowing a user with a braille device to write an academic paper on the braille device in braille with all formatting incorporated in the braille. We envision a user connecting to a computer to copy the file onto the computer. A future version of DBT will import the file, translate to inkprint and export (save as) to MS Word. At this point, quite a bit of this is done in DBT 12.7 and in command line programs you can download to work with your copy of DBT 12.7.

We are devising a new file format for writing braille on your braille device containing format commands for DBT. These formatting commands look like HTML. In many cases, they are HTML. We like to call this "braille html". To work with this material, you need a copy of Duxbury DBT 12.7. DBT 12.7 has some new features to assist with this project.

Eventually, all this work will be built into a future DBT. Temporarily, you need to run "stand-alone" conversion programs at the MS-DOS command line. I know running the conversions from the command line is a pain. The more we rewrite and debug outside of DBT, the easier the final integration into DBT will be. Here is a list of expectation: you need to operate at the command line, and be able to unzip this software. You also need to be aware of your directory structure, file types, file extensions, and other mundane details.

Project Elements

The use case we are looking at is a student writing on a braille notetaker for the preparation of inkprint output using MS Word via Duxbury DBT. Yes, you can do this now, but the results are not as good as they can be. Here are some elements of DBT being worked on.

Taken together, these elements suggest that someone could write a PhD thesis on a braille notetaker and pop it out in Word. Two things: back up your braille notetaker if you are going to try this, and e-mail languages@duxsys,com to get involved in this project.

It is not a goal to make the braille html file to look good in a browser. Instead the goal is to allow the html markup be easy to read and write on a braille device. Only a few style names from DBT are changed to avoid making it difficult to learn a whole new system.


Version History

This project started in Dec. 2022.

Version 1.2 handles lists better. The bru to htm conversion now defaults to only showing paragraph markup when it changes. If you want to have all paragraph markup, add "all" as a third parameter (see below).

Version 1.3 focused on making sure that anything in a in a DBT bru file can be reproduced in the html file. With a further conversion back to bru, we want, where possible, to reconstruct the original bru file.

Version 1.4 handles hierarchy properly. The |hl2 is matched with <li 2>, etc. See below for details.

Version 1.45 adds the smooth program (since renamed) to improve the output from Duxbury-generated inkprint html files.

Version 1.5 renames smooth to fix-links; code in DBT changed to improve export to html/Word

Version 2.0 is designed for DBT 12.7, which incorporate smooth/fix-links.

Version 2.1 redoes the commands for language switching.


Downloading the Files

All the files are zipped up. Please unpack them into a folder that is easy to find. Click here to download.

All this is the work of David Holladay at Duxbury Systems. Contact him at david@duxsys.com


Things to Note:


Table of Markup

#FromTo DBTFormat Role
1<brlhtm>required trigger
2<t>></p>|es~para.start body text paragraph
3</p>|ee~para.end paragraph
4<p para>|es~para. start body text paragraph
5</p para>|ee~para.end paragraph
6<para>|es~para.start body text paragraph
7</para>|ee~para.end paragraph
8<p lt>|< alternate paragraph marker
9<|->|-hard hyphen
10<p l>|l alternate paragraph marker
11<list>|es~list.list item (ordered or unordered)
12</list>|ee~list.end list item
13<li>|l |hl1list item (ordered or unordered)
14</li>end list item
15<li 2>|l |hl2list item level 2
16<li 3>|l |hl3list item level 3
17<li 4>|l |hl4list item level 4as
18<title>|es~tp.title. start title
19</title>|ee~tp.title. end title
20<h1>|es~h1. heading level 1
21</h1>|ee~h1.end heading level 1
22<h2>|es~h2. heading level 2
23</h2>|ee~h2.end heading level 2
24<h3>|es~h3. heading level 3
25</h3>|ee~h3.end heading level 3
26<h4>|es~h4. heading level 4
27</h4>|ee~h4.end heading level 4
28<ol>|es~olstart ordered list
29</ol>|ee~olend ordered list
30<ul>|es~list.start unordered list
31</ul>|ee~list.end unordered list
32<center>|es~center start centering
33</center>|ee~center end centering
34<html>|es~htmlstart html (html group)
35</html>|ee~htmlend html (html group)
36<head>|es~headstart head (html group)
37</head>|ee~headend head (html group)
38<body>|es~bodystart body (html group)
39</body>|ee~bodyend body (html group)
40<runninghead>|es~RunningHead.start running head
41<RunningHead>|es~RunningHead.start running head
42</runninghead>|ee~RunningHead.end running head
43</RunningHead>|ee~RunningHead.end running head
44<blockquote>|es~blockquotestart block quote
45</blockquote>|ee~blockquoteend block quote
46<|no-par>|no-parrequired by DBT
47<|spacing>|spacing required by DBT
48<|compress>|compress required by DBT
49<brlinline>|es~brlinlinestart braille
50</brlinline>|ee~brlinline`end braille
51<compinline>|es~compinline start computer notation
52</compinline>|ee~compinline end computer notation
53<ndt>|es~ndtstart dictionary word
54</ndt>|ee~ndtend dictionary word
55<table>|htbs;r:0:0:b:n:astart table (table group)
56</table>|htbeend table (table group)
57<tr><td>|l start table row raw (table group)
58<tr><th>|l end table row raw (table group)
59<tr>|l start table row (table group)
60</tr>end table row (table group)
61<td>|>start table item (table group)
62</td>end table item (table group)
63<th>|>start table column label item (table group)
64</th>end table column label item (table group)
65<tp.general>|es~tp.general.title
66</tp.general>|ee~tp.general.end title
67<hr>|es~hrhorizontal rule (html group)
68<br>|<line break
69<br />|<line break
70<a href=|es~astart link (html group)
71</a>|ee~aend link (html group)
72</a`>|ee~aend link (html group)
73<contents>|es~TOC:marker.start entire toc
74</contents>|ee~TOC:marker.end entire toc
75<toc1>|hl1 toc level 1
76</toc1>
77<toc2>|hl2 toc level 2
78</toc2>
79<toc3>|hl3 toc level 3
80</toc3>
81<toc4>|hl4 toc level 4
82</toc4>
83<pg-num>|fr;p~". page#
84<pg>|pgpage tab
85<arabic>|lnb~arastart Arabic
86</arabic>|lnb~end Arabic
87<biblical-langs>|lnb~qbistart Biblical Languages
88</biblical-langs>|lnb~end Biblical Languages
89<french>|es~frenchstart French style
90</french>|ee~frenchend French style
91<french2>|lnb~fra-xufstart French
92</french2>|lnb~end French
93<german>|es~germanstart German style
94</german>|ee~germanend German style
95<german2>|lnb~deustart German
96<german2>|lnb~end German
97<greek>|lnb~ellstart Greek
98</greek>|lnb~end Greek
99<hebrew>|lnb~heb-isstart Hebrew
100</hebrew>|lnb~end Hebrew
101<hindi>|lnb~hinstart Hindi
102</hindi>|lnb~end Hindi
103<ipa>|lnb~qipstart IPA
104</ipa>|lnb~end IPA
105<italian>|es~italianstart Italian style
106</italian>|ee~italianend Italian style
107<latin>|es~latinstart Latin style
108</latin>|ee~latinend Latin style
109<math>|es~math start math style
110</math>|ee~math end math style
111<portuguese>|es~portuguesestart Portuguese style
112</portuguese>|ee~portugueseend Portuguese style
113<russian>|lnb~russtart Russian
114</russian>|lnb~end Russian
115<spanish>|es~spanishstart Spanish style
116</spanish>|ee~spanishend Spanish style
117<spanish2>|lnb~spastart Spanish
118</spanish2>|lnb~end Spanish
119<note>|es~note.start note
120</note>|ee~note.end note
121<tnote>|es~tnotestart hyperlink
122</tnote>|ee~tnoteend hyperlink
123<hyperlink>|es~hyperlink start transcriber note
124</hyperlink>|ee~hyperlink end transcriber note
125<tm>entry for nightmare
126<t>><brlinline>entry for hard
127<uoq~201c>|uoq~201cgrouping quotes
128<q~_>.-underbar
129<null>|nullend of this list

Writing Formatting Commands from Braille


Switching Languages

DBT has two ways of switching languages: switching styles and switching translation tables. Switching styles depends on your template. Switching DBT translation tables can give unexpected results if used improperly. In the table below, entries marked styles uses switching styles the rest use switching translation tables. For French and German, you can use your choice of methods.

Commands for Switching Languages

#FromTo DBTFormat Role
85<arabic>|lnb~ara start Arabic
86</arabic>|lnb~ end Arabic
87<biblical-langs>|lnb~qbi start Biblical Languages
88</biblical-langs>|lnb~ end Biblical Languages
89<french>|es~french start French style
90</french>|ee~french end French style
91<french2>|lnb~fra-xuf start French
92</french2>|lnb~ end French
93<german>|es~german start German style
94</german>|ee~german end German style
95<german2>|lnb~deu start German
96<german2>|lnb~ end German
97<greek>|lnb~ell start Greek
98</greek>|lnb~ end Greek
99<hebrew>|lnb~heb-is start Hebrew
100</hebrew>|lnb~ end Hebrew
101<hindi>|lnb~hin start Hindi
102</hindi>|lnb~ end Hindi
103<ipa>|lnb~qip start IPA
104</ipa>|lnb~ end IPA
105<italian>|es~italian start Italian style
106</italian>|ee~italian end Italian style
107<latin>|es~latin start Latin style
108</latin>|ee~latin end Latin style
109<math>|es~math start math style
110</math>|ee~math end math style
111<portuguese>|es~portuguese start Portuguese style
112</portuguese>|ee~portuguese end Portuguese style
113<russian>|lnb~rus start Russian
114</russian>|lnb~ end Russian
115<spanish>|es~spanish start Spanish style
116</spanish>|ee~spanish end Spanish style
117<spanish2>|lnb~spa start Spanish
118</spanish2>|lnb~ end Spanish

Mathematics

DBT has a nice feature to import a braille file as containing Nemeth code. This does not work with bru files (yet). Use the format tags <math> and </math> to enclose braille mathematics. How that is handled depends on your DBT template.


Conversion Steps

  1. Bring your braille file to your computer (from your braille device), put the file into the directory with your downloaded files. Assume the file is named house.
  2. Add the required header at the top.
  3. Perform (at the DOS Prompt): new2bru house.htm house.bru<Enter>
  4. Open DBT and open the new file
  5. Specify the file type Duxbury Formatted Braille
  6. If it does not work, contact david@duxsys.com

Running Thing Backwards

If you want to, you can start with a braille file in DBT and read it on your braille device with the new formatting markup.

  1. Start with a file in DBT. If it is inkprint, translate to braille.
  2. Choose Save As from the DBT file menu.
  3. Choose Duxbury Coded Braille (*.bru) as the file type.
  4. For convenience, save the file in the same directory as you unpacked this software. Assume the file is named farm
  5. Perform (at DOS Prompt): bru2new farm.bru farm.htm<Enter>
  6. Copy the new file onto your braille device.
  7. Alternative command (for no deletion of duplicated markup): bru2new farm.bru farm.htm all<Enter>
  8. If there is a formatting command that got garbled, contact david@duxsys.com

Applying a Template to a Word File

We have a Word Template to enhance Word files called trial-michigan.dotx. It is freely distributed by the University of Michigan.

Apply a Word Template to an existing Word document

  1. Open the Word document you will apply template to, and click File > Options to open the Word Options dialog box.
  2. In the Word Options dialog box, please (1) click Add-ins in the left bar, (2) select Templates from the Manage drop down list, and (3) click the Go button.
  3. In the new opening Templates and Add-ins dialog box, please check the Automatically update document styles option, and click the Attach button.
  4. In the Attach Template dialog box, please (1) open the folder containing the personal template you will apply, (2) select the specified personal template, and (3) click the Open button.
  5. Click the OK button when it returns to the Templates and Add-ins dialog box.

Required Header

This text is in the file header.txt

<brlhtm>
<no-par> <spacing> <compress>

David's Debugging

David has a batchfile do.bat, which takes a bru file from DBT, converts to the new format, and then converts back to bru (with an x added to the file name). By comparing these files, and by testing how the new bru file loads into DBT, David debugs this material.