MCPcopy Create free account
hub / github.com/daisy/MathCAT / get_braille

Function get_braille

src/interface.rs:243–253  ·  view source on GitHub ↗

Get the braille associated with the MathML that was set by [`set_mathml`]. The braille returned depends upon the preference for the `code` preference (default `Nemeth`).

(nav_node_id: String)

Source from the content-addressed store, hash-verified

241/// Get the braille associated with the MathML that was set by [`set_mathml`].
242/// The braille returned depends upon the preference for the `code` preference (default `Nemeth`).
243pub fn get_braille(nav_node_id: String) -> Result<String> {
244 // use std::time::{Instant};
245 // let instant = Instant::now();
246 return MATHML_INSTANCE.with(|package_instance| {
247 let package_instance = package_instance.borrow();
248 let mathml = get_element(&package_instance);
249 let braille = crate::braille::braille_mathml(mathml, &nav_node_id)?;
250 // info!("Time taken: {}ms", instant.elapsed().as_millis());
251 return Ok( braille );
252 });
253}
254
255/// Given a key code along with the modifier keys, the current node is moved accordingly (or value reported in some cases).
256/// `key` is the [keycode](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#constants_for_keycode_value) for the key (in JavaScript, `ev.key_code`)

Callers 6

mainFunction · 0.85
timing_testFunction · 0.85
ueb_highlight_24Function · 0.85
test_UEB_start_modeFunction · 0.85
test_brailleFunction · 0.85
test_braille_prefsFunction · 0.85

Calls 2

get_elementFunction · 0.85
braille_mathmlFunction · 0.85

Tested by 4

ueb_highlight_24Function · 0.68
test_UEB_start_modeFunction · 0.68
test_brailleFunction · 0.68
test_braille_prefsFunction · 0.68