From a0f7ba909905ea917f47154cb5b18b8f108e0613 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 3 Jul 2017 17:14:57 +0200 Subject: Properly document third party code in examples Move files from marked, markdown.css to a 3rdparty directory, and properly document them with a qt_attribution.json file. Finally, reference the (automatically generated) documentation in the respective examples documentation. Task-number: QTBUG-61706 Change-Id: I8fd3f894e6e81647bc4804df784b1e00b83d12d6 Reviewed-by: Alexandru Croitor --- .../recipebrowser/doc/src/recipebrowser.qdoc | 14 ++++++++- examples/webengine/recipebrowser/recipebrowser.pro | 4 +++ .../resources/pages/assets/3rdparty/3RDPARTY.md | 23 -------------- .../pages/assets/3rdparty/MARKDOWN-LICENSE.txt | 16 ++++++++++ .../pages/assets/3rdparty/MARKED-LICENSE.txt | 19 ++++++++++++ .../resources/pages/assets/3rdparty/default.md | 12 -------- .../pages/assets/3rdparty/qt_attribution.json | 35 ++++++++++++++++++++++ .../recipebrowser/resources/resources.qrc | 1 - 8 files changed, 87 insertions(+), 37 deletions(-) delete mode 100644 examples/webengine/recipebrowser/resources/pages/assets/3rdparty/3RDPARTY.md create mode 100644 examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt create mode 100644 examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt delete mode 100644 examples/webengine/recipebrowser/resources/pages/assets/3rdparty/default.md create mode 100644 examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json (limited to 'examples/webengine') diff --git a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc index d33f6bf10..7b8c6d5d0 100644 --- a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc +++ b/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -213,4 +213,16 @@ \quotefromfile webengine/recipebrowser/resources/pages/soup.html \printuntil + \section1 Files and Attributions + + The example bundles the following code with third-party licenses: + + \table + \row + \li \l{recipebrowser-marked}{Marked} + \li MIT License + \row + \li \l{recipebrowser-markdowncss}{Markdown.css} + \li Apache License 2.0 + \endtable */ diff --git a/examples/webengine/recipebrowser/recipebrowser.pro b/examples/webengine/recipebrowser/recipebrowser.pro index ea6db13fb..c7e4dcaf8 100644 --- a/examples/webengine/recipebrowser/recipebrowser.pro +++ b/examples/webengine/recipebrowser/recipebrowser.pro @@ -10,5 +10,9 @@ SOURCES += main.cpp RESOURCES += resources/resources.qrc +DISTFILES += \ + resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt \ + resources/pages/assets/3rdparty/MARKED-LICENSE.txt + target.path = $$[QT_INSTALL_EXAMPLES]/webengine/recipebrowser INSTALLS += target diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/3RDPARTY.md b/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/3RDPARTY.md deleted file mode 100644 index 9e91ab302..000000000 --- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/3RDPARTY.md +++ /dev/null @@ -1,23 +0,0 @@ -## markd license - -``` -Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -``` diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt b/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt new file mode 100644 index 000000000..23c52cc43 --- /dev/null +++ b/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt @@ -0,0 +1,16 @@ +Copyright 2011 Kevin Burke unless otherwise noted. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Some content is copyrighted by Twitter, Inc., and also released under an +Apache License; these sections are noted in the source. diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt b/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt new file mode 100644 index 000000000..a7b812ed6 --- /dev/null +++ b/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/default.md b/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/default.md deleted file mode 100644 index 8f9c807aa..000000000 --- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/default.md +++ /dev/null @@ -1,12 +0,0 @@ -## WebEngine Markdown Editor Example - -This example uses [QWebEngineView](http://doc.qt.io/qt-5/qwebengineview.html) -to preview text written using the [Markdown](https://en.wikipedia.org/wiki/Markdown) -syntax. - -### Acknowledgments - -The conversion from Markdown to HTML is done with the help of the -[marked JavaScript library](https://github.com/chjj/marked) by _Christopher Jeffrey_. -The [style sheet](http://kevinburke.bitbucket.org/markdowncss/markdown.css) -was created by _Kevin Burke_. diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json b/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json new file mode 100644 index 000000000..42947ca0b --- /dev/null +++ b/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json @@ -0,0 +1,35 @@ +[ + { + "Id": "recipebrowser-marked", + "Name": "Marked (WebEngine RecipeBrowser example)", + "QDocModule": "qtwebengine", + "QtUsage": "Marked is used in the WebEngine RecipeBrowser example", + "QtParts": [ "examples" ], + "Files": "marked.min.js", + "Description": "A full-featured markdown parser and compiler, written in JavaScript. Built for speed.", + "Homepage": "https://github.com/chjj/marked", + "Version": "0.3.6", + "DownloadLocation": "https://github.com/chjj/marked/blob/v0.3.6/marked.min.js", + "Copyright": "Copyright (c) 2011-2014, Christopher Jeffrey", + "License": "MIT License", + "LicenseId": "MIT", + "LicenseFile": "MARKED-LICENSE.txt" + }, + { + "Id": "recipebrowser-markdowncss", + "Name": "Markdown.css (WebEngine RecipeBrowser example)", + "QDocModule": "qtwebengine", + "QtUsage": "markdown.css is used in the WebEngine RecipeBrowser example", + "QtParts": [ "examples" ], + "Files": "markdown.css", + "Description": "Markdown.css is better default styling for your Markdown files.", + "Homepage": "https://kevinburke.bitbucket.io/markdowncss/", + "Version": "188530e4b5d020d7e237fc6b26be13ebf4a8def3", + "DownloadLocation": "https://bitbucket.org/kevinburke/markdowncss/src/188530e4b5d020d7e237fc6b26be13ebf4a8def3/markdown.css", + "Copyright": "Copyright 2011 Kevin Burke + Copyright Twitter Inc.", + "License": "Apache License 2.0", + "LicenseId": "Apache-2.0", + "LicenseFile": "MARKDOWN-LICENSE.txt" + } +] diff --git a/examples/webengine/recipebrowser/resources/resources.qrc b/examples/webengine/recipebrowser/resources/resources.qrc index ae5aa2ed3..88919159b 100644 --- a/examples/webengine/recipebrowser/resources/resources.qrc +++ b/examples/webengine/recipebrowser/resources/resources.qrc @@ -12,7 +12,6 @@ pages/cupcakes.html pages/assets/3rdparty/marked.min.js - pages/assets/3rdparty/default.md pages/assets/3rdparty/markdown.css pages/assets/custom.css pages/assets/custom.js -- cgit v1.2.3