From db2916118fe2a6a97df0b0642298977587b91a01 Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Sat, 7 Sep 2024 14:21:03 -0400 Subject: [PATCH] NC{,-BY}; some features in the wizard I prob won't use --- index.html | 24 +++++++++++++++++++++--- templates/NC-BY/attrib.txt | 3 +++ templates/NC-BY/meta.json | 11 +++++++++++ templates/NC-BY/plain.txt | 1 + templates/NC/main.txt | 5 +++++ templates/NC/meta.json | 10 ++++++++++ templates/NC/plain.txt | 1 + templates/PD/meta.json | 4 ++-- templates/list.txt | 2 ++ 9 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 templates/NC-BY/attrib.txt create mode 100644 templates/NC-BY/meta.json create mode 100644 templates/NC-BY/plain.txt create mode 100644 templates/NC/main.txt create mode 100644 templates/NC/meta.json create mode 100644 templates/NC/plain.txt diff --git a/index.html b/index.html index b2b2620..982f07a 100644 --- a/index.html +++ b/index.html @@ -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 += "-- \n"; license_text.value += '-'.repeat(72); } diff --git a/templates/NC-BY/attrib.txt b/templates/NC-BY/attrib.txt new file mode 100644 index 0000000..0452651 --- /dev/null +++ b/templates/NC-BY/attrib.txt @@ -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. diff --git a/templates/NC-BY/meta.json b/templates/NC-BY/meta.json new file mode 100644 index 0000000..01b56f5 --- /dev/null +++ b/templates/NC-BY/meta.json @@ -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" + ] +} diff --git a/templates/NC-BY/plain.txt b/templates/NC-BY/plain.txt new file mode 100644 index 0000000..57f35ae --- /dev/null +++ b/templates/NC-BY/plain.txt @@ -0,0 +1 @@ +In other words, don't make money, and give the $creator:lower$ credit. diff --git a/templates/NC/main.txt b/templates/NC/main.txt new file mode 100644 index 0000000..e517393 --- /dev/null +++ b/templates/NC/main.txt @@ -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. diff --git a/templates/NC/meta.json b/templates/NC/meta.json new file mode 100644 index 0000000..54572eb --- /dev/null +++ b/templates/NC/meta.json @@ -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" + ] +} diff --git a/templates/NC/plain.txt b/templates/NC/plain.txt new file mode 100644 index 0000000..51918bf --- /dev/null +++ b/templates/NC/plain.txt @@ -0,0 +1 @@ +In other words, you're fine if you don't make money. diff --git a/templates/PD/meta.json b/templates/PD/meta.json index 35e761f..e5db34d 100644 --- a/templates/PD/meta.json +++ b/templates/PD/meta.json @@ -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" ] } diff --git a/templates/list.txt b/templates/list.txt index d194a89..abc4415 100644 --- a/templates/list.txt +++ b/templates/list.txt @@ -1 +1,3 @@ PD +NC +NC-BY -- 2.43.4