summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-18 06:08:42 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-18 06:08:42 +0000
commite2751f0230ee4b3ca0820a6af25742340e25f34b (patch)
tree0d3e8631d753c8c988bb158efa43e70d94f96b48
parent9a9116e2214b83d843637b4dd2b0378549c705d4 (diff)
automatic import of python-wikirender
-rw-r--r--.gitignore1
-rw-r--r--python-wikirender.spec541
-rw-r--r--sources1
3 files changed, 543 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..3cc536f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/wikirender-0.0.43.tar.gz
diff --git a/python-wikirender.spec b/python-wikirender.spec
new file mode 100644
index 0000000..ce5ae61
--- /dev/null
+++ b/python-wikirender.spec
@@ -0,0 +1,541 @@
+%global _empty_manifest_terminate_build 0
+Name: python-wikirender
+Version: 0.0.43
+Release: 1
+Summary: Convert Json data into wiki files or update existing files. Provides different templates to generate wiki files
+License: Apache License
+URL: https://github.com/tholzheim/wikirender
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b7/4a/7eaeededcc6499bef41866da534d504d733c9bc53ab12214d4e0fc1623fd/wikirender-0.0.43.tar.gz
+BuildArch: noarch
+
+Requires: python3-wikitextparser
+Requires: python3-jinja2
+Requires: python3-pylodstorage
+Requires: python3-py-3rdparty-mediawiki
+
+%description
+# wikirender
+[![pypi](https://img.shields.io/pypi/pyversions/wikirender)](https://pypi.org/project/wikirender/)
+[![Github Actions Build](https://github.com/tholzheim/wikirender/workflows/Build/badge.svg?branch=master)](https://github.com/tholzheim/wikirender/actions?query=workflow%3ABuild+branch%3Amaster)
+[![GitHub issues](https://img.shields.io/github/issues/tholzheim/wikirender.svg)](https://github.com/tholzheim/wikirender/issues)
+[![GitHub issues](https://img.shields.io/github/issues-closed/tholzheim/wikirender.svg)](https://github.com/tholzheim/wikirender/issues/?q=is%3Aissue+is%3Aclosed)
+[![GitHub](https://img.shields.io/github/license/tholzheim/wikirender.svg)](https://www.apache.org/licenses/LICENSE-2.0)
+[![PyPI Status](https://img.shields.io/pypi/v/wikirender.svg)](https://pypi.python.org/pypi/wikirender/)
+
+Provides jinja templates to create wiki page files form JSON input
+## Install
+```bash
+pip install wikirender
+```
+check if it worked with
+```
+wikirender -h
+wikiextract -h
+```
+### Examples
+#### wikiextract
+Use this tool to extract template information from your wiki backup files.
+```
+wikiextract -t Event --BackupPath "/home/user/wikibackup/wikiId" -id "Filename"
+```
+Returns:
+```JSON
+{
+ "data": [
+ {
+ "Acronym": "ICEIS 2011",
+ "Title": "13th International Conference on Enterprise Information Systems (ICEIS)",
+ "Type": "Conference",
+ "Start date": "2011/06/08",
+ "End date": "2011/06/11",
+ "Homepage": "www.iceis.org/",
+ "City": "Beijing",
+ "Country": "China",
+ "Submission deadline": "2011/01/25",
+ "Filename": "ICEIS 2011"
+ },
+ {
+ " Title": " Foundations of Software Engineering 2001\n ",
+ " Type ": " Conference\n ",
+ " Field ": " Software engineering\n ",
+ " Series": " FSE\n ",
+ " Homepage": " esec.ocg.at/\n ",
+ " Logo": "\n ",
+ " Start date": "\n ",
+ " End date": "\n ",
+ " City": "\n ",
+ " State": "\n ",
+ " Country": "\n ",
+ " Submitted papers ": " 137\n ",
+ " Accepted papers ": " 29",
+ "Filename": "FSE 2001"
+ },
+ {
+ "Acronym": "CC 2009",
+ "Title": "International Conference on Compiler Construction 2009",
+ "Series": "CC",
+ "Type": "Conference",
+ "Field": "Computer science",
+ "Start date": "2009/03/22",
+ "End date": "2009/03/29",
+ "Homepage": "http://www.brics.dk/~mis/CC2009/",
+ "City": "York",
+ "Country": "UK",
+ "Submission deadline": "2008/10/02",
+ "Filename": "CC 2009"
+ }
+ ]
+}
+```
+> Note: As the name says the data is only extracted form the file. Meaning that also template arguments with invalid arguments are included in the result which is contrary to querying the templates in the wiki (invalid values are excluded there)
+
+#### wikirender
+##### wikirender -m create_entity_pages
+In the mode create_entity_pages the following entity pages will be created (e.g. for <entity_name>)
+* Concept:<entity_name>
+* Category:<entity_name>
+* Help:<entity_name>
+* List of<entity_name_plural>
+* Template:<entity_name>
+* Form:<entity_name>
+
+To generate the pages the following input is required:
+* List of all entities the pages should be generated for
+```JSON
+{"data":[{
+ "name": "Event",
+ "pluralName": "Events",
+ "icon": "File:EventLogo-64px.png",
+ "iconUrl": "",
+ "documentation": "a meeting of researchers at a specific time and place",
+ "wikiDocumentation": "a meeting of researchers at a specific time and place (virtual or physical) and with a specific thematic focus to present, hear and discuss research outputs "
+ }]
+}
+```
+*List of all properties of the wiki (all properties are required to extract dependencies between the properties)
+```JSON
+{"data":[{
+ "property": "Property:Title",
+ "name": "Title",
+ "label": "Title",
+ "type": "Special:Types/Text",
+ "index": null,
+ "sortPos": null,
+ "inputType": "datetimepicker",
+ "values_from": null,
+ "used_for": "Concept:Event"
+ }]
+}
+```
+For the example input from above the following command generates **Concept.wiki**, **Category:Event.wiki**, **Help:Event.wiki**, **Form:Event.wiki**, **Template:Event.wiki** and, **List of Events.wiki**,
+```
+wikirender -m "generate_entity_pages" --BackupPath . --topics topics.json --properties properties.json
+```
+##### Pipeline Example
+Example pipeline to generate enity pages for all topics in the wiki with the use of [py-3rdparty-mediawiki](https://github.com/WolfgangFahl/py-3rdparty-mediawiki)
+```
+$ bash scripts/gen -t <wikiId> &&
+wikirender -m "generate_entity_pages" --BackupPath . --topic /tmp/wikirender/<wikiId>/topics.json --properties /tmp/wikirender/<wikiId>/properties.json &&
+wikirestore -t <wikiId> --backupPath .
+```
+
+#### Example Pipeline
+For example, we have a json file with information about events with which we want to update the Event templates in the wikibackup.
+```
+cat test.json | wikirender -t Event -id Acronym -stdin --BackupPath "."
+```
+The data is provided to wikirender through *stdin* and updates the template *Event* with the provided data.
+As page name the key *Acronym* is used.
+The update to the templates is applied to the files as shown in the diagram below.
+
+![](docs/figures/event_update_example.png)
+#### Sample Input Data
+```json
+{
+ "data":
+ [
+ {
+ "Acronym": "SMWCon 2020",
+ "Title": "SMWCon",
+ "Year": "2020",
+ "Description": "test value"
+ },
+ {
+ "Acronym": "SMWCon 2021",
+ "Title": "SMWCon",
+ "Year": "2021",
+ "Description": "test value\\n with line break"
+ }
+ ]
+}
+```
+
+
+%package -n python3-wikirender
+Summary: Convert Json data into wiki files or update existing files. Provides different templates to generate wiki files
+Provides: python-wikirender
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-wikirender
+# wikirender
+[![pypi](https://img.shields.io/pypi/pyversions/wikirender)](https://pypi.org/project/wikirender/)
+[![Github Actions Build](https://github.com/tholzheim/wikirender/workflows/Build/badge.svg?branch=master)](https://github.com/tholzheim/wikirender/actions?query=workflow%3ABuild+branch%3Amaster)
+[![GitHub issues](https://img.shields.io/github/issues/tholzheim/wikirender.svg)](https://github.com/tholzheim/wikirender/issues)
+[![GitHub issues](https://img.shields.io/github/issues-closed/tholzheim/wikirender.svg)](https://github.com/tholzheim/wikirender/issues/?q=is%3Aissue+is%3Aclosed)
+[![GitHub](https://img.shields.io/github/license/tholzheim/wikirender.svg)](https://www.apache.org/licenses/LICENSE-2.0)
+[![PyPI Status](https://img.shields.io/pypi/v/wikirender.svg)](https://pypi.python.org/pypi/wikirender/)
+
+Provides jinja templates to create wiki page files form JSON input
+## Install
+```bash
+pip install wikirender
+```
+check if it worked with
+```
+wikirender -h
+wikiextract -h
+```
+### Examples
+#### wikiextract
+Use this tool to extract template information from your wiki backup files.
+```
+wikiextract -t Event --BackupPath "/home/user/wikibackup/wikiId" -id "Filename"
+```
+Returns:
+```JSON
+{
+ "data": [
+ {
+ "Acronym": "ICEIS 2011",
+ "Title": "13th International Conference on Enterprise Information Systems (ICEIS)",
+ "Type": "Conference",
+ "Start date": "2011/06/08",
+ "End date": "2011/06/11",
+ "Homepage": "www.iceis.org/",
+ "City": "Beijing",
+ "Country": "China",
+ "Submission deadline": "2011/01/25",
+ "Filename": "ICEIS 2011"
+ },
+ {
+ " Title": " Foundations of Software Engineering 2001\n ",
+ " Type ": " Conference\n ",
+ " Field ": " Software engineering\n ",
+ " Series": " FSE\n ",
+ " Homepage": " esec.ocg.at/\n ",
+ " Logo": "\n ",
+ " Start date": "\n ",
+ " End date": "\n ",
+ " City": "\n ",
+ " State": "\n ",
+ " Country": "\n ",
+ " Submitted papers ": " 137\n ",
+ " Accepted papers ": " 29",
+ "Filename": "FSE 2001"
+ },
+ {
+ "Acronym": "CC 2009",
+ "Title": "International Conference on Compiler Construction 2009",
+ "Series": "CC",
+ "Type": "Conference",
+ "Field": "Computer science",
+ "Start date": "2009/03/22",
+ "End date": "2009/03/29",
+ "Homepage": "http://www.brics.dk/~mis/CC2009/",
+ "City": "York",
+ "Country": "UK",
+ "Submission deadline": "2008/10/02",
+ "Filename": "CC 2009"
+ }
+ ]
+}
+```
+> Note: As the name says the data is only extracted form the file. Meaning that also template arguments with invalid arguments are included in the result which is contrary to querying the templates in the wiki (invalid values are excluded there)
+
+#### wikirender
+##### wikirender -m create_entity_pages
+In the mode create_entity_pages the following entity pages will be created (e.g. for <entity_name>)
+* Concept:<entity_name>
+* Category:<entity_name>
+* Help:<entity_name>
+* List of<entity_name_plural>
+* Template:<entity_name>
+* Form:<entity_name>
+
+To generate the pages the following input is required:
+* List of all entities the pages should be generated for
+```JSON
+{"data":[{
+ "name": "Event",
+ "pluralName": "Events",
+ "icon": "File:EventLogo-64px.png",
+ "iconUrl": "",
+ "documentation": "a meeting of researchers at a specific time and place",
+ "wikiDocumentation": "a meeting of researchers at a specific time and place (virtual or physical) and with a specific thematic focus to present, hear and discuss research outputs "
+ }]
+}
+```
+*List of all properties of the wiki (all properties are required to extract dependencies between the properties)
+```JSON
+{"data":[{
+ "property": "Property:Title",
+ "name": "Title",
+ "label": "Title",
+ "type": "Special:Types/Text",
+ "index": null,
+ "sortPos": null,
+ "inputType": "datetimepicker",
+ "values_from": null,
+ "used_for": "Concept:Event"
+ }]
+}
+```
+For the example input from above the following command generates **Concept.wiki**, **Category:Event.wiki**, **Help:Event.wiki**, **Form:Event.wiki**, **Template:Event.wiki** and, **List of Events.wiki**,
+```
+wikirender -m "generate_entity_pages" --BackupPath . --topics topics.json --properties properties.json
+```
+##### Pipeline Example
+Example pipeline to generate enity pages for all topics in the wiki with the use of [py-3rdparty-mediawiki](https://github.com/WolfgangFahl/py-3rdparty-mediawiki)
+```
+$ bash scripts/gen -t <wikiId> &&
+wikirender -m "generate_entity_pages" --BackupPath . --topic /tmp/wikirender/<wikiId>/topics.json --properties /tmp/wikirender/<wikiId>/properties.json &&
+wikirestore -t <wikiId> --backupPath .
+```
+
+#### Example Pipeline
+For example, we have a json file with information about events with which we want to update the Event templates in the wikibackup.
+```
+cat test.json | wikirender -t Event -id Acronym -stdin --BackupPath "."
+```
+The data is provided to wikirender through *stdin* and updates the template *Event* with the provided data.
+As page name the key *Acronym* is used.
+The update to the templates is applied to the files as shown in the diagram below.
+
+![](docs/figures/event_update_example.png)
+#### Sample Input Data
+```json
+{
+ "data":
+ [
+ {
+ "Acronym": "SMWCon 2020",
+ "Title": "SMWCon",
+ "Year": "2020",
+ "Description": "test value"
+ },
+ {
+ "Acronym": "SMWCon 2021",
+ "Title": "SMWCon",
+ "Year": "2021",
+ "Description": "test value\\n with line break"
+ }
+ ]
+}
+```
+
+
+%package help
+Summary: Development documents and examples for wikirender
+Provides: python3-wikirender-doc
+%description help
+# wikirender
+[![pypi](https://img.shields.io/pypi/pyversions/wikirender)](https://pypi.org/project/wikirender/)
+[![Github Actions Build](https://github.com/tholzheim/wikirender/workflows/Build/badge.svg?branch=master)](https://github.com/tholzheim/wikirender/actions?query=workflow%3ABuild+branch%3Amaster)
+[![GitHub issues](https://img.shields.io/github/issues/tholzheim/wikirender.svg)](https://github.com/tholzheim/wikirender/issues)
+[![GitHub issues](https://img.shields.io/github/issues-closed/tholzheim/wikirender.svg)](https://github.com/tholzheim/wikirender/issues/?q=is%3Aissue+is%3Aclosed)
+[![GitHub](https://img.shields.io/github/license/tholzheim/wikirender.svg)](https://www.apache.org/licenses/LICENSE-2.0)
+[![PyPI Status](https://img.shields.io/pypi/v/wikirender.svg)](https://pypi.python.org/pypi/wikirender/)
+
+Provides jinja templates to create wiki page files form JSON input
+## Install
+```bash
+pip install wikirender
+```
+check if it worked with
+```
+wikirender -h
+wikiextract -h
+```
+### Examples
+#### wikiextract
+Use this tool to extract template information from your wiki backup files.
+```
+wikiextract -t Event --BackupPath "/home/user/wikibackup/wikiId" -id "Filename"
+```
+Returns:
+```JSON
+{
+ "data": [
+ {
+ "Acronym": "ICEIS 2011",
+ "Title": "13th International Conference on Enterprise Information Systems (ICEIS)",
+ "Type": "Conference",
+ "Start date": "2011/06/08",
+ "End date": "2011/06/11",
+ "Homepage": "www.iceis.org/",
+ "City": "Beijing",
+ "Country": "China",
+ "Submission deadline": "2011/01/25",
+ "Filename": "ICEIS 2011"
+ },
+ {
+ " Title": " Foundations of Software Engineering 2001\n ",
+ " Type ": " Conference\n ",
+ " Field ": " Software engineering\n ",
+ " Series": " FSE\n ",
+ " Homepage": " esec.ocg.at/\n ",
+ " Logo": "\n ",
+ " Start date": "\n ",
+ " End date": "\n ",
+ " City": "\n ",
+ " State": "\n ",
+ " Country": "\n ",
+ " Submitted papers ": " 137\n ",
+ " Accepted papers ": " 29",
+ "Filename": "FSE 2001"
+ },
+ {
+ "Acronym": "CC 2009",
+ "Title": "International Conference on Compiler Construction 2009",
+ "Series": "CC",
+ "Type": "Conference",
+ "Field": "Computer science",
+ "Start date": "2009/03/22",
+ "End date": "2009/03/29",
+ "Homepage": "http://www.brics.dk/~mis/CC2009/",
+ "City": "York",
+ "Country": "UK",
+ "Submission deadline": "2008/10/02",
+ "Filename": "CC 2009"
+ }
+ ]
+}
+```
+> Note: As the name says the data is only extracted form the file. Meaning that also template arguments with invalid arguments are included in the result which is contrary to querying the templates in the wiki (invalid values are excluded there)
+
+#### wikirender
+##### wikirender -m create_entity_pages
+In the mode create_entity_pages the following entity pages will be created (e.g. for <entity_name>)
+* Concept:<entity_name>
+* Category:<entity_name>
+* Help:<entity_name>
+* List of<entity_name_plural>
+* Template:<entity_name>
+* Form:<entity_name>
+
+To generate the pages the following input is required:
+* List of all entities the pages should be generated for
+```JSON
+{"data":[{
+ "name": "Event",
+ "pluralName": "Events",
+ "icon": "File:EventLogo-64px.png",
+ "iconUrl": "",
+ "documentation": "a meeting of researchers at a specific time and place",
+ "wikiDocumentation": "a meeting of researchers at a specific time and place (virtual or physical) and with a specific thematic focus to present, hear and discuss research outputs "
+ }]
+}
+```
+*List of all properties of the wiki (all properties are required to extract dependencies between the properties)
+```JSON
+{"data":[{
+ "property": "Property:Title",
+ "name": "Title",
+ "label": "Title",
+ "type": "Special:Types/Text",
+ "index": null,
+ "sortPos": null,
+ "inputType": "datetimepicker",
+ "values_from": null,
+ "used_for": "Concept:Event"
+ }]
+}
+```
+For the example input from above the following command generates **Concept.wiki**, **Category:Event.wiki**, **Help:Event.wiki**, **Form:Event.wiki**, **Template:Event.wiki** and, **List of Events.wiki**,
+```
+wikirender -m "generate_entity_pages" --BackupPath . --topics topics.json --properties properties.json
+```
+##### Pipeline Example
+Example pipeline to generate enity pages for all topics in the wiki with the use of [py-3rdparty-mediawiki](https://github.com/WolfgangFahl/py-3rdparty-mediawiki)
+```
+$ bash scripts/gen -t <wikiId> &&
+wikirender -m "generate_entity_pages" --BackupPath . --topic /tmp/wikirender/<wikiId>/topics.json --properties /tmp/wikirender/<wikiId>/properties.json &&
+wikirestore -t <wikiId> --backupPath .
+```
+
+#### Example Pipeline
+For example, we have a json file with information about events with which we want to update the Event templates in the wikibackup.
+```
+cat test.json | wikirender -t Event -id Acronym -stdin --BackupPath "."
+```
+The data is provided to wikirender through *stdin* and updates the template *Event* with the provided data.
+As page name the key *Acronym* is used.
+The update to the templates is applied to the files as shown in the diagram below.
+
+![](docs/figures/event_update_example.png)
+#### Sample Input Data
+```json
+{
+ "data":
+ [
+ {
+ "Acronym": "SMWCon 2020",
+ "Title": "SMWCon",
+ "Year": "2020",
+ "Description": "test value"
+ },
+ {
+ "Acronym": "SMWCon 2021",
+ "Title": "SMWCon",
+ "Year": "2021",
+ "Description": "test value\\n with line break"
+ }
+ ]
+}
+```
+
+
+%prep
+%autosetup -n wikirender-0.0.43
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-wikirender -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.43-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..b91d0ea
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+8e63da417d29a2003db4379b389ff9c7 wikirender-0.0.43.tar.gz