User talk:Most2dot0
Scribunto
We now have Lua modules (output of example module: Hello World!) with syntax highlighting and a special code editor for editing the module pages (and user CSS and JS pages — see, "Appearance" in your Preferences). To use the code editor, you have to have "Enable the editing toolbar" selected in your preferences (under "Editing"). Unfortunately, the font used in the code editor is hardcoded to a tiny size (for me, anyway), and user CSS cannot override that (and almost certainly not sitewide CSS either, although I have not tried that). Note that you can toggle between the code editor and the normal "source" editor (i.e., the one used for normal wikitext) using the "<>" icon in the upper-left corner of the code editor (the icon is not shown when editing normal wiki pages). Happy coding… (BTW, if you reply, please do so here and not on my user page, so the discussion stays in one place.) - dcljr (talk) 00:59, 24 July 2024 (UTC)
- Thanks, Lua seems to work fine. Though I wonder, if this is a different editor than the one on Wikipedia, or if it is differently configured? One thing I noticed is that there is no special support for JSON files, whereas on Wikipedia, there is a syntax check that is helpful. They also have a special view for them outside of the editor (but that's less important, thought it can be convinient to understand the content). ~ Most2dot0 (talk) 23:16, 28 July 2024 (UTC)
- Not surprising that it's different on Wikimedia sites. If you can find out what is causing the differences, I can look into maybe enabling/installing those things here. Speaking of differences, do you see OK font sizes in both the Code Editor and the regular source editor? For me, it's very much smaller in the Code Editor. I have been reminded that I set up a site-wide override for the editor font size in MediaWiki:vector.css back when I first started using the wiki. That has no effect in the Code Editor, though. If you'd like, I can delete that and instead use my own per-user "vector.css" or "common.css" for myself. I have also been reminded that I have my own User:Dcljr/common.js that provides syntax highlighting in the regular "source" editor, which is very helpful when editing templates. I can try to set that up site-wide through the CodeMirror extension (which allows you to turn it on and off in the editor). Or you can copy the code in my "common.js" to yours (accessible through your preferences), if you'd like to try it out. - dcljr (talk) 06:29, 30 July 2024 (UTC)
- I'd say the size in the code editor is indeed very small, and I usually enlarge it using the zoom feature of the browser. However, it's not smaller than e.g. the Wiki menu on the left (below your Wiki's logo), or like text in article pages. So it's more a general problem. The one in the normal editor is indeed larger, maybe a nod larger than needed. But I have no issue with that. For the syntax highlighting, I copied your .js file. It looks like a help indeed, though the highlighting of the background instead of the font is somewhat unusual. ~ Most2dot0 (talk) 16:36, 30 July 2024 (UTC)
- I just got a new computer (and thus a fresh Firefox install) and have found that the font-size settings I was using here are not working for me. (I guess I should have paid more attention when you said, "it's more a general problem"!) So I've decided to ditch the site-wide hardcoding of the editor font size (not sure why I elected to do that in the first place, apart from just that I was the only user on the wiki at the time, so it didn't matter) and move those settings into my skin-specific user CSS. Please adjust your own settings as appropriate. I'm hoping that the next MediaWiki update (which is already available and needs to be done sometime "soon") will make this wiki look/behave a little more like Wikipedia currently does. Will comment elsewhere (later) about the CodeEditor, etc. - dcljr (talk) 03:03, 21 January 2025 (UTC)
- I'd say the size in the code editor is indeed very small, and I usually enlarge it using the zoom feature of the browser. However, it's not smaller than e.g. the Wiki menu on the left (below your Wiki's logo), or like text in article pages. So it's more a general problem. The one in the normal editor is indeed larger, maybe a nod larger than needed. But I have no issue with that. For the syntax highlighting, I copied your .js file. It looks like a help indeed, though the highlighting of the background instead of the font is somewhat unusual. ~ Most2dot0 (talk) 16:36, 30 July 2024 (UTC)
- Not surprising that it's different on Wikimedia sites. If you can find out what is causing the differences, I can look into maybe enabling/installing those things here. Speaking of differences, do you see OK font sizes in both the Code Editor and the regular source editor? For me, it's very much smaller in the Code Editor. I have been reminded that I set up a site-wide override for the editor font size in MediaWiki:vector.css back when I first started using the wiki. That has no effect in the Code Editor, though. If you'd like, I can delete that and instead use my own per-user "vector.css" or "common.css" for myself. I have also been reminded that I have my own User:Dcljr/common.js that provides syntax highlighting in the regular "source" editor, which is very helpful when editing templates. I can try to set that up site-wide through the CodeMirror extension (which allows you to turn it on and off in the editor). Or you can copy the code in my "common.js" to yours (accessible through your preferences), if you'd like to try it out. - dcljr (talk) 06:29, 30 July 2024 (UTC)
- The common.js mention brought some whole new ideas up. I will describe them below ~ Most2dot0 (talk) 16:57, 3 August 2024 (UTC)
Embedded YouTube player
I implemented (again curtesy of ChatGPT) an embedded YouTube player, that through some additional scripting now support dynamic playlists of videos with start and end times (the YT player itself can do either, but not combined). I also implemented two ways to provide the video IDs: one via a list of IDs with optional start/end times added, the other via enclosing a text that contains youtube urls, that will be used for the playlist, also for start and end times (EDIT, solved --Most2dot0 (talk) 12:11, 4 August 2024 (UTC): though the current implentation does not work when both are provided for an url). Have a look at User:Most2dot0/Test to see how it is being used. Now, to see the magic in action, you need to copy from my [[User:Most2dot0/common.js to your's. As I started with a copy of your's, I assume you could just copy the whole content. But before you do that, also have a look at the next section, where I use it in an auto-generated songs-list. As for the players functionality, you have the skip back/forward buttons below the video, and you can click on the urls that initilized it, to play that video in the player (you can go from there to the original via the players (watch on) YouTube button. ~ Most2dot0 (talk) 16:58, 3 August 2024 (UTC)
- Have looked at this (last year and again today) without any additional configuration on my part, and was suitably impressed. Have not yet gotten The Full Effect (i.e., the "magic"), but maybe soon… [grin] - dcljr (talk) 06:58, 21 January 2025 (UTC)
- The performance database has it's main page on Performances. I also in the meantime added more examples/test in User:Most2dot0/Test. And the common.cs code really makes a difference [grin]! It will also give you a new look on some existing pages, like from the Kongsberg Jazz Festival. I'm keen on your feedback if you are ok with turning the Wiki into a more multimedia type of experiance... -Most2dot0 (talk) 17:50, 21 January 2025 (UTC)
Module:SongsToVideos
At the buttom of that page you also find a render of the Data:SongsToVideos.json content to a songlist with example videos via Module:SongsTable. I took the videos from my YouTube A-Z index playlists (or from the references of the Songs page). Also the Songs themself were taken from that page. The data still needs some clean-up. I saved comments and refs (though I probably need to redo that), but they currently get not rendered yet, and there are also some other things that need to be clarified, for which I will put a comment on the Talk:Songs page. Anyway, once you enable the substitution of the div tags via common.js, you will also see an embedded YouTube player in each of the expandable video lists. If the players are not loaded, the original links will work, calling the video on YouTube directly. ~ Most2dot0 (talk) 16:58, 3 August 2024 (UTC)
- Sorry I didn't research this stuff more last year. I started to, but Things Happened. As you surely already know, since "Data" is not a real namespace on this wiki, those JSON pages are in the main (article) namespace. I guess this kind of page at Commons is what you meant by Wikipedia having a "special view" for JSON data? I also assume that I need to install mw:Extension:JsonConfig to make that happen here. Yes? - dcljr (talk) 05:30, 21 January 2025 (UTC)
- I think the first link you gave is something else. However, the visualization example in the JsonConfig extension looks a lot like what I have seen on Wikipedia, e.g. at wikipedia:User:Most2dot0/sandbox/Data:VideoMetaData2.json. From what I read, that seems to provide more than just providing the visulization and context aware editing, which would not be required for my purposes. And I think the visualization is not needed, so if there would be a way to get the code editor being aware of JSON without this extension, it would be fine as well. BTW, it would also be good to have doc sublinks in that namespace working, but that's not the case in WP either. Most2dot0 (talk) 17:29, 21 January 2025 (UTC)
- OK, JsonConfig is something else. I'm wondering whether the "content model" of the JSON page(s) just needs to be changed from "wikitext" to "JSON". I think only an admin can do this, but you can try it yourself by going to the page you want to change the content model of, selecting "Page information" in the sidebar, looking for "Page content model" in the "Basic information" table, selecting the "(change)" link, and choosing "JSON" from the "New content model" dropdown menu. Obviously, you should have a copy of the page content squirreled away, just in case something goes wrong. Hopefully the Code Editor will "magically" understand JSON after this is done. If you can't change the content model yourself, let me know and I'll change it (for whatever pages you want) in my guise of wiki administrator. - dcljr (talk) 06:12, 9 February 2025 (UTC)
- I was able to change the content model as you described, and that indeed enabled both the WP like visulization, as well as the code editor. Thanks for figuring that out! Now, I didn't save any edit's yet, but it does automatic "pretty printing", introducing a lot of whitespace compared to the compact form in which I saved the bigger models so far. However, it does not detect any change if not edited, so that migth only take effect on changed lines. We will see. - Most2dot0 (talk) 09:52, 9 February 2025 (UTC)
- OK, JsonConfig is something else. I'm wondering whether the "content model" of the JSON page(s) just needs to be changed from "wikitext" to "JSON". I think only an admin can do this, but you can try it yourself by going to the page you want to change the content model of, selecting "Page information" in the sidebar, looking for "Page content model" in the "Basic information" table, selecting the "(change)" link, and choosing "JSON" from the "New content model" dropdown menu. Obviously, you should have a copy of the page content squirreled away, just in case something goes wrong. Hopefully the Code Editor will "magically" understand JSON after this is done. If you can't change the content model yourself, let me know and I'll change it (for whatever pages you want) in my guise of wiki administrator. - dcljr (talk) 06:12, 9 February 2025 (UTC)
- I think the first link you gave is something else. However, the visualization example in the JsonConfig extension looks a lot like what I have seen on Wikipedia, e.g. at wikipedia:User:Most2dot0/sandbox/Data:VideoMetaData2.json. From what I read, that seems to provide more than just providing the visulization and context aware editing, which would not be required for my purposes. And I think the visualization is not needed, so if there would be a way to get the code editor being aware of JSON without this extension, it would be fine as well. BTW, it would also be good to have doc sublinks in that namespace working, but that's not the case in WP either. Most2dot0 (talk) 17:29, 21 January 2025 (UTC)
Upgrading the wiki
I never enabled mw:Extension:Echo because: (1) I didn't need it when working on the wiki alone; (2) it increases the resource usage of the wiki; (3) as more users join the wiki, there is increased potential for its abuse [i.e., spamming]; and (4) the installation and configuration of the extension itself is nontrivial, and requires me to do more research to make sure I don't break something. But it is undeniable that it would make collaboration here much more efficient and effective. As you have experienced, I often have no idea that you have posted to a talk page because I never check my watchlist or Recent Changes for such things. (I'm not even "watching" most pages here.) I would definitely see emails and on-wiki notifications. So, what are your thoughts about this? (Basically, I'm just asking you to ask me to install it. [grin]) What other extensions do you need? - dcljr (talk) 07:48, 21 January 2025 (UTC)
- I have to say, that would not be one of my priorities right away, but I do check about every time im in the Wiki the updates. I have a browser tab open for the "Recent Changes" page, and that has a notification without reloading the page if something did change from the last time reloading it. -Most2dot0 (talk) 17:41, 21 January 2025 (UTC)
- For other extensions, I'd recommend the Gadgets mw:extension:Gadgets as a means to share such features as the embedded YoutTube player easily, i.e. without the need for each user to copy those things into his commen.cs. -Most2dot0 (talk) 17:41, 21 January 2025 (UTC)
- Just FYI: I've decided to hold off of any other work on extensions until the wiki gets upgraded to the next major version, 1.43, which is a "long-term support" (LTS) version. We're currently on 1.42.5, probably the last subversion of 1.42, which goes "end-of-life" in June 2025. Version 1.43 has actually been available since December 2024, but not through the cPanel application I have to use to upgrade the wiki. In the past, major versions have "hit" cPanel anywhere from 3 days to 3 months after they were officially released, but typically it has taken around a month. So, I assume 1.43 will be showing up in cPanel pretty soon. - dcljr (talk) 05:23, 9 February 2025 (UTC)