kramdown does not format tables - jekyll

Using kramdown version 1.10.0, I am trying to figure out how to get it to render a table. In any of the markdown formats.
I've tried the following:
foo | bar
| foo | bar |
|-----+-----|
| foo | bar |
|-----+-----|
However, none of those seem to render using kramdown.
This is particularly frustrating as I'm trying to show a table in jekyll.

Found the issue, which was two-fold:
Tables are rendered without a border, so it was easy to miss.
I was using an 'html' file extension, rather than markdown. A classic newbie problem.

Related

PhpStorm: how to Make the inspector / debugger ignore stuff in comments?

I don't need it telling me I spelled the word "danggit!" incorrectly. I just want it to ignore the comments.
like this:
<?php
$a = 123;// simple as, danggit!
/* danggit, this frustrates me! */
also
"The word 'thru' is informal. Consider replacing it with through."
I dont want to see this, especially in comments
I don't need it telling me I spelled the word "danggit!" incorrectly. I just want it to ignore the comments.
You can configure where this "Typo" inspection should be applied at the following screen: Settings/Preferences | Editor | Inspections | Proofreading | Typo.
https://www.jetbrains.com/help/phpstorm/spellchecking.html#configure-the-typo-inspection
Danggit, now i'm getting "The word 'thru' is informal. Consider replacing it with through." I dont want to see this, especially in comments.
This is a different thing in action. This time it's Grammar.
Settings/Preferences | Editor | Natural Languages | Grammar and Style -- Here on a Scopes tab you can configure the same. https://www.jetbrains.com/help/phpstorm/grammar.html#scope
... or/and configure what rules to use (on a Rules tab): https://www.jetbrains.com/help/phpstorm/grammar.html#rules
In case if you need to configure too many of them, well... just disable the Grammar checks completely: Settings/Preferences | Editor | Inspections | Proofreading | Grammar

Object literal braces in html IntelliJ

How can I setup IntelliJ IDEA to format code like
hello {{name}}
to
hello {{ name }}
for Angular templates?
If Auto-insert white space in the interpolation is enabled in Settings | Editor | General | Smart Keys, spaces are inserted when completing braces. There is, however, no way to insert them on code reformatting

Referencing data from one article on another

