User talk:Most2dot0

From Angelina Jordan Wiki

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)
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 (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)

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)