From 4da9a13c458864f087810175eff9f9a998577976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Fri, 19 Nov 2021 16:51:56 +0100 Subject: [PATCH] Test cases for partially transcluded comments Bug: T289873 Change-Id: I115a46eb4858dccd6056534d727f88d8513b391b --- tests/cases/README.txt | 6 ++ tests/cases/transcluded.json | 16 +++- .../transclusions2-transcludedFrom.json | 5 ++ .../cases/transclusions2/transclusions2.html | 12 +++ .../transclusions3-transcludedFrom.json | 7 ++ .../cases/transclusions3/transclusions3.html | 88 +++++++++++++++++++ 6 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 tests/cases/transclusions2/transclusions2-transcludedFrom.json create mode 100644 tests/cases/transclusions2/transclusions2.html create mode 100644 tests/cases/transclusions3/transclusions3-transcludedFrom.json create mode 100644 tests/cases/transclusions3/transclusions3.html diff --git a/tests/cases/README.txt b/tests/cases/README.txt index 8b8dda1e6..aeedc06c0 100644 --- a/tests/cases/README.txt +++ b/tests/cases/README.txt @@ -52,5 +52,11 @@ https://en.wikipedia.org/w/index.php?title=Wikipedia:Requests_for_comment/User_n double-signature2: https://en.wikipedia.org/w/index.php?title=Wikipedia:Articles_for_deletion/Equal_Education&oldid=1009060583&action=render +transclusions2: +https://en.wikipedia.beta.wmflabs.org/api/rest_v1/page/html/Talk%3AT289873/514467 + +transclusions3: +https://en.wikipedia.org/api/rest_v1/page/html/Wikipedia_talk%3ATemplate_documentation/1056728376 + Text is available under the Creative Commons Attribution-ShareAlike License. See these pages for attribution. diff --git a/tests/cases/transcluded.json b/tests/cases/transcluded.json index 1b9feb801..2161f0fa4 100644 --- a/tests/cases/transcluded.json +++ b/tests/cases/transcluded.json @@ -1,11 +1,25 @@ [ { - "name": "transclusions", + "name": "transclusions - simple case", "dom": "cases/transclusions/transclusions.html", "expected": "../cases/transclusions/transclusions-transcludedFrom.json", "config": "../data/enwiki-config.json", "data": "../data/enwiki-data.json" }, + { + "name": "transclusions - comments partially transcluded from a subpage", + "dom": "cases/transclusions2/transclusions2.html", + "expected": "../cases/transclusions2/transclusions2-transcludedFrom.json", + "config": "../data/enwiki-config.json", + "data": "../data/enwiki-data.json" + }, + { + "name": "transclusions - comment partially template-generated", + "dom": "cases/transclusions3/transclusions3.html", + "expected": "../cases/transclusions3/transclusions3-transcludedFrom.json", + "config": "../data/enwiki-config.json", + "data": "../data/enwiki-data.json" + }, { "name": "enwiki parsoid", "dom": "cases/en-big-parsoid/en-big-parsoid.html", diff --git a/tests/cases/transclusions2/transclusions2-transcludedFrom.json b/tests/cases/transclusions2/transclusions2-transcludedFrom.json new file mode 100644 index 000000000..5b2751e70 --- /dev/null +++ b/tests/cases/transclusions2/transclusions2-transcludedFrom.json @@ -0,0 +1,5 @@ +{ + "c-Yatu-2021-11-16T15:14:00.000Z-A": false, + "c-Yatu-2021-11-16T15:18:00.000Z-Yatu-2021-11-16T15:14:00.000Z": "Talk:T289873/A", + "c-Yatu-2021-11-16T15:15:00.000Z-B": false +} diff --git a/tests/cases/transclusions2/transclusions2.html b/tests/cases/transclusions2/transclusions2.html new file mode 100644 index 000000000..6f2406537 --- /dev/null +++ b/tests/cases/transclusions2/transclusions2.html @@ -0,0 +1,12 @@ + +Talk:T289873

These sections are transcluded from subpages.

