Generate more semantic HTML

finchie
Nov 18, 2023, 4:02 PM
LEJN3E4QCBMUTQQKGKNHHAO6ER7R76SXEKBL46QAWZ63D3QRFLVQC

Dependencies

  • [2] MIY7QPYK Refactor argument handling into a separate file
  • [3] C73UJ7ZY Create simple `xilem_html` demo
  • [4] A4E5KLI2 Turn arguments into sidebar
  • [5] ALCCL4VK Create basic styling

Change contents

  • replacement in src/arg.rs at line 26
    [2.1258][2.1258:1516]()
    el::div((
    match supported_type_description {
    ArgType::String => "string",
    ArgType::Other => "other",
    },
    el::div("placeholder content").attr("class", "hover_content"),
    ))
    .attr("class", "hoverable")
    [2.1258]
    [2.1516]
    el::span(match supported_type_description {
    ArgType::String => "string",
    ArgType::Other => "other",
    })
  • edit in src/arg.rs at line 35
    [2.1647]
    [2.1647]
    .map(el::span)
  • replacement in src/arg.rs at line 58
    [2.2324][2.2324:2343]()
    Some(el::div((
    [2.2324]
    [2.2343]
    Some(el::section((
  • replacement in src/arg.rs at line 65
    [2.2537][2.2537:2608]()
    String::from(if let Ok(arg_matches) = state.arg_matches.as_ref() {
    [2.2537]
    [2.2608]
    el::span(if let Ok(arg_matches) = state.arg_matches.as_ref() {
  • edit in src/arg.rs at line 81
    [2.3013]
    [2.3013]
    fn documentation(arg: &Arg) -> impl ViewSequence<Arg> {
    if let Some(short_help) = arg.get_help() {
    Some(el::details((
    el::summary(short_help.to_string()),
    arg.get_long_help()
    .map(ToString::to_string)
    .unwrap_or_default()
    .strip_prefix(&short_help.to_string())
    .unwrap_or("No description provided")
    .to_string(),
    )))
    } else {
    None
    }
    }
  • replacement in src/arg.rs at line 122
    [2.3848][2.3848:3862]()
    el::div((
    [2.3848]
    [2.3862]
    el::section((
  • edit in src/arg.rs at line 127
    [2.4018][2.4018:4038]()
    el::br(()),
  • replacement in src/arg.rs at line 128
    [2.4067][2.4067:4110]()
    el::div((env(arg), aliases(arg))),
    [2.4067]
    [2.4110]
    env(arg),
    aliases(arg),
  • replacement in src/arg.rs at line 131
    [2.4148][2.4148:4456]()
    el::div((
    // One-line short help
    arg.get_help()
    .map(|short_help| el::i(short_help.to_string())),
    el::br(()),
    // Long-form help
    arg.get_long_help()
    .map(|long_help| el::q(long_help.to_string())),
    )),
    [2.4148]
    [2.4456]
    documentation(arg),
  • edit in index.html at line 5
    [3.12][3.12:486]()
    .hoverable {
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
    border-bottom: 2px dashed black;
    }
    .hoverable .hover_content {
    display: none;
    visibility: hidden;
    position: absolute;
    left: 125%;
    top: 0%;
    }
    .hoverable:hover .hover_content {
    display: block;
    visibility: visible;
    }
  • replacement in index.html at line 19
    [3.352][3.352:380]()
    flex-shrink: 1;
    [3.352]
    [3.380]
    flex-wrap: nowrap;
    margin-right: 80%;
  • edit in index.html at line 29
    [3.550]
    [3.636]
    blockquote {
    margin-left: 0px;
    padding-left: 5px;
    border-left: 3px solid #ccc;
    }
    section {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    }