~aleteoryx/tpl

db2916118fe2a6a97df0b0642298977587b91a01 — Aleteoryx 3 months ago c61c781
NC{,-BY}; some features in the wizard I prob won't use
M index.html => index.html +21 -3
@@ 54,11 54,15 @@ async function parse_and_fetch_parts(metadata) {
      continue;
    }
    let [name, file] = part.split(":", 2);
    let subst;
    if (name.includes("|"))
      [name, subst] = name.split("|", 2);

    if (name[0] == "+") {
      format.push({file, optional: name.slice(1), default: true});
      format.push({file, optional: name.slice(1), default: true, subst});
      continue;
    } else {
      format.push({file, optional: name, default: false})
      format.push({file, optional: name, default: false, subst})
    }
  }



@@ 107,8 111,22 @@ async function params_changed() {
  template = templates[license_sel.value];
  license_text.value = "";
  if (include_header.checked) {
    let name = template.name;
    for (const part of template.format) {
      if (!part.subst || (part.optional && !(document.getElementById(part.optional.replace(" ", "-")).checked)))
        continue;
//      console.log(part)

      let [a, b] = part.subst.split(">", 2);
      if (b) {
        name = name.replaceAll(a, b);
      } else {
        name = name + " " + a
      }
    }

    license_text.value +=
      `-- TPL ${template.name} v${template.version}\n`;
      `-- TPL ${name} v${template.version}\n`;
    license_text.value += "-- <https://amehut.dev/~aleteoryx/tpl>\n";
    license_text.value += '-'.repeat(72);
  }

A templates/NC-BY/attrib.txt => templates/NC-BY/attrib.txt +3 -0
@@ 0,0 1,3 @@
Additionally, all reproductions or derivative works must retain all
identification of the $creator:lower$, including pseudonymous
identification, as well as all other copyright notices.

A templates/NC-BY/meta.json => templates/NC-BY/meta.json +11 -0
@@ 0,0 1,11 @@
{
  "name": "Non-Commercial Attribution License",
  "description": "A simple non-commercial use grant, with attribution requirements. Use this if you want people to make stuff with your work, but want people to see what you've made too.",
  "version": "1.0",
  "format": [
    "/NC/main.txt",
    "/NC-BY/attrib.txt",
    "Include Plain Englush Section?:/NC-BY/plain.txt",
    "+Include Liability Disclaimer?:/liability.txt"
  ]
}

A templates/NC-BY/plain.txt => templates/NC-BY/plain.txt +1 -0
@@ 0,0 1,1 @@
In other words, don't make money, and give the $creator:lower$ credit.

A templates/NC/main.txt => templates/NC/main.txt +5 -0
@@ 0,0 1,5 @@
This $medium:lower$ is provided free to use and redistribute by the
$creator:lower$, for all purposes whose focus and intent do not include
monetary gain or commercial advantage. It is against the terms of this
license to reproduce or distribute the content of this $medium:lower$,
or any derivative works, for financial compensation or incentive.

A templates/NC/meta.json => templates/NC/meta.json +10 -0
@@ 0,0 1,10 @@
{
  "name": "Non-Commercial License",
  "description": "A simple non-commercial use grant. Use this if you want people to make stuff with your work, just not money.",
  "version": "1.0",
  "format": [
    "/NC/main.txt",
    "Include Plain Englush Section?:/NC/plain.txt",
    "+Include Liability Disclaimer?:/liability.txt"
  ]
}

A templates/NC/plain.txt => templates/NC/plain.txt +1 -0
@@ 0,0 1,1 @@
In other words, you're fine if you don't make money.

M templates/PD/meta.json => templates/PD/meta.json +2 -2
@@ 4,7 4,7 @@
  "version": "1.0",
  "format": [
    "/PD/main.txt",
    "Plain English Section:/PD/plain.txt",
    "+Liability Disclaimer:/liability.txt"
    "Include Plain English Section?:/PD/plain.txt",
    "+Include Liability Disclaimer?:/liability.txt"
  ]
}

M templates/list.txt => templates/list.txt +2 -0
@@ 1,1 1,3 @@
PD
NC
NC-BY