-
Notifications
You must be signed in to change notification settings - Fork 409
Description
It seems to be a good/simple enhancement.
Note that PRs are always welcome and in this case, it seems straightforward for you to contribute if you feel like it:
quarto-cli/src/format/html/format-html-appendix.ts
Lines 39 to 45 in f87976c
const kAppendixCreativeCommonsLic = [ "CC BY", "CC BY-SA", "CC BY-ND", "CC BY-NC", ]; quarto-cli/src/resources/filters/modules/license.lua
Lines 11 to 49 in f87976c
local function ccLicenseUrl(type, lang, version) local langStr = 'en' if lang ~= nil then langStr = pandoc.utils.stringify(lang) end if langStr:lower() == 'en' then return 'https://creativecommons.org/licenses/' .. type:lower() .. '/' .. version .. '/' else return 'https://creativecommons.org/licenses/' .. type:lower() .. '/' .. version .. '/deed.' .. langStr:lower() end end local licenses = { ["cc by"] = { type = "creative-commons", licenseUrl = function (lang, version) return ccLicenseUrl("by", lang, version) end }, ["cc by-sa"] = { type = "creative-commons", licenseUrl = function (lang, version) return ccLicenseUrl("by-sa", lang, version) end }, ["cc by-nd"] = { type = "creative-commons", licenseUrl = function (lang, version) return ccLicenseUrl("by-nd", lang, version) end }, ["cc by-nc"] = { type = "creative-commons", licenseUrl = function (lang, version) return ccLicenseUrl("by-nc", lang, version) end }, } quarto-cli/src/resources/schema/document-metadata.yml
Lines 49 to 73 in f87976c
- name: license schema: maybeArrayOf: anyOf: - object: properties: type: string: description: The type of the license. link: string: description: A URL to the license. text: string: description: The text to display for the license. - string tags: formats: [$html-doc, $jats-all] description: short: The License for this document, if any. (e.g. `CC BY`) long: | The license for this document, if any. Creative Commons licenses `CC BY`, `CC BY-SA`, `CC BY-ND`, `CC BY-NC` will automatically generate a license link in the document appendix. Other license text will be placed in the appendix verbatim.
Discussed in #6770
Originally posted by the-solipsist September 8, 2023
Description
-
Currently only the following four Creative Commons licences are supported:
- CC BY
- CC BY-SA
- CC BY-ND
- CC BY-NC
This means that licences such as CC BY-NC-SA are not supported. It's not clear why, given that the code to support all the CC licences won't add any complexity.
-
If
licence:metadata is CC BY-NC, and the language is en-IN, then it generates a link to https://creativecommons.org/licenses/by-nc/4.0/deed.en-in (with that URL as the text).It would be preferable to use Creative Commons badges or icons, with the appropriate URL instead. Or at the very least, to use the licence short code as the anchor text for the link. Even better would be to generate text + machine-readable code instead of just a bare URL, but this might run into internationalization issues.
<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" property="dct:title" rel="dct:type">A pantent conundrum</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://indianexpress.com/article/opinion/columns/a-patent-conundrum/" property="cc:attributionName" rel="cc:attributionURL">Pranesh Prakash</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">Creative Commons Attribution-NonCommercial 4.0 International License</a>.
rather than
<section class="quarto-appendix-contents"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div id="quarto-reuse" class="quarto-appendix-contents"><div><a rel="license" href="[https://creativecommons.org/licenses/by-nc/4.0/deed.en_in](view-source:https://creativecommons.org/licenses/by-nc/4.0/deed.en_in)">https://creativecommons.org/licenses/by-nc/4.0/deed.en_in</a></div></div></section>