Registry / Framework

framework · v0.1.2
Footnote Bind
Resolve forward footnote references and block typesetting while the outstanding count is positive.
Use Footnote Bind
use vendor::footnote_bind::footnote_bind;
Run the example
nest demo footnote_bind@0.1.2
blyxc native-run footnote_bind-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::footnote_bind::footnote_bind;
fn main() {
let arguments = cli_args();
if args_len(arguments) > 0 {
if args_len(arguments) % 2 != 0 {
stderr_line("Expected event and value pairs");
process_exit(2);
}
let mut live = footnote_bind_start();
let mut i = 0;
while i < args_len(arguments) {
let input = args_at(arguments, i + 1);
if !text_is_number(input) {
stderr_line("Expected a whole numeric event value");
process_exit(2);
}
live = footnote_bind_step(live, args_at(arguments, i), text_number(input));
let command = footnote_bind_command(live);
println!(command);
if command == "reject" { process_exit(1); }
i += 2;
}
return;
}
let mut state = footnote_bind_start();
state = footnote_bind_step(state, "start", 0.0);
println!(footnote_bind_command(state));
state = footnote_bind_step(state, "reference", 3.0);
println!(footnote_bind_command(state));
state = footnote_bind_step(state, "resolve", 2.0);
println!(footnote_bind_command(state));
state = footnote_bind_step(state, "typeset", 0.0);
println!(footnote_bind_command(state));
state = footnote_bind_step(state, "resolve", 1.0);
println!(footnote_bind_command(state));
state = footnote_bind_step(state, "typeset", 0.0);
println!(footnote_bind_command(state));
}
Expected output
begin_layout
add_unresolved
bind_references
reject
bind_references
render_proof
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.2 | Download ZIP · Browse files | ed49aef468 | 890cff0eee6ad7743735f89a281bf0657dc330a94bfdb7930f8ac0db6d1f10e7 |
| 0.1.1 | Download ZIP · Browse files | 5b2fc89ad3 | 7322bc9e46ceaf3aa2f1a0108ce200e2b2ffce2238704bceeb6e811eacfb4bd8 |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | b6ff263c754833c96fec4b6a209255ff794d3d16250f2986382041b8c8f8cd34 |