(For the downvote: the reason I am asking on Stack Overflow is because this is a problem involving "programming" with MediaWiki's template system)
I am looking for a way of including data on a MediaWiki article page, such that the data values can be referenced from other pages as well, without needing to duplicate the data on the other pages. Preferably without installing extra extensions.
What I am after is the ability to create an article page that looks like this:
<!-- This page is 'Example' in the main namespace -->
{{Infobox
| CreationDate = 2015-01-01
| CreatedBy = John Smith
}}
This article is about the item created by {{d|CreatedBy}}.
When this page is viewed in the browser, it should appear like this:
+------------------------+
| Example |
| Created on: 2015-01-01 |
| Created by: John Smith |
+------------------------+
This article is about the item created by John Smith.
And then on another page, I can reference the data in the above 'Example' page, like this:
* Example created by {{d|Example|CreatedBy}} on {{d|Example|CreationDate}}
Which will appear like this:
* Example created by John Smith on 2015-01-01
The typical use for this is to place the data on the article page, then be able to provide lists which are richer than you can achieve by using categories. Currently all the data on the lists is duplicated, so if it is ever changed it needs to be updated in two places - both within the article and in the "rich list".
I think I have worked out how to do this. Firstly, the correct solution seems to be to use Semantic MediaWiki, an extension designed for using MediaWiki for data storage. However in normal MediaWiki, this can be achieved as follows.
Page Template:D:
{{#if:{{{2|}}}|{{:{{{1}}}|{{{2}}}}}
| {{:{{FULLPAGENAME}}|{{{1}}}}}
}}
This allows {{d|Page|Field}} and {{d|Field}} to work as in the original question.
The infobox code also needs to be changed so that it is surrounded by this:
{{#if:{{{1|}}}|{{#ifeq:{{{1}}}|_valid|1|{{{{{{1}}}|}}}}}|
<!-- Existing infobox goes here -->
}}
This makes the infobox data-enabled. It means you can treat pages with one of these infoboxes on it as a template, and include it in another page. This is what Template:D does - it includes the whole article as a template, and this bit of code in the infobox ensures that instead of the entire page content being included at the Template:D point, only the field of interest gets included.
It also adds a special field called _valid with a value of 1 which can be used to detect pages that contain a valid infobox or not. If you make sure {{d|Pagename|_valid}} is equal to 1 (e.g. with {{#ifeq:...}}) before using any fields on that page, then you will get correct data. This is important because if the page you are using does not have a data-enabled infobox, then each Template:D occurrence will embed the entire contents of the page!
Last of all, each infobox has to be changed to be entered like this:
<onlyinclude>{{My Infobox|{{{1|}}}
| Field1 = Value1
| Field2 = Value2
| etc.
}}</onlyinclude>
This is required because MediaWiki can't embed <onlyinclude> tags within templates. The |{{{1|}}} at the end of the infobox name is used to pass the field parameter from Template:D through the article page and onto the infobox template itself.
Here is a working example of this:
Template:D
Data-enabled Infobox
List of pages, with content extracted from each page's infobox - note this page uses a custom {{#foreach:}} command to repeat wikitext for each page in a category, where {{#i:}} is replaced with the name of the page in each loop iteration. So {{d|{{#i:}}|Example}} is used to extract the Example field from the page in the current loop iteration.

PhpStorm remove line wrapping for "use statements" from code formatter

I would like to remove the line wrapping for the use statements in a php class when I apply Code | Reformat code.
current look:
use
Acme/Foo/Bar;
(my) desired look:
use Acme/Foo/Bar;
I've been looking at the File | Setting | Code Style | PHP but could not find it.
Another question is that is it possible to wrap logical operators but no other binary operators using the formatter. I don't expect much though..
Think I am relying too much on the auto-formatter. Now I figured out that I can just do whatever I want (manually) by disabling most of the line wrapping options but enabling the keep line breaks option. The "use statements" formatting as mentioned in my question is because I ticked on the wrapping option under File | Setting | Code Style | PHP | Wrapping and Braces | Function declaration parameters.

How to setup content in other languages?

I would like to allow users to create content for their own languages. I am running a single MediaWiki instance, so I cannot set it up for one language per install.
I would like to try and format the pages like the following, where a different language version of the page has the language code appended to it.
myWiki/SomePageContent
myWiki/SomePageContent/de
myWiki/SomePageContent/fr
How can I ensure users follow this structure? Is there some setting in MediaWiki that can help with this? I have no idea what are best practices for this.
Thanks!
Best practices are to use a separate instance of MediaWiki for each language and use interwiki links to connect them. This way, users are in one language and everything works as you'd expect: if you're in the English instance, a link to [[Foo]] stays in English, and only a link to [[fr:Foo]] goes to the French Foo. It's not particularly hard to set this up even with a single server and single database, see http://www.mediawiki.org/wiki/Manual:Wiki_family. The way this appears to the user is configurable: eg. Wikipedia uses http://en.wikipedia.org/wiki/Paris, Wikitravel uses http://wikitravel.org/en/Paris.
If this is not possible for whatever reason, the next best thing to do is to set up a separate namespace for each language (eg. "de" or "fr"), and this way you can at least do eg. searches across one (or more) languages. However, users of languages other than the 'main' language still have to manually punch in the language code in front of every article name and link, so it's not nearly as user-friendly. See http://www.mediawiki.org/wiki/Manual:Namespace.
An easier way for smaller wikis is through the use of a simple template. It may not be as efficient as an extension or creating a family of wikis, which is a lot of work, but quite fast to set up.
Create a page under Template:Otherlang with the following code:
{{otherlang
|ru=Template:Otherlang:ru
}}
This template adds available translations for the page to the top through the use of flags.
To prevent issues, this template must be placed '''at the very beginning of a page'''.
Tip! When contributing a new translation to a document that already has other translations, please carry over the existing translations to the otherlang template of your contributed page. This way all multilingual pages are linked.
== Syntax ==
{{otherlang
| noborder=true (OPTIONAL)
| title=localized page display title
| lang=page:lang
| lang2=page:lang2
| etc...
}}
Warning! Do not include the language of the current page. This will only confuse readers.
=== Example ===
On a page called [[Template:Otherlang]]:
{{otherlang
| title=Template:Otherlang
| ru=Category:Programming:ru
}}
Note that:
* The language "en" is not included, as it is the language of the page that template is being used on.
* title is assigned the translated name of the page, and will appear as the display title (heading) for the page. This can replace the existing {{wrongtitle}} and {{DISPLAYTITLE}} templates currently in common use.
* The English page has no suffix.
== Available Languages ==
{| class="table table-bordered" border="2" cellpadding="7"
! Language
! Syntax
! Result
|- id="en"
|English
|en=Page_name
|[[File:En.png]]
|- id="ru"
|Russian
|ru=Page_name:ru
|[[File:Ru.png]]
|}
{{#if: {{{title|}}} | {{DISPLAYTITLE:{{{title}}}}} }}{{#if: {{{en|}}} | '''[[File:En.png|alt=English|link={{{en}}}]]''' }} {{#if: {{{ru|}}} | [[File:Ru.png|alt=Русский|link={{{ru}}}]] }}
Then within each English article, paste use the following code to get a flag to show up, representing the respective language.
{{otherlang
| title=Tutorials/Galacticraft Getting Started Guide
| ru=Tutorials/Galacticraft_Getting_Started_Guide/ru
}}
An example of this can be found here. If you click on the Russian flag to the right you will find a Russian translation of the article.
anyone interested, you might wanna try this
http://www.mediawiki.org/wiki/Help:Extension:Translate
when this page
myWiki/SomePageContent
is translated to German, it will create the link like this:
myWiki/SomePageContent/de
and so on :)