Explorer

html-ui.project-line

description
type
Fn(project: String, branch: String, line: String) -> List<@html.node>
expression
fn(project$0, branch$1, line$2) =>
  let colon$3 = @core.string-index-of(text: $2, target: ": ", start: 0);
  let space$4 = @core.string-index-of(text: $2, target: " ", start: 0);
  match @core.and(
      left: @core.less-than(left: 0, right: $3),
      right: @core.equal(left: $4, right: @core.plus(left: $3, right: 1))
    ) {
    false =>
      @html-ui.link-refs(text: $2),
    true =>
      let name$5 = @core.string-slice(value: $2, start: 0, end: $3);
      @core.list-concat(
        left: [
          @html.element(
            name: "a",
            attributes: [{name: "href", value: @core.string-join(items: ["/p/", $0, "/", $1, "/", $5], separator: "")}],
            children: [@html.text(text: $5)]
          )
        ],
        right: @html-ui.link-refs(text: @core.string-slice(value: $2, start: $3, end: @core.string-length(value: $2)))
      )
  }
visibility
public
html-ui.project-line (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: 6LSd4RruA9YIkplrsyvayyFCzzFrXwPINmTF3UpKTuE
content hash: Ybcc6TAkCkLLUfX5CqnIe3eM5MXYfEiQ3TDadymi5Vk