MediaWiki: Difference between revisions

From David's Wiki
No edit summary
Line 1: Line 1:




==Syntax==
==Wikitext==
Below are how to typeset and format things in Mediawiki properly
{{ main | Wikitext}}


===Code===
Wikitext is the markup language for Mediawiki pages.
Inline code can by represented with <nowiki><code></code></nowiki><br>
Code blocks should be like:
<pre>
<syntaxhighlight lang="cpp">
// ... my code here
</syntaxhighlight>
</pre>
 
===Math===
Math is written in standard latex syntax inside of <nowiki><math></math></nowiki>.
* Beware: Do not use <code>||</code>, use <code>\Vert</code> instead.


===Images===
==Import/Export==
See [https://www.mediawiki.org/wiki/Help:Images https://www.mediawiki.org/wiki/Help:Images]
===Importing Individual Pages From Wikipedia===
[[Mediawikiwki: Manual:Importing_Wikipedia_infoboxes_tutorial]]


==Advanced==
===Importing Templates From Wikipedia===
[https://www.mediawiki.org/wiki/Manual:Importing_Wikipedia_infoboxes_tutorial Link]<br>
<ol>
<ol>
<li> Go to [https://en.wikipedia.org/wiki/Special:Export Wikipedia's Special:Export]</li>
<li> Go to [https://en.wikipedia.org/wiki/Special:Export Wikipedia's Special:Export]</li>
<li> Type in the templates you want. E.g.</li>
<li> Type in the page you want.<br>
<pre>
<pre>
Template:Key press
Template:Key press
Template:Key press/doc</pre>
Template:Key press/doc</pre></li>
<li> Check include templates and download the file</li>
<li> Check include templates and download the file</li>
<li> Go to your wiki's [https://wiki.davidl.me/view/Special:Import Special:Import]</li>
<li> Go to your wiki's [https://wiki.davidl.me/view/Special:Import Special:Import]</li>
<li> Import the file.</li>
<li> Import the file.</li>
</ol>
</ol>
===Importing all templates from Wikipedia===


==Restricting Access==
==Restricting Access==

Revision as of 13:37, 4 June 2020


Wikitext

Wikitext is the markup language for Mediawiki pages.

Import/Export

Importing Individual Pages From Wikipedia

Mediawikiwki: Manual:Importing_Wikipedia_infoboxes_tutorial

  1. Go to Wikipedia's Special:Export
  2. Type in the page you want.
    Template:Key press
    Template:Key press/doc
  3. Check include templates and download the file
  4. Go to your wiki's Special:Import
  5. Import the file.

Importing all templates from Wikipedia

Restricting Access

The best way to restrict access is to create a separate wiki.
However, there do exist extensions to manage access at the page-level.
See https://www.mediawiki.org/wiki/Category:Page_specific_user_rights_extensions
One such extension is Semantic ACL which requires Semantic Mediawiki.

TODO

  • Find a way to insert text files into mediawiki (either via upload or as text).
    • These should be downloadable with a link.
    • Bonus if .js files and WebGL shaders can be made runnable.

Writing Extensions

PHP Hooks

See Mediawikiwiki:Manual:Hooks

ParserAfterTidy

  • This is only called for new sections of pages, not necessarily the entire page.

JS Hooks

See mw.hook documentation