Template talk:*/i

From Wikisource
Jump to navigation Jump to search

Margins[edit]

Work with margins is quite important in numbered lists. For some reason, this template creates a left margin despite no margin is set:

  1. Lorem
  2. Ipsum
  3. Dolor
  4. Sit

When trying to remove the margin by setting style=margin-left:0, the result is that the numbers get too much to the left:

  1. Lorem
  2. Ipsum
  3. Dolor
  4. Sit



How can this be solved? --Jan Kameníček (talk) 21:08, 8 February 2024 (UTC)[reply]

Not sure, but we might have hit a CSS limit here. The list markers are outside the BOX model for the list content! and I'm not sure you CAN set the margins of the markers differently.. ShakespeareFan00 (talk) 23:33, 8 February 2024 (UTC)[reply]

Using wiki-standard default.

  1. Lorem
  2. Ipsum
  3. Dolor
  4. Sit

ShakespeareFan00 (talk) 00:12, 9 February 2024 (UTC)[reply]

or

{{*!/s|class=__fixleft}}Lorem
{{*!/i}}Ipsum
{{*!/i|3}}Dolor
{{*!/i|4}}Sit
{{*!/e}}
  1. Lorem
  2. Ipsum
  3. Dolor
  4. Sit
The example with fixleft seems to solve the case when wee need to have it exactly on the left, which is good, but does not solve other cases when we need to set the margin differently. The previous example of making it 1.6em wider is really unintuitive. If I understand it right, it means that if I need the margin to be 1em, I have to set it for 2.6em. If I need it to be 5em, I have to set it for 6.6em, etc. Not a really ideal solution. --Jan Kameníček (talk) 00:36, 9 February 2024 (UTC)[reply]

Besides, it still seems slightly shifted to the right. Compare:

  1. Lorem (with {{*!/s|class=__fixleft}})
  2. Ipsum
1.
Lorem (with {{numbered div}})
2.
Ipsum

--Jan Kameníček (talk) 00:51, 9 February 2024 (UTC)[reply]

Agree with all your points here. ShakespeareFan00 (talk) 08:27, 9 February 2024 (UTC)[reply]
There is also some 'work-arounds' mentioned here - https://stackoverflow.com/questions/73062487/set-width-of-marker although I am not sure how well those would export. ShakespeareFan00 (talk) 12:33, 9 February 2024 (UTC)[reply]
And sadly those 'work-arounds' do not seem to play nicely with Mediawiki . I tried , but would rather work on something 'useful' than have to continually hit my head against a wall, trying to play 'hunt the qurik', as I said previously. ShakespeareFan00 (talk) 13:54, 9 February 2024 (UTC)[reply]
Agree, there is no use of spending so much time with this. If no other solution can be found easily, I will be happy to do it the old way. --Jan Kameníček (talk) 14:27, 9 February 2024 (UTC)[reply]

Paragraph margin[edit]

How can the paragraph margin be set independently from the left margin of the whole list? To illustrate using {{numbered div}}:

1.
Lorem
2.
Ipsum

in compariston with:

1.
Lorem
2.
Ipsum

How could this be done with this template? --Jan Kameníček (talk) 21:08, 8 February 2024 (UTC)[reply]

Padding values on the list-item, could be set via optional style.ShakespeareFan00 (talk) 12:34, 9 February 2024 (UTC)[reply]

Lists with numbering errors[edit]

Sometimes a numbering error may occur in a list. Here is the illustration of such a list, using {{numbered div}}:

1.
Lorem
2.
Ipsum
3.
Dolor
5.
Sit

Can this be achieved with this template, too? --Jan Kameníček (talk) 21:08, 8 February 2024 (UTC)[reply]

With the current {{*/i}} this can be done with the value parameter. ShakespeareFan00 (talk) 23:28, 8 February 2024 (UTC)[reply]

Dots, parentheses and alike[edit]

With {{numbered div}} it is possible to choose whether the number of the item will or will not have a dot, or parentheses, or whatever else:

1
Lorem
2.
Ipsum
3)
Dolor

How can this be achieved with this template? --Jan Kameníček (talk) 21:25, 8 February 2024 (UTC)[reply]

Ideally, the modern approach would be to use a CSS before rule, and a counter, but that's not necessarily going to be supported on all browsers.
https://en.wikisource.org/w/index.php?title=Index%3ASandbox.djvu%2Fstyles.css&diff=13856690&oldid=13856671
for a level 1 test - https://en.wikisource.org/wiki/Page:Sandbox1.djvu/264
(for the moment this retains a DIV based approach) ShakespeareFan00 (talk) 23:26, 8 February 2024 (UTC)[reply]
Well, that does not look like a really user friendly way... Besides, I do not know what is supposed to be seen in the page linked above, but I can see there just an indigo rectangle. --Jan Kameníček (talk) 23:39, 8 February 2024 (UTC)[reply]
The linked edits show a stylesheet and a sandbox page. Examine the underlying code for a possible approach. But yes I agree it's not understandable without knowing the underlying HTML/CSS. (sigh) :(
ShakespeareFan00 (talk) 23:48, 8 February 2024 (UTC)[reply]
I am afraid I do not understand. Should the linked style sheet result in having the numbered list in the linked sandbox page? Because I cannot see any numbered list anywhere. The sandbox page contains just a coloured rectangle. --Jan Kameníček (talk) 23:58, 8 February 2024 (UTC)[reply]
The colored rectangle should have numbers in it. I'll tweak it to make it clearerShakespeareFan00 (talk) 00:04, 9 February 2024 (UTC)[reply]
Well, now I can see the numbers, but the way to achieve it seems overcomplicated in comparison with the template I used above. (Besides there can be also cases with two different lists on one page, one containing e. g. numbers with dots and the other with parentheses, which I suspect would not be possible to do in this way.) And while I finally understood the stylesheet, many other potential contributors will not, so I am afraid the numbered div template still remains the best (easiest) option. --Jan Kameníček (talk) 00:22, 9 February 2024 (UTC)[reply]
For now. we are hitting up against some CSS limits here.ShakespeareFan00 (talk) 00:27, 9 February 2024 (UTC)[reply]
Can you do a little digging into what paired values are being supplied for parameters 3and 4 to Numbered div and related? ShakespeareFan00 (talk) 00:28, 9 February 2024 (UTC)[reply]
I am sorry, I do not understand your question. --Jan Kameníček (talk) 00:40, 9 February 2024 (UTC) Ah, I got what you mean. I have just done a really quick search and it seems that 2 and -2 are quite frequent pairs, but several times I also saw 4 and -2, besides others (among them e.g. 3 and -6, ...) . (Sorry for being slow to understand). --Jan Kameníček (talk) 01:11, 9 February 2024 (UTC)[reply]