[00:22:34] is it important in extensiosn to use ConfigRegistry rather than globals? [00:22:38] extensions* [00:26:00] I don't really see the point, to be honest -- seems like more work somehow [01:38:44] ningu: it's a good idea, because it enables config to be backed by things other than globals in the future (such as a configuration database) [01:39:29] Plus you save time in the future having to refactor stuff ;) [02:54:16] did anyone see my question above on ConfigRegistry vs globals? [02:55:10] ningu: yes, you got two replies [02:55:13] ningu: ningu: it's a good idea, because it enables config to be backed by things other than globals in the future (such as a configuration database) [02:55:17] ningu: Plus you save time in the future having to refactor stuff ;) [02:59:05] ok thanks [02:59:11] ok [02:59:11] didn't mean to disconnect [02:59:25] no worries; I'm happy to assist [03:00:05] what's best practice then for using the config registry? there is this line: $config = MediaWikiServices::getInstance()->getMainConfig(); [03:00:27] if I have a class for my extension with public static methods that get called by hooks (say) should I call that in every method that needs to read config? [03:03:25] or should I somehow do it once at the top of the file, outside of the class definition? [03:03:56] sorry, the line I meant was: $config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'yourextension' ); [03:56:25] ningu, maybe you can check how some of the other extensions are doing it here - https://codesearch.wmflabs.org/extensions/?q=makeConfig&i=nope&files=&repos= [04:20:53] abijeet: thanks [04:20:59] I was looking for a search like that [04:21:03] but wasn't sure where/how [12:17:31] Sometimes there are aspects of wikitext that make me want to go to a small sound-proofed room and start screaming [12:20:10] https://en.wikisource.org/w/index.php?title=Page%3AHill%27s_manual_of_social_and_business_forms.djvu%2F111&type=revision&diff=9919024&oldid=9905227 [12:20:25] Both work. [12:20:44] The latter was how I was recomended to do it though [12:21:08] The latter has a vastly expanded post include size though [12:21:24] And what was wrong with the former? [12:21:29] One whitespace [12:22:01] that was due to mediawiki handling of DD and DT elements on conversion from markup into HTML [12:22:12] 1 whitespace (sigh) [12:24:55] https://en.wikisource.org/wiki/Wikisource:Scriptorium/Help#Page:Hill's_manual_of_social_and_business_forms.djvu/108 [14:56:50] hmm [14:56:53] User:ShakespeareFan00/Sandbox/DLrendering [17:05:11] Quick question... Where does mediawiki store it's core stylesheet? [17:09:46] ShakespeareFan00: "store" as in git? Or as a path on a server where MW is installed? [17:11:47] As in where do I find out what a
gets styled as by the Parser? [17:12:18] I was rolling my own stylesheet for something and wanted to know what mediawiki applied by default [17:12:48] Mostly it's to do with margins [17:15:35] it'd be defined by the skin iirc [17:16:26] Yes and I looked into that [17:16:38] an easy way to tell where any particular style is coming from is to flip on resourceloader debug mode, then inspect the element in question in your browser devtools. It'll show each style applied to that element as well as the source, which will get you to the exact module that defines said style [17:16:40] And could not figure it out [17:17:05] Skizzer: How do I switch that on? [17:17:15] I'm on Wikisource currently [17:17:17] ?debug=1 [17:17:20] Thanks [17:18:17] https://en.wikisource.org/w/index.php?title=User:ShakespeareFan00/Sandbox/DLrendering?debug=1 [17:18:22] didn't [17:18:50] Said it couldn't find the page [17:19:14] learn what query strings are and how to add things to them [17:20:02] (sigh) [17:21:15] What EXACTLY do I have to type in a browser ? [17:23:12] ShakespeareFan00: I'm not going to hold your hand on this. If you're going to be getting into development stuff you should understand the basics of it. I gave you a term to research, and if you look that up, it should be eventually apparent how you need to manipulate the URL [17:23:24] teach a man to fish and all that [17:24:17] ShakespeareFan00, the URL that you posted won't work, as there is already a ? in that URL. So it should be: https://en.wikisource.org/w/index.php?title=User:ShakespeareFan00/Sandbox/DLrendering&debug=true [17:24:31] ShakespeareFan00: or https://en.wikisource.org/wiki/User:ShakespeareFan00/Sandbox/DLrendering?debug=true [17:24:57] ShakespeareFan00: Then you can use your web browser's developer tools to look at the exact CSS applied [17:25:12] I did that [17:26:17] It syas the atyle concerned is from load.php [17:26:27] And gives a line number [17:26:33] *style [17:27:48] yep, debug=1 means that each load.php call is a separate module. If you click on the link, you'll be able to see exactly what module it is [17:28:05] if the text doesn't tell you, the URL will [17:28:41] Oh.. okay... /me puts on noob hat [17:29:15] looks like firefox likes making it complicated, idk what chrome does [17:29:34] what browser are you using? [17:30:24] Firefox and i'm having a hard time finding where it's showing the relevant URL [17:31:01] ShakespeareFan00: hover over where it says "load.php:NN @screen" [17:31:05] the tooltip has the URL [17:31:31] part of the URL says &modules= -- that's the module name to look at [17:31:37] and which defines it [17:31:45] Okay [17:31:48] Convoluted... [17:31:52] Is this documented? [17:32:01] looks like firefox likes making it complicated <- hence that line ;) [17:32:08] ShakespeareFan00: https://developer.mozilla.org/en-US/docs/Tools/Web_Console [17:32:24] (I have a feeling finding the default styles might be an FAQ) [17:33:03] it'd be outdated in short order if we tried documenting it, browser makers change their devtools on a somewhat frequent basis [17:33:33] we do have ResourceLoader documented, including how to enable its debug mode and what that means [17:33:41] Well I have a name = mediawiki.skinning.interface [17:34:00] but the audience for that documentation are people who are already familiar with CSS and how mediawiki is laid out [17:34:10] (sigh) [17:34:32] I should just exit now before I embarrass myself further [17:34:38] :( [17:34:41] ok now that you have a module name, you need to find that file in git [17:34:49] you're 90% of the way there [17:35:02] giving up now seems unwise [17:35:27] IS that a PHP name or an actual filename? [17:35:32] actual filename [17:35:34] (ish) [17:36:06] https://github.com/wikimedia/mediawiki/find/master was what I was using to search [17:36:56] Ah... https://github.com/wikimedia/mediawiki/tree/master/resources/src [17:37:15] Thank you :) [17:37:32] being the file - https://github.com/wikimedia/mediawiki/blob/master/resources/src/mediawiki.skinning/elements.css [17:37:33] https://phabricator.wikimedia.org/source/mediawiki/browse/master/resources/src/mediawiki.skinning/interface.css [17:37:55] Convoluted but bookmarked [17:38:18] And sorry... [17:38:33] I am somewhat new to all this... [17:38:49] You have permission to quote me if writing up an FAQ [17:41:01] Naturally I will also need to check if Vector tweaks this ... [17:41:06] ShakespeareFan00: the (ish) is that "mediawiki.skinning.interface" is a PHP name which can map to one or more files. USUALLY the files are named similarly to the PHP name so it's easy to find [17:41:35] If I can understand convoluted CSS selectors.... [17:41:39] for mediawiki.* modules, you can find the mappings in https://phabricator.wikimedia.org/source/mediawiki/browse/master/resources/Resources.php (Ctrl+F for mediawiki.skinning.interface and you'll see the 4 CSS files that make up that module) [17:42:22] for skin modules, the mapping will be in the skin.json inside of the skin's directory [17:42:56] * ShakespeareFan00 hears a headache sound growing :LOL: [17:43:41] hence why I hid that implementation detail at first, as just looking for that filename usually gives you the results you want [17:43:56] Thanks again [17:44:31] There is a CSS stylsheet for code in mediawiki. [17:44:52] It is defined as styuleshet in the resouceloader, and for the skin [17:44:57] Sorry.. There are 2 ... [17:45:05] and so on :LOL: [17:45:15] .. Amongst such diverse... etc. [17:47:03] Looking at some of the basic styles, I'm suprised how simple some of them are... [17:49:21] My apologies if I seemed a little tense earlier [17:51:25] The vector skin seems to be here - https://phabricator.wikimedia.org/source/Vector/browse/master/;0662f28024509c75302baf9441db6d4cb2765f18 [17:52:55] LESS seems to be a superset of CSS? [17:56:42] Intresting... [17:56:48] I need to do some more reading... [17:56:51] * ShakespeareFan00 out [23:53:12] mediawiki doesn't have a search api to search for pages within a particular category, does it? [23:57:08] Unfortunately not :( [23:57:11] if you have DPL enabled, you could use that I think [23:57:57] for search queries? [23:58:10] how do i use dpl for searching? [23:58:41] at the moment the best I can find is `insource:"Category:Foo"` or `insource:"Cat:Foo"` [23:58:45] hmm, not via api directly, afaik [23:59:12] but why do you need to do that specifically [23:59:35] could just parse the returned category page [23:59:50] to search for "foo" inside of pages which belong to category "bar"