Fill out interwiki help section

This commit is contained in:
Starbeamrainbowlabs 2019-01-05 22:11:28 +00:00
parent 08a0cf2c2e
commit 79ee2455e9
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
3 changed files with 40 additions and 6 deletions

View File

@ -407,7 +407,7 @@ if($settings->sessionprefix == "auto")
/////////////////////////////////////////////////////////////////////////////
/** The version of Pepperminty Wiki currently running. */
$version = "v0.18-dev";
$commit = "fafd5f6f0341ca9b0d57d0dcee20f9247d339891";
$commit = "08a0cf2c2e1791470a3e387dc7dc7616898fae26";
/// Environment ///
/** Holds information about the current request environment. */
$env = new stdClass();
@ -3567,7 +3567,24 @@ register_module([
}
// TODO: Fill this in
add_help_section("22-interwiki-links", "Interwiki Links", "");
$doc_help = <<<HELP_BLOCK
<p>$settings->sitename supports inter-wiki links. Such a link sends the user elsewhere on the internet. By prefixing a page name with a prefix, the convenience of the internal link syntax described above can be exploited to send users elsewhere without having to type out full urls! Here are few examples:</p>
<pre><code>[[another_wiki:Apples]]
[[trees:Apple Trees]]
[[history:The Great Rainforest|rainforest]]
[[any prefix here:page name|Display text]]
</code></pre>
<p>Note that unlike normal internal links, the page name is case-sensitive and can't be case-corrected automatically. The wikis supported by $settings->sitename are as follows:</p>
HELP_BLOCK;
$doc_help .= "<table><tr><th>Name</th><th>Prefix</th>\n";
foreach($env->interwiki_index as $interwiki_def)
$doc_help .= "<tr><td>$interwiki_def->name</td><td><code>$interwiki_def->prefix</code></td></tr>\n";
$doc_help .= "</table>";
add_help_section("22-interwiki-links", "Interwiki Links", $doc_help);
}
]);
@ -9283,7 +9300,6 @@ class PeppermintParsedown extends ParsedownExtra
}
// 3: Page name auto-correction
// -------------------------------
$is_interwiki_link = module_exists("feature-interwiki-links") && is_interwiki_link($link_page);
@ -9318,6 +9334,7 @@ class PeppermintParsedown extends ParsedownExtra
if(strlen($hash_code) > 0)
$link_url .= "#$hash_code";
// 6: Result encoding
// -------------------------------
$result = [

View File

@ -86,7 +86,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds interwiki link support. Set the interwiki_index_location setting at an index file to activate support.",
"id": "feature-interwiki-links",
"lastupdate": 1546721931,
"lastupdate": 1546726222,
"optional": false
},
{
@ -284,7 +284,7 @@
"author": "Emanuil Rusev & Starbeamrainbowlabs",
"description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation, and also *requires* write access to the disk on first load.",
"id": "parser-parsedown",
"lastupdate": 1546710994,
"lastupdate": 1546724653,
"optional": false
}
]

View File

@ -17,7 +17,24 @@ register_module([
}
// TODO: Fill this in
add_help_section("22-interwiki-links", "Interwiki Links", "");
$doc_help = <<<HELP_BLOCK
<p>$settings->sitename supports inter-wiki links. Such a link sends the user elsewhere on the internet. By prefixing a page name with a prefix, the convenience of the internal link syntax described above can be exploited to send users elsewhere without having to type out full urls! Here are few examples:</p>
<pre><code>[[another_wiki:Apples]]
[[trees:Apple Trees]]
[[history:The Great Rainforest|rainforest]]
[[any prefix here:page name|Display text]]
</code></pre>
<p>Note that unlike normal internal links, the page name is case-sensitive and can't be case-corrected automatically. The wikis supported by $settings->sitename are as follows:</p>
HELP_BLOCK;
$doc_help .= "<table><tr><th>Name</th><th>Prefix</th>\n";
foreach($env->interwiki_index as $interwiki_def)
$doc_help .= "<tr><td>$interwiki_def->name</td><td><code>$interwiki_def->prefix</code></td></tr>\n";
$doc_help .= "</table>";
add_help_section("22-interwiki-links", "Interwiki Links", $doc_help);
}
]);