[06:06:04] Hi, how do i use markdown as my wiki syntax on mediawiki? [06:43:27] diverdude: you could try something like https://www.mediawiki.org/wiki/Extension:MarkdownExtraParser ? [06:43:50] wikitext is probably more secure and well integrated with MediaWiki [06:45:18] legoktm: what is wikitext? [06:45:32] wikitext is the MediaWiki markup syntax [06:46:04] https://www.mediawiki.org/wiki/Help:Formatting [06:46:06] and much more [06:46:12] legoktm: ah, yeah...i dont understand why the people behind MW went ahead and invented their own language when they could just use MD [06:46:26] MediaWiki significantly predates markdown :) [06:46:46] legoktm: yeah but they could update [06:47:50] ...to a markup language that suppoerts 5% of what real life wikis are using? [06:48:02] markdown has different goals than wikitext [06:48:14] markdown's priority is readability in source mode as well as decent rendering [06:48:25] what does wikitext have which MD does not? [06:48:28] wikitext's main goal is performance on hostile user input [06:49:30] templating, control flags, functions, custom tags, etc. [06:49:42] what does MD have to support something like https://en.wikipedia.org/w/index.php?title=Barack_Obama&action=edit ? [06:50:24] categories, interlanguage links, and it goes on [06:50:47] hmm i see [06:53:37] https://www.mediawiki.org/wiki/Manual:Parser#Design_principles has some of the rationale on why wikitext was designed the way it was [13:01:01] I'm sometimes getting the message code instead of the message text in JS using mw.message(). Is there a module I need to wait for? I thought RL was making sure that basic modules were available before loading/running other stuff? [13:02:33] Don't know the answer to the question; can only point to https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader [13:20:00] andre__: Thx. There it says "Any messages declared here will be available through mw.msg() after your module has loaded." No mention of having to wait or something. [16:00:31] is it possible to get templates and latest rev_id of a page using a single query, [16:00:33] ? [16:03:29] what are you using to get them? [16:03:54] what i have is a page_id and what i'd like to get is the list of templates associated with a page(prop=templates) and its latest rev_id [16:04:13] on which the templates were returned [16:04:51] prop=info should get the last revision ID, if not try prop=revisions [16:05:58] you want the rev_id of the page, or the rev_id of the templates used on the page? [16:06:31] Vulpix: rev_id of the page [16:06:48] Vulpix: can i combine them in a single query? [16:07:01] yes, you can combine multiple prop [16:07:06] prop=templates|infor [16:07:10] * prop=templates|info [16:08:32] oh i see, so i guess writing this in the python mwapi like this should work? - "session.get(action='query', prop='templates|info'...." [16:08:51] yes [17:42:17] andre__: ty [17:44:16] andre__: I was looking for a way to create these boxes myself.. any easy way? [17:44:27] andre__: similar boxes that is [17:46:46] click "edit" and copy the markup? [17:47:04] if they use some {{template}}, copy the template. [17:52:25] yeah, thanks for the spoonfeeding [18:09:49] I'm trying to build a better templated way to do command syntax (examples of things you'd type at a shell, for example), and
$ /bin/runme 
is a little too... plain. Is there a way to incorporate actual CSS into the template syntax, without having to edit the CSS of the mw site itself directly? [18:10:07] I'm thinking something like this: https://codepen.io/antoineneff/pen/OMegNx [18:19:19] setuid: I think you can use html elements and use inline styles: Text (however, I'm not sure, if anything is supported). However, what do you think about use something like SyntaxHighlight? Probably this extension already has a proper mode for you? [18:19:42] FlorianSW: Is that extension part of the default install, eg: not third-party or external? [18:19:53] This seems to have worked:
[18:19:53]
{{{1}}}
[18:20:04] Using that page's css as a base [18:20:28] setuid: I'm not sure, if the extension is part of the tarball release, however, installing it should be pretty easy. [18:20:46] If it requires admin access or direct filesystem access, it's off the list. [18:21:47] so, it requires access to the filesystem, but no "admin" rights, like sudo or something like that. Can I ask, why you can't do that? If it's a shared wiki hoster, you probably should check, if that extension is already installed on that wikifarm. [18:22:00] Otherwise, you can only use inline-styles for that, like I explained above. [18:22:17] It's a requirement, if it doesn't get delivered in an XML export/import, then it can't be used. [18:36:09] hi [18:36:21] Hello how may we help you? [18:36:24] bye [18:36:29] im okay [19:03:50] HAhaHa [19:06:48] How can I use text inside a template (eg: {{{1}}} ) where that replaced variable includes pipe symbols? That breaks the template today, because the template itself, uses pipes {{Command|title|actual_command}} [19:06:57] I can't escape every single instance of a pipe [19:07:33] This looks like it would help: https://www.mediawiki.org/wiki/Extension:Pipe_Escape [19:07:36] But I can't use it [19:12:50] setuid: use {{!}}, which is a pipe [19:13:16] legoktm: I tried that, didn't work [19:13:46] You mean, everywhere there's a literal pipe in my raw string, replace it with {{!}}? [19:14:12] sorry, could you clarify what you're trying to do? [19:14:40] if you could put the wikitext in a pastebin that would be helpful [19:14:56] This string, for example, I need to pass into my template as {{{2}}} [19:14:57] https://paste.debian.net/hidden/ea947f3d/ [19:16:06] I'll have hundreds of similar examples throughout the pages of the site [19:16:24] I'm not going to assert that everyone who pastes in content to share/author, changes every single pipe to {{!}}, that's unmanageable. [19:17:56] do you have Lua/Scribunto installed? [19:18:08] No, if it does not come with the base, core, mediawiki install, we can't use it. [19:18:15] That's a hard, immovable requirement [19:19:49] ok, hmm [19:19:53] well, here's my terrible idea [19:20:57] do something like {{{1|}}}|{{{2|}}}|{{{3|}}} to rebuild the string that got interpreted as parameters with pipes in the middle [19:21:38] there's currently a RfC for introducing a heredoc-like syntax that would not interpret anything as wikitext [19:21:40] Here's an example of what I've created so far: http://opswiki.openstack.nonpublic.org/index.php/Lay_of_the_Land [19:22:05]
 works, but it's ... too basic
[19:22:19] 	 The original HTML version of that page is: http://opswiki.openstack.nonpublic.org/html/ops-lay-of-the-land.html
[19:22:47] 	 Is there a reason you don't have syntax highlighting enabled?
[19:23:15] 	 https://www.mediawiki.org/wiki/Extension:SyntaxHighlight it comes with MediaWiki so it meets your requirements
[19:24:59] 	 Looks like it requires editing a file on the filesystem side, so that's probably going to be prohibited. 
[19:25:55] 	 Oh, it's already enabled by default in LocallSettings.php
[19:26:54] 	 instead of 
 use 
[19:28:04] 	 Oh neat, yeah, this is much nier
[19:28:06] 	 *nicer
[19:28:28] 	 also  will protect |
[19:29:31] 	 hrm, syntaxhighlight doesn't support current css structs
[19:29:43] 	 Looks like a pretty primitive subset
[19:30:35] 	 it's a wrapper around pygments, you could file an issue there
[19:32:11] 	 Yep, trying something simple like making my command outputs appear on a black background; not supported
[19:33:03] 	 It does support css shortcuts though, so #ffeedd works as #fed, but not color styling of the elements itself
[19:33:06] 	 one bug at a time :) 
[19:40:26] 	 legoktm: thoughts? http://opswiki.openstack.nonpublic.org/index.php/Lay_of_the_Land
[19:40:36] 	 vs. original: http://opswiki.openstack.nonpublic.org/html/ops-lay-of-the-land.html
[19:42:55] 	 page is not loading for me yet...
[19:56:46] 	 wot? It should be quick 
[20:23:26] 	 Hi all! I’ve got an API question and hope somebody can help me …?
[20:23:40] 	 !ask | metawops 
[20:23:40] 	 metawops: Please feel free to ask your question: if anybody who knows the answer is around, they will surely reply. Don't ask for help or for attention before actually asking your question, that's just a waste of time – both yours and everybody else's. :)
[20:29:06] 	 So I want to create a bunch (app. ~100) new Wiki pages in my own Mediawiki installation via a (Python) script. First thing I did was: getting a login token via action=query, meta=tokens, type=login. Worked, got a token. Then I used this token (ending in %2B%5C) in the body of a POST request: action=clientlogin with an existing username, password, loginreturnurl and rememberMe=1. – However, this POST requeast – despite being successf
[20:29:06] 	 with HTTP Code 200 – always returns an error “Invalid CSRF token”. Any hints here?
[20:32:43] 	 Well, this isn’t already inside a Python script, I’m currently just testing the API with a tool.
[20:34:47] 	 It’s version 1.29.1, btw.
[20:34:59] 	 I myself am not familiar with login tokens, but I'd recommend to take a look at #pywikibot for existing bot frameworks
[20:35:10] 	 they might also be able to explain details. I hope. :P
[20:50:53] 	 metawops: are you passing the same cookies? what Python library are you using btw?
[20:53:50] 	 legoktm: I’m not yet programming in Python just exploring the API with an API tool (Paw for macOS). But I was planning to use the “Requests” library.
[20:54:37] 	 you need to make sure that the cookies you get in the first API request are passed in subsequent API requests
[20:55:04] 	 Ah, okay! Didn’t know that! Important hint! Thanks a lot!
[20:55:26] 	 metawops: Special:ApiSandbox on your wiki is a good tool to get familiar with the API
[20:56:54] 	 Oh, that’s cool, too! 😀 
[20:58:47] 	 And I also didn’t quite get the difference between the “login” and the “clientlogin” request. Which one should my Python script use for the purpose of creating those new pages?
[20:59:28] 	 And the action=edit request would be the right one for creating a new page/article?
[21:00:03] 	 action=login is meant for scripts, while action=clientlogin is for tools that have human interaction
[21:00:08] 	 yes, you'd use action=edit to create new pages
[21:00:22] 	 so you probably just want to use action=login here
[21:00:56] 	 I see. :-) Thanks a lot! :-)