www.fgks.org   »   [go: up one dir, main page]

Jump to content

User talk:Ahecht: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Tags: Mobile edit Mobile web edit Advanced mobile edit Reply
Line 41: Line 41:


:@[[User:Dinoguy1000|Dinoguy1000]] must be browser dependent, as neither of those worked for me before adding the manual anchor. --[[User:Ahecht|Ahecht]] ([[User talk:Ahecht|<span style="color:#FFF;background:#04A;display:inline-block;padding:1px;vertical-align:-.3em;font:bold 50%/1 sans-serif;text-align:center">TALK<br />PAGE</span>]]) 13:15, 2 February 2024 (UTC)
:@[[User:Dinoguy1000|Dinoguy1000]] must be browser dependent, as neither of those worked for me before adding the manual anchor. --[[User:Ahecht|Ahecht]] ([[User talk:Ahecht|<span style="color:#FFF;background:#04A;display:inline-block;padding:1px;vertical-align:-.3em;font:bold 50%/1 sans-serif;text-align:center">TALK<br />PAGE</span>]]) 13:15, 2 February 2024 (UTC)

::I'm using Firefox, though I assumed this worked in all browsers considering it's the typical way to link to the PaserFunction documentation on MW.org: [[mw:Help:Extension:ParserFunctions##if]] for example. If this is indeed browser-dependent, that page (and probably some others) needs some anchors added. <span class=nowrap>「[[User:Dinoguy1000|<span style=color:#00f>ディノ</span><span style=color:#080>奴</span>]][[Special:Contributions/Dinoguy1000|<span style=color:#F90>千?!</span>]]」<sup>[[User talk:Dinoguy1000#top|☎ Dinoguy1000]]</sup></span> 22:30, 2 February 2024 (UTC)

Revision as of 22:30, 2 February 2024

You are now an afdstats maintainer!

Sup! I saw your recent PR at afdstats. Legoktm advised me that with that sort of dedication you might as well be a maintainer, and I thought that was a solid point and made it so, so you are now listed as a maintainer for afdstats. Go wild! Enterprisey (talk!) 00:58, 5 January 2024 (UTC)[reply]

@Enterprisey Sorry for not responding sooner, but I've been off wiki for a couple of weeks. Thanks for that, although I hope to not have to use it! --Ahecht (TALK
PAGE
) 08:04, 17 January 2024 (UTC)[reply]

Rugby World Cup

Thanks for noticing that I mistyped the LST on 2023 Rugby World Cup. Out of curiosity, now that that's been sorted, do the pool stages really need to have the {{cite web}} etc use the #invoke call directly or can those edits be reverted? Primefac (talk) 08:51, 19 January 2024 (UTC)[reply]

@Primefac I was in the middle of reverting that when my internet went out yesterday. I agree that there's no need for those more drastic measures any more. --Ahecht (TALK
PAGE
) 21:56, 19 January 2024 (UTC)[reply]
Spiffy. Primefac (talk) 22:05, 19 January 2024 (UTC)[reply]

Module idea

Someone's requested a {{page-range}} template for putting in pages that should be separated by an en dash, for people who aren't too handy with getting at that character. I think it would have rather limited use, and should be flagged as an always-substitute template so bots replace it, but would have some use, and as module could maybe even be invoked from inside some other templates to normalize poor-quality input, if what I suggested below were to be done with a clever module. I was cobbling together something to just take {{page-range|23|31}} and output 23–31, but then I remembered your tweaking of the module beind Module:Section link to parse the first parameter for # and auto-handle what follows as if it had been {{{2}}}, and this suggested to me that we could have a template that would accept the above two-page-numbers-as-separate-parameters input, but also parse {{page-range|23-31}} or {{page-rage|23 - 31}} or {{page-rage|23–31}} or {{page-range|23—31}} or whatever and always produce the same result. But I can't Lua my way out of a paper bag (more of a bash and JS and perl and php nerd).  — SMcCandlish ¢ [😼  07:49, 24 January 2024 (UTC)[reply]

  • @SMcCandlish: You could do it with {{safesubst:#if:{{{2|}}}|{{{1|}}}–{{{2}}}|{{safesubst:#invoke:string|replace|{{{1|}}}|%s*[-–—]%s*|–|plain=false}}}}, which makes use of the existing Module:string. --Ahecht (TALK
    PAGE
    ) 15:27, 24 January 2024 (UTC)[reply]
    Ah yes! I was sure you'd have the answer. I implemented a fancified version at Template:Page range. Just to be sure, this Lua-internal variant of regex [...] doesn't requiring escaping anything like -?  — SMcCandlish ¢ 😼  00:51, 25 January 2024 (UTC)[reply]
    @SMcCandlish Lua patterns, at least in the current implementation, are smart enough to know that that a dash as the first item in a set is a literal dash and not a quantifier or indicating a range, but if you want belt-and-suspenders, you can replace [-–—] with [%-–—] (Lua patterns uses % as the escape character instead of \). --Ahecht (TALK
    PAGE
    ) 04:08, 25 January 2024 (UTC)[reply]
    Got it. Would it need that escape char if the hyphen were in the middle of that stuff?  — SMcCandlish ¢ 😼  04:10, 25 January 2024 (UTC)[reply]
    @SMcCandlish Yeah, it would interpret [–-—] as all the ascii characters between &ndash; and &mdash;. In this case, since they are adjacent, it would just match those two, but if they weren't adjacent it would also accept anything in between. If you wanted to be really tricky you could use [‐-―] which would match &hyphen;, &dash;, &ndash;, &mdash;, and &horbar; since they're ASCII codes 8208 - 8213, but that's the sort of thing you'd do in code golf, not in real life. --Ahecht (TALK
    PAGE
    ) 04:26, 25 January 2024 (UTC)[reply]
    I put the escape char in just in case someone puts some other character in front of the hyphen-minus not realizing that would convert it into a range indicator in the expression. Better safe than sorry!  — SMcCandlish ¢ 😼  04:54, 25 January 2024 (UTC)[reply]

"you can't reference an anchor that starts with a #"

re this edit, you actually can: compare Help:Template limits##invoke syntax and Help:Template limits#invoke syntax. ;) ディノ千?!☎ Dinoguy1000 07:30, 2 February 2024 (UTC)[reply]

@Dinoguy1000 must be browser dependent, as neither of those worked for me before adding the manual anchor. --Ahecht (TALK
PAGE
) 13:15, 2 February 2024 (UTC)[reply]
I'm using Firefox, though I assumed this worked in all browsers considering it's the typical way to link to the PaserFunction documentation on MW.org: mw:Help:Extension:ParserFunctions##if for example. If this is indeed browser-dependent, that page (and probably some others) needs some anchors added. ディノ千?!☎ Dinoguy1000 22:30, 2 February 2024 (UTC)[reply]