+ +

A

+
[ edit ]
+

Hello. Yatu (talk) 15:14, 16 November 2021 (UTC)

+ +
Reply on subpage A. Yatu (talk) 15:18, 16 November 2021 (UTC)
+ +

B

+
[ edit ]
+

Hi! Yatu (talk) 15:15, 16 November 2021 (UTC)

\ No newline at end of file diff --git a/tests/cases/transclusions3/transclusions3-transcludedFrom.json b/tests/cases/transclusions3/transclusions3-transcludedFrom.json new file mode 100644 index 000000000..f660cbf79 --- /dev/null +++ b/tests/cases/transclusions3/transclusions3-transcludedFrom.json @@ -0,0 +1,7 @@ +{ + "c-BoldLuis-2020-05-03T10:09:00.000Z-Wikipedia:TemplateData": false, + "c-BoldLuis-2020-05-03T11:08:00.000Z-documentation_automatically_included_in_all_templates": false, + "c-Mathglot-2021-08-08T10:32:00.000Z-Notice_of_new_template_{{Param_value}}_for_assistance_in_template_doc_pages": false, + "c-SWinxy-2021-11-23T06:02:00.000Z-Including_TemplateData": false, + "c-SWinxy-2021-11-23T06:13:00.000Z-Including_TemplateData": true +} diff --git a/tests/cases/transclusions3/transclusions3.html b/tests/cases/transclusions3/transclusions3.html new file mode 100644 index 000000000..34246e200 --- /dev/null +++ b/tests/cases/transclusions3/transclusions3.html @@ -0,0 +1,88 @@ + +Wikipedia talk:Template documentation
+ + + + + + + + + + + + + + + + + +
Wikipedia Help Project (Rated NA-class, High-importance) +
+ + + + + + + + + + +
WikiProject iconThis page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
 NA This page does not require a rating on the project's quality scale.
 High This page has been rated as High-importance on the project's importance scale.
+ 
+

+ +

Wikipedia:TemplateData

+ +

Nowadays, TemplateData is included in all the templates and it is a good procedure filling its parameters in the documentation, so it would be good including a link to Wikipedia:TemplateData/Tutorial in the lead section. --BoldLuis (talk) 10:09, 3 May 2020 (UTC)

+ +

documentation automatically included in all templates

+ +

{{documentation}} would be included by default in all the templates, excepting when {{noincdoc}} (or similar code) is used (I think there is no reason to exclude documentation in templates anyway).

+ +

The same for the TemplateData content, including its template detected parameters, when the documentation page is automatically created (just after template creation). --BoldLuis (talk) 11:08, 3 May 2020 (UTC)

+ +

Notice of new template {{Param value}} for assistance in template doc pages

+ +

I had a need for a way to highlight param values on template doc pages, which could not easily be achieved by use of the <code> tag, which I had been using previously. The use case was the documentation for {{Lorem ipsum}}, which has some parameters whose values may contain leading and trailing blanks; needless to say, it's particularly hard to see those. An example is:  * " . The new template {{param value}} was my attempted solution for this problem. You can see some examples of it in use at Template:Lorem ipsum#Prefix and suffix whitespace. Mathglot (talk) 10:32, 8 August 2021 (UTC)

+ +

Including TemplateData

+ +

This page doesn't say where or how to put the TemplateData, even though many many templates use a standard format (seen below). I suggest this page include it in the #Manual creation section, and in the prefilled creation link provided by {{documentation}}, and putting it at the very bottom of the documentation subpage. There was also a discussion nearly 8 years ago on what a standard should be, for those curious. Adding the templatedata section can remind and encourage editors to add it for use in the VisualEditor. Agree? Disagree? Thoughts?

+ +
== TemplateData ==
+{{TemplateData header}}
+
+<templatedata>
+    ...
+</templatedata>

SWinxy (talk) 06:02, 23 November 2021 (UTC) +

Notified: Template talk:Documentation. SWinxy (talk) 06:13, 23 November 2021 (UTC)
\ No newline at end of file