File tree Expand file tree Collapse file tree 3 files changed +73
-2
lines changed
Expand file tree Collapse file tree 3 files changed +73
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ All changes included in 1.6:
1515## ` html ` Format
1616
1717- Fix ` kbd ` element styling on dark themes.
18+ - ([ #10761 ] ( https://github.com/quarto-dev/quarto-cli/issues/10761 ) ): Add support for ` licence: CC0 ` to automatically link to Creative Commons licence [ CC0 1.0] ( https://creativecommons.org/publicdomain/zero/1.0/ ) .
1819
1920## ` revealjs ` Format
2021
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ const kAppendixCreativeCommonsLic = [
4646 "CC BY-NC-ND" ,
4747] ;
4848
49+ const kAppendixCCZero = "CC0" ;
50+
4951const kStylePlain = "plain" ;
5052const kStyleDefault = "default" ;
5153
@@ -455,9 +457,13 @@ function creativeCommonsLicense(
455457 | "CC BY-NC-SA" ,
456458 version : version || "4.0" ,
457459 } ;
458- } else {
459- return undefined ;
460460 }
461+ } else if ( license === kAppendixCCZero ) {
462+ // special case for this creative commons license
463+ return {
464+ base : kAppendixCCZero ,
465+ version : "1.0" ,
466+ } ;
461467 } else {
462468 return undefined ;
463469 }
@@ -467,6 +473,14 @@ function creativeCommonsLicense(
467473}
468474
469475function creativeCommonsUrl ( license : string , lang ?: string , version ?: string ) {
476+ // Special case for CC0 as different URL
477+ if ( license === kAppendixCCZero ) {
478+ return {
479+ url : `https://creativecommons.org/publicdomain/zero/${ version } /` ,
480+ text : `CC0 ${ version } ` ,
481+ inlineLink : true ,
482+ } ;
483+ }
470484 const licenseType = license . substring ( 3 ) ;
471485 if ( lang && lang !== "en" ) {
472486 return {
Original file line number Diff line number Diff line change 1+ ---
2+ format :
3+ html+zero :
4+ license : " CC0"
5+ html+cc :
6+ license : " CC BY"
7+ html+text :
8+ license : " This work is dedicated to the Public Domain"
9+ html+custom :
10+ license :
11+ text : >
12+ Permission is granted to copy, distribute and/or
13+ modify this document under the terms of the GNU Free
14+ Documentation License, Version 1.3 or any later version
15+ published by the Free Software Foundation; with no
16+ Invariant Sections, no Front-Cover Texts, and no
17+ Back-Cover Texts. A copy of the license is included in
18+ the section entitled "GNU Free Documentation License
19+ type : open-access
20+ url : https://www.gnu.org/licenses/fdl-1.3-standalone.html
21+ _quarto :
22+ tests :
23+ html+zero :
24+ ensureHtmlElements :
25+ - ['a[rel="license"][href="https://creativecommons.org/publicdomain/zero/1.0/"]']
26+ - []
27+ ensureFileRegexMatches :
28+ - ['CC0 1.0']
29+ - []
30+ html+cc :
31+ ensureHtmlElements :
32+ - ['a[rel="license"][href="https://creativecommons.org/licenses/by/4.0/"]']
33+ - []
34+ ensureFileRegexMatches :
35+ - ['CC BY 4.0']
36+ - []
37+ html+text :
38+ ensureHtmlElements :
39+ - ['h2 + div.quarto-appendix-contents']
40+ - []
41+ ensureFileRegexMatches :
42+ - ['This work is dedicated to the Public Domain']
43+ - []
44+ html+custom :
45+ ensureHtmlElements :
46+ - ['a[rel="license"][href="https://www.gnu.org/licenses/fdl-1.3-standalone.html"]']
47+ - []
48+ ensureFileRegexMatches :
49+ - ['GNU Free Documentation License']
50+ - []
51+ ---
52+
53+
54+ ## Title
55+
56+ This doc will have an appendix part with a licence as a link to the right creative common url
You can’t perform that action at this time.
0 commit comments