[00:01:15] " If you are reading this in your web browser, your server is probably not configured correctly to run PHP applications!" [00:04:38] looks like you're on the right track [00:05:24] mmmmm... It takes a long time for me to configure my mediawiki. [00:05:37] maybe an update will work... [14:35:27] hello, how can I solve out this error please? https://pastebin.com/scSMpV7Y [14:35:38] Fatal error: Uncaught RuntimeException: The configuration setting 'wgMinervaEnableSiteNotice' was already set by another extension, and cannot be set again. [14:56:42] auvajs: could it be that you have the Minerva skin installed twice in LocalSettings.php? [15:03:48] Yaron: I have wfLoadSkin ('MinervaNeue'); [15:03:49] $wgMFDefaultSkinClass = 'SkinMinerva'; [15:07:05] Yaron: except for this, "Minerva" doesn't show off in my Localsettings.php [15:13:10] auvajs: oh, it looks like $wgMinervaEnableSiteNotice is set by the MobileFrontend extension... maybe you have that installed twice? [15:16:19] Yaron: doesn't look like it [15:16:41] only once require_once "$IP/extensions/MobileFrontend/MobileFrontend.php"; [15:33:49] auvajs: sorry, I missed your response. I... don't know why you're getting that error. Hopefully someone else here can help. [15:34:40] It's still early in San Francisco - in a few hours, people there may be able to help you. [15:35:51] Is there a way to use a {{Template|foo|bar}} within a #:list item? [15:36:01] It appears that when I try, it parses the template and breaks the formatting [15:36:42] For example, the last note (in blue) on this page, should be indented and part of the list item: http://opswiki.openstack.nonpublic.org/index.php/Quotas [16:19:36] setuid: it should work as long as the template's expansion does not generate any line breaks. [16:19:56] if you can't avoid line breaks, you can also use html syntax for the list. [16:20:37] actually, it's not just line breaks. any block level elements. [16:41:08] Looks like templates are pretty broken by design, nothing within them parses correctly at all [16:41:37] Is there some other solution? Having to tell everyone to use HTML, inline CSS, markdown AND medawiki wikitext, is going to be a non-starter. [16:44:11] I've converted the source HTML to markdown and then to mediawiki, and am slowly picking through _hours_ of edits per-page, to get it to render similar to the original source HTML [16:44:23] it's exhorbitantly painful and takes way longer than it should [16:48:57] I have a template that looks like this: == {{{1}}} == [16:48:57]
[[File:Information_icon.svg|30px]] {{{2}}}
[16:49:35] If {{{2}}} happens to be a list, either in mediawiki format, raw HTML or plain bullets, the resulting construct is rendered as the literal {{{2}}} and inserted into the page (literally 3 open braces, the number 2, 3 closing braces) [16:50:42] What is the point of templates, if they don't work at all? [16:54:24] setuid: if the param contains an = sign, you need to explicitly specify the param [16:54:32] {{template|thing|2=thing=with=equals}} [16:55:23] Come again? I'm passing a title ("Note"), and a string of text, which just happens to be either plain text, HTML or mediawiki text [16:55:36] if that text you are passing has an equals sign (=) [16:55:37] {{{1}}} is the title {{{2}}} is the string of text (the "body" of my template) [16:55:42] you need to explicitly name the template parameter [16:55:49] e.g. 2=your text goes here [16:55:56] instead of just plainly specifying it [16:56:20] because you can have named params too like {{{body}}} [16:56:30] and specify as {{template name|body=text goes here}} [16:56:56] so if your text has equals sign like
...
[16:57:27] then it thinks you are trying to pass a parameter name "
...
[16:57:32] Nope, as expected, fails. http://opswiki.openstack.nonpublic.org/index.php/Ops-user-facing-operations [16:57:37] Look at all the blue callouts [16:58:15] you have some broken tags [16:58:18] on that page [16:58:22] maybe template related [16:58:37] The assertion that instead of using 1 markup format, I now have to incorporate and merge 3-4 or more in the same page/same syntax, is a big blocker to adoption. [16:58:51] setuid: wikitext is sadly pretty broken. it's not designed, it grew. there's not context free grammar for it. there's actually no production grammar for it. We are trying to fix the worst bits, but it takes time - afterall, we have to stay backwards compatible, bug-by-bug. This ticket may interest you: https://phabricator.wikimedia.org/T114432 [16:58:53] Yes, this is the "hours of work per page" I have to put in. [16:59:32] I'm basically rewriting the page, word for word, because every new construct, it handled _randomly_ and differently by mw's rendering engine [17:00:16] I have to twiddle everything everywhere, because mid-page anchors don't work as they should, templates don't work as they should, other syntax constructs don't work as they should [17:00:21] hmm [17:00:32] your template looks fine, I have no idea why it's breaking there [17:00:41] I should really just push the project team to move to wp or some other CMS that handles this ccleanly [17:01:01] Skizzerz: Right, I've been banging my head on the desk about this for days [17:01:19] Every page, requires snowflake changes that previous page's rendering didn't need [17:01:36] There's absolutely no way to make this portable or reproducible, that I can see [17:01:45] every page _requires_ unique, snowflake syntax, it's very inconsistent [17:01:47] setuid: adding support for an alternative syntax to mediawiki wouldn't be so hard. making all of mw's features available via that syntax would be tricky, though. [17:02:08] DanielK_WMDE: If it's not part of the core (eg: an external plugin), we can't use it [17:02:10] i once added basic markdown support to mw in 30 minutes during a hackathon demo :) [17:02:42] setuid: huh? why is that? mediawiki is unusable with *no* extensions [17:02:44] For comparison, here's the rendered HTML version of this same page: http://opswiki.openstack.nonpublic.org/html/ops-user-facing-operations.html [17:03:04] setuid: in fact, you are using a bunch of extensions http://opswiki.openstack.nonpublic.org/index.php/Special:Version [17:03:20] DanielK_WMDE: The extensions that ship with it, are what we can use. Anything external, anything not shipped with the default mediawiki.org downloaded tarball of the project, can't be used. [17:03:43] Everything used on the current site above, is what was installed with the _default install_ [17:03:49] setuid: i suggest to update that to "it'S ok to use stuff that wikimedia has deployed". [17:03:52] much more sensible policy [17:03:54] Nothing at all was done to add/edit/install/change/remove any extensions [17:04:19] i'd be happy for mw to ship with a markdown module, though :D [17:04:27] DanielK_WMDE: As long as "wikimedia has deployed" it into the same tarball that the original install comes with, that's fine. [17:04:54] setuid: at this point, it sounds like you're better off not using mediawiki [17:05:19] if you're limiting yourself to only extensions bundled with the tarball, you're going to have a bad time [17:05:25] setuid: that seems like a strange restriction to me... [17:05:29] (as you're experiencing already) [17:05:35] One problem at a time though, why can't I have a string of text in my template variables, and why does mw decide to handle it differently depending on the construct? Sometimes it passes it thorugh 'raw', sometimes it renders it (poorly/broken) [17:05:37] we should just offer custom on-thy-fly tarballs ;) [17:05:57] for your particular template, it shouldn't make any difference [17:06:01] which is the weird part [17:06:23] I should either be able to pass a string in that mw sends thorugh 'raw', allowing me to write it 'raw', or it should attempt to parse/render it, in which case I can construct the string to render corectly. [17:06:29] setuid: template parameters cannot contain any and all constructs. in particular, they are sensitive to "=" and "|". [17:06:38] the ticket i pointed you to is trying to fix that [17:07:05] whether mw tries to render the parameter depends on what you do with it inisde the template. [17:07:09] ah right, forgot about | [17:07:13] DanielK_WMDE: Ok, let's start simple: How do I pass a bulleted list into a template var?
  • one
  • two
