Skip to content

Add more CC licences #6783

@mcanouil

Description

@mcanouil

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:

  • const kAppendixCreativeCommonsLic = [
    "CC BY",
    "CC BY-SA",
    "CC BY-ND",
    "CC BY-NC",
    ];
  • 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
    },
    }
  • - 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

  1. Currently only the following four Creative Commons licences are supported:

    1. CC BY
    2. CC BY-SA
    3. CC BY-ND
    4. 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.

  2. 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>

Metadata

Metadata

Assignees

Labels

documentationDoc improvements & quarto-webenhancementNew feature or requesthtmlIssues with HTML and related web technology (html/css/scss/js)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions