Template talk:List of people Hami Links/Devel

From Wikipedia, the free encyclopedia

Contents

[edit] The problem

Templates like Template:List of people Ham Links (and the others with different text substituting for the "Ham") are each used by at least 2 name-entry-bearing LoPbN-tree pages, and the index-only page that is their common parent, in the main namespace. To avoid disruption of the intra-LoPbN navigation facilities, one of these templates needs to be changed whenever the title of one of the name-entry-bearing pages using it.

Manual creation or editing of such pages is quite feasible, but repetitive, and sensitive to non-obvious typos. The long-term purpose of this template-talk page's template page is supporting an easily learned mechanism for creating and changing the "Links" pages.

[edit] Tentative user interface

Early stub versions of the new mechanism, at Template:List of people Hami Links/Devel, would use, in the hypothetical situation of List of people by name: Hami's contents being subdivided among these pages:

the markup

{{List of people Hami Links/Devel|k=k|r=s}}

to specify that subdivision.

The intention of the notation is that the user can (ignoring the in fact crucial function of the = sign in assigning values to parameters) think of the "Hami..." page having potentially up to 26 child ranges, "Hamia..." thru "Hamiz...", and of "l=l" designating one of those, a page for precisely the "Hamil..." entries. On the other hand, they should think of "r=s" representing the boundary between two pages, of which first the covers the combined scope of the "Hamim..." thru "Hamir..." ranges, and the second that of the "Hamis..." thru "Hamiz..." ranges.

(From the my (programmer's) point of view, the crucial elements are that

  • each of those 26 ranges must fall (completely) within (exactly) one of the pages;
  • each boundary between pages is between either
    1. two adjacent pages of the 26 possible uncombined-range pages,
    2. one combined and one uncombined-range page, or
    3. two combined pages;
  • the subdivision among the children is completely defined, once
    • all uncombined-range pages are specified, and
    • all boundaries between two pages, that each combine a group of (pair-wise adjacent) uncombined ranges, are specified.)

[edit] Stub versions

[edit] Stub to handle k=k and k=l

{{Lopbn-lrng|{{{1}}}|a|{{#if:{{{k}}}|{{#ifeq:{{{k}}}|k|j|k}}|UNIMP}} }} {{#if:{{{k}}}|{{#ifeq:{{{k}}}|k|{{Lopbn-l1|{{{1}}}|k}} }} {{Lopbn-lrng|{{{1}}}|l|z}} | UNIMP}}
Hamia-Hami | HamiHami | Hami-Hamiz
Hamia-Hami | HamiHami | Hami-Hamiz


[edit] Stub to handle k=k, k=l, l=l, and l=m

{{Lopbn-lrng|{{{1}}}|a|{{#if:{{{k}}}|{{#ifeq:{{{k}}}|k|j|k}}|UNIMP}} }} {{#if:{{{k}}}|{{#ifeq:{{{k}}}|k|{{Lopbn-l1|{{{1}}}|k}} }} {{Lopbn-lrng|{{{1}}}|l|z}} | UNIMP}}
Hamia-Hami | HamiHami | Hami-Hamiz
Hamia-Hami | HamiHami | Hami-Hamiz

Now work on implementing these cases:

Hamia-Hami | HamiHami | Hami-Hamiz
Hamia-Hami | HamiHami | Hami-Hamiz

[edit] Shift in direction

_ _ I imagined that checking in order for each letter of the alphabet as params would efficiently implement my proposed format, and count the number of lks needed, but it appears at least hard to do that once, and also share the information gleaned with the various places in the generated markup that are affected by the same portion of it.
_ _ Another thrust is to avoid relying on a single user-interface template, and at least initially focus on specific commonly needed patterns of "range" and "common-prefix" links, starting with RPR; for this one, only the prefix of the parent page and the additional letter for the prefix need be specified: {{Lopbn-lRPR}}, with two parameters.
--Jerzyt 07:12, 1 November 2006 (UTC)

[edit] Beyond stubs

OK, i recoded using {{next ltr}} and {{prev ltr}}, producing a version that produces a links pg with one prefix "broken out" into its own page, and two ranges covering the rest of the scope of its parent page. It actually worked properly for breaking out anything from ...c to ...x: breaking out ...b leaves ...a also broken out, and breaking out ...a gives a range after a but none before. Those cases are now treated properly (at the cost of breaking those pages while i floundered thru coding them, on the "/Devel" page that i'm currently using for production, whoops). The next step is applying a similar fix at the other end of the alphabet. I'll work on this page instead; when it works right, i'll revert to this revision, and copy the new version into the /Devel page, still preserving my options on naming the templates in this suite covering patterns either previously needed or comfortably handled by generalized templates.
--Jerzyt 07:12, 1 November 2006 (UTC)

[edit] Samples

  1. Xxxa | Xxxb-Xxxz
  2. Xxxa | Xxxb | Xxxc-Xxxz
  3. Xxxa-Xxxl | Xxxm | Xxxn-Xxxz
  4. Xxxa-Xxxx | Xxxy | Xxxz
  5. Xxxa-Xxxy | Xxxz