fails, as does * one \n* two [17:07:23] neither should fail [17:07:27] Both fail [17:07:33] I get {{{2}}} rendered to the page [17:08:07] https://paste.debian.net/hidden/00c95835/ [17:08:08] for example [17:09:13] Whether I put that all on one line, separate lines, indent, or otherwise, it gets rendered as the raw {{{2}}} into the page [17:09:47] setuid: https://www.mediawiki.org/wiki/User:Daniel_Kinzler_(WMDE)/Sandbox [17:09:47] Something like this, also fails: {{Notice|Note|2=The following implicit values are being used to create the signature in this example:
  • Signature hash method = SHA-256
  • Signature key type = RSA-PSS
}} [17:10:09] setuid: never indent. that triggers
 mode.
[17:10:22] 	 ...which is a block element, which will break lists.
[17:11:13] 	 Just tried your example, it _strips_ the rendering from the page, so the resulting block is missing from the rendered page
[17:11:21] 	 oh
[17:11:26] 	 probably Tidy related
[17:11:36] 	 {{Notice|Note|The following implicit values are being used to create the signature in this example:
[17:11:36] 	 * Signature hash method = SHA-256
[17:11:36] 	 * Signature key type = RSA-PSS
[17:11:37] 	 }}
[17:12:27] 	 I feel like I'm building a sandbox, by pushing 1 grain of sand at a time with the tip of a toothpick 
[17:13:23] 	 all of your problematic templates are nested in an 
    [17:13:26] Ok this appeared to work in this specific case: [17:13:28] {{Notice|Note|2=The following implicit values are being used to create the signature in this example: [17:13:28] * Signature hash method = SHA-256 [17:13:29] * Signature key type = RSA-PSS [17:13:29] }} [17:13:33] setuid: the = signs are the problem [17:13:49] setuid: {{Notice|Note|2=The following... [17:14:00] I can't control what strings would be passed into a template, that's the whole point of it being a template. If I could control them, I'd write them by hand. [17:14:08] so always add 2= [17:14:12] The other thing I've noticed, is that you can't use templates inside lists [17:14:19] or rename {{{2}}} to {{{body}}} and always add body= [17:14:30] # {{Template|foo|bar}} [17:14:30] #: For example [17:14:31] you can, as long as they don't produce block level elements [17:14:44] or if you use Tidy (I think) [17:14:44] wikitext doesn't support block level conststructs in lists [17:14:52] DanielK_WMDE: Again, I won't ever know what they'll produce, it's a string being passed into a variable. [17:15:06] although that won't help for wikilists where the content contains newlines [17:15:08] HTML supports it, why wouldn't wikitext? [17:15:18] * lists are single-line [17:15:28] A simple {{Note}} template, inside a bullet list item, is permissible [17:15:31] so if you're embedding content and said content contains newlines, it may fall out of the list [17:15:35] but wikitext renders it _outside_ the whole list [17:15:51] templates are basically #include from C [17:15:57] it just copy/pastes the output [17:16:01] and THEN parses the result [17:16:03] setuid: oh, don't ask "why" wrt wikitext. basically, the answer is: "because we can't change it without breaking millions of pages" [17:16:25] we know it sucks. we have been discussing wikitext 2.0 for years. a decade, actually. [17:16:48] I go back with mediawiki that far... [17:16:59] but there'S no smooth transition. we'd have to start over. and automatic conversion is hard exactly for the reasons you state [17:17:05] we don't even have an actual parser... [17:17:15] I was pushing wikipedia via local mediawiki deployments to PalmOS devices a decade+ ago [17:17:21] (that is a bit of a simplification, there's some parsing involved before template subsitution, but the gist is if there's a contenxt-sensitive element such as a * wiki list item, your template content can't have newlines in it) [17:18:03] yea... i'm afraid it's just that: mediawiki does not support arbitrary content in template parameters. there is no way to do that. [17:18:14] https://phabricator.wikimedia.org/T114432 is so far the best proposal for fixing this [17:18:17] So here's my current pain: OpenStack manuals are renderd in HTML from buildstream (python code/templates that output html). I take that and push it to pandoc, converting it to markdown, and then convert _that_ to mediawiki. [17:18:27] It gets me 80% of the way there, except these weird parsing constructs [17:18:32] why not get a wiki that natively supports markdown and use that? [17:18:38] is mediawiki absolutely required? [17:18:43] In this case, yes. [17:18:56] setuid: well, if it'S generated, then always use explicit naming for all template params. [17:19:02] It's an established tool that took a very large committee and many months to decide to use [17:19:03] 1=...|2=...|3=... [17:19:26] uh, pandoc natively supports mediawiki sxntax... no idea how well, though [17:19:57] find . -type f -name '*html' | while read line; do pandoc -f html+lhs -t markdown-raw_html-native_divs-native_spans -o "${line%.html}".md "$line"; done; [17:19:57] find . -type f -name '*.md' | while read line; do pandoc -f markdown+lhs -w mediawiki "$line" -t mediawiki -o "${line%.md}".wiki; done; [17:19:58] perl -pi -e 's,\=+(.*)\[\[\#(.*)\|\ΒΆ\]\] \=,\=\=
    $1
    \=\=,g' *.wiki [17:20:19] That's what I'm doing so far, in addition to hand-fiddling with the final syntax to resolve little issues like these templates [17:20:48] The two-step conversion is required, because going straight from html to mediawiki leaves divs/spans/other HTML garbage around that wikitext can't deal with [17:22:35] So let me understand what you said about templates: Currently I'm using {{{1}}} and {{{2}}} in my templates. 1 represents the 'header' of the template (the callout/pullquote word that identifies it), and {{{2}}} is the actual body of the template. In the case of "Note:" style callouts, that would be {{Notice|Note|Here's something to note}} [17:22:43] setuid: divs and spans should actually be fine in wikitext. most presentational html works in wikitext. [17:23:12] * DanielK_WMDE will go afk in 5 minutes [17:23:22] So you're saying to update the template(s) to refer to {{{header}}} and {{{body}}} instead, and in the caller, use {{Notice|header=Note|body=Here's something to note}} [17:23:45] setuid: that [17:23:52] setuid: that's the "nice" version [17:24:16] you can also keep using {{{1}}} {{{2}}} etc, and call with {{Notice|1=Note|2=Bla bla}} [17:24:31] positional parameters have the implied names 1,2,3,4... [17:24:32] But once I've updated my template, I have to go back through every page, one by one, and change hundreds to thousands of references to that template's usage. [17:24:46] they can also be given explicitly. if you do, you get rid of the problem with = in the text [17:25:08] you still need to replace all | in the text with {{!}} and define Template:! to be just | [17:25:20] That won't work either [17:25:22] (yea, fun hack. universal across wikipedia & friends) [17:25:42] https://en.wikipedia.org/wiki/Template:1 [17:25:43] I can't assert that everyone who contributes, replaces tens of thousands of pipe symbols with {{!}} before pasting [17:25:45] err. [17:25:49] that's an enormous blocker to adoption [17:26:34] I get that making the decision to use | as a parsing/template separator was a huge mistake, but you're stuck with it now. [17:26:53] wrong link. oh, i see, {{!}} is actually a magic word now, and mw ships with it. [17:27:15] setuid: we know it sucks. But in the end, no matter what syntax you use, you'll always need escaping for *something* [17:27:17] As long as it can trasparently convert pasted in | symbols in strings to {{!}}, that's fine [17:27:22] for mw templates, you have to escape | [17:27:31] Right, so that's not going to happen [17:27:31] it's our separator. [17:27:43] how do you expect mw to know when you use it as a separator, and when you don't? [17:28:12] I don't, that's the design decision that causes this pain, and now you can't unbury yourself from it, unfortunately [17:28:24] setuid: you will not find any language that has no restrictions on tremplate parameters. you *always* need to escape *something*. [17:28:33] maybe somethign less annoying than |. But *something* [17:28:56] Sure, but many languages choose something wacky that would be extrordinarily rare to appear in 'normal' text, and they parse on that [17:29:06] #XXX=!= or whatever else makes sense [17:29:23] which is, i assume, why | was chosen instead of , or ; [17:29:32] it'S very very rare in text [17:29:43] it's just not rare in code. [17:29:48] All three are incredibly poor choices; csv, pipe-delimited files, etc. [17:30:08] yea - it was designed for writing an encyclopedia, not tech manualy. [17:30:13] Heck, even a double-pipe would have been much safer [17:30:22] that'S an explanation, not a justification - I do feel you pain. [17:30:40] *tech manuals [17:30:43] anyway, gtg [17:30:43] Well, how do you have an encyclopedia without talking about languages and language constructs? tables? tabular formats? ascii delimiters? [17:31:05] Thanks for the help, I'll muddle through this, or replace the templates with raw, hand-drawn HTML... going full-circle. [17:31:11] well, you can. it'S rare enough that the escaping isn't too bad. [17:31:12] HTML -> markdown -> mediawiki -> HTML [17:31:21] until you start writing documentation for templates [17:31:27] then it becomes *really* annoying. [17:31:42] https://paste.debian.net/hidden/3755f74e/ [17:32:13] for example, having to assert that community contributors parse that and replace every | with {{!}} is going to be met with much resistance [17:39:47] Looks like we're going to have to do this ALL, 100% in HTML, and skip wikitext entirely. It's just not ready for prime-time. [17:40:06] So it'll be mediawiki for linking to hrefs and pages, but the rest will be raw, hand-drawn, HTML [18:05:28] Ok, question: is there a way to get wikitext _not_ to render my little callout templates in the Contents at the top of the page? For example: http://opswiki.openstack.nonpublic.org/index.php/User-Facing_Operations [18:05:40] All of the little "Note" items are clogging up the contents [18:08:28] you mean the Table of Contents? [18:10:43] Don't use a Template that always inserts Notes as

    ? [18:17:18] ah, so == automatically triggers it? [18:19:38] == is

    , === is

    , ==== is

    , etc. [18:19:56] any headings (whether == wikitext == or

    html

    ) show in the TOC [18:20:02] Right, I didn't know that the presence of it in the page triggered the TOC items [18:20:48] if you don't want the TOC at all, you can suppress it by putting __NOTOC__ anywhere on the pag [18:20:49] *page [18:21:00] if you just don't want Notes in there, change it to not use a heading [18:25:18] Ok, how does this look? http://opswiki.openstack.nonpublic.org/index.php/User-Facing_Operations [18:25:31] Compare to: http://opswiki.openstack.nonpublic.org/html/ops-user-facing-operations.html [19:03:15] setuid: since you did the work, you obviously already like the currently-popular style :) [19:12:53] hrm? [19:17:26] you seemed to ask for opinion on comparison. I was pointing out you already knew which one you like. [19:18:50] so I figured it was more of a "I'm proud of this I've done" rather than a "what do you honestly think" [19:25:29] is there a way in api to get the actual page given the page id of its talk page? [21:45:21] I can't seem to find a way to override the syntaxhighlighter to add styling, eg: black background on shell commands [21:45:40] using lang=console, it's overriding my style="..." css styling [22:32:58] setuid, is this regarding usage of https://www.mediawiki.org/wiki/Extension:SyntaxHighlight ? Are you following the instructions in the #Styling section, or are you trying to override on a per-page basis? [22:39:40] The #style section seems to just be related to the surrounding div. I don't believe the Pygments libraries can be overridden on a per-page basis. I.e. https://www.mediawiki.org/w/index.php?title=User:Quiddity_(WMF)/sandbox&oldid=2611748 [22:45:50] That's actually vector's styling not pygments (I think) [22:46:01] compare with https://www.mediawiki.org/w/index.php?title=User:Quiddity_(WMF)/sandbox&oldid=2611748&useskin=timeless [22:48:25] setuid: If you specify the inline attribute and then provide your own div, it may fix the issue, since the whitebackground seems to come from the
     that gets inserted
    [22:49:10] 	 setuid: Or you could override the pre styling in your MediaWiki:Common.css (or using TemplateStyles if you have that extension installed)
    [22:59:53] 	 ah, interesting. ty for the correction :)