User:Tango Mike Bravo/Migrate notes

This page is for notes on the possibility of automated scripts for migrating from Family tree to Tree chart.

As noted in the discussion at Template talk:Family tree there are two cases where automation could be used:


 * 1) Use of tiles that have changed plus lines that end  as per Template:Tree chart.
 * 2) Use of box names (that get substituted for the actual content of the boxes) that clash with Tree chart's tile names.

Both could be dealt with by a script that finds uses of Family tree, family tree & familytree and for each use:


 * 1) Makes the substitutions as per the instructions at Template:Tree chart taking care to create an order of substitution that prevents double substitution, and replaces  with.
 * 2) Rather than look for name clashes it would be easier to look for single character box names in each use and append the character   to them.

In constructing the script it will be important to be able to deal with cases where there is additional white space, such as.

In addition the output should as far as possible preserve the same layout. Particularly box names that immediately follow the initial pipe must not have space inserted before them, as this will break any styling that is applied to the box. However It will not be possible to preserve layout in cases where the tree chart tile name is two characters, such as.

Order in which to make substitutions to prevent double substitution
The following table is based on Template:Tree chart.

Creating list of what links here for Template:Family tree

 * 1) Obtain list from https://en.wikipedia.org/w/index.php?title=Special:WhatLinksHere/Template:Family_tree&limit=2000&hidelinks=1&hideredirs=1 (which has links and redirects turned off) and put in a text file.
 * 2) Do a global edit to remove " ".
 * 3) Sort the list and delete duplicates..
 * 4) Divide the list into pages in article space and those not in article space.
 * 5) Create a table to record observations from list of pages in article space using a short awk script

The awk script to create the table is:

Transclusions
Here is the list of transclusions of Family tree (method of creation described above) as of 29 April 2020:

In the Notes column:


 * Compatible means that the use of Family tree will not break if there is a redirect to Tree chart.
 * Change required means that the use of Family tree will have to be migrated to Tree chart because it is not compatible.
 * Further investigation means that further investigation is required to determine if it is Compatible or if Change required.