MediaWiki: Difference between revisions

From David's Wiki
Created page with " ===Importing Templates From Wikipedia=== [https://www.mediawiki.org/wiki/Manual:Importing_Wikipedia_infoboxes_tutorial Link]"
 
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Installation==
See [https://hub.docker.com/_/mediawiki mediawiki] for instructions on deployment.<br>
I have a container image with my preferred extensions at https://github.com/dli7319/docker-mediawiki.


To update, bump your image version and then in your container run:
<pre>
php maintenance/run.php update
</pre>


===Importing Templates From Wikipedia===
==Wikitext==
[https://www.mediawiki.org/wiki/Manual:Importing_Wikipedia_infoboxes_tutorial Link]
{{ main | Wikitext}}
 
Wikitext is the markup language for Mediawiki pages.
 
==Import/Export==
===Importing Individual Pages From Wikipedia===
[[Mediawikiwiki: Manual:Importing_Wikipedia_infoboxes_tutorial]]
 
<ol>
<li> Go to [https://en.wikipedia.org/wiki/Special:Export Wikipedia's Special:Export]</li>
<li> Type in the page you want.<br>
<pre>
Template:Key press
Template:Key press/doc</pre></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> Import the file.</li>
</ol>
 
==Restricting Access==
See [https://www.mediawiki.org/wiki/Category:Page_specific_user_rights_extensions https://www.mediawiki.org/wiki/Category:Page_specific_user_rights_extensions].<br>
I use the Lockdown extension.
 
==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 we can get syntax highlighting for code and if 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 [https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.hook mw.hook documentation]

Latest revision as of 00:34, 31 December 2023

Installation

See mediawiki for instructions on deployment.
I have a container image with my preferred extensions at https://github.com/dli7319/docker-mediawiki.

To update, bump your image version and then in your container run:

php maintenance/run.php update

Wikitext

Wikitext is the markup language for Mediawiki pages.

Import/Export

Importing Individual Pages From Wikipedia

Mediawikiwiki: 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.

Restricting Access

See https://www.mediawiki.org/wiki/Category:Page_specific_user_rights_extensions.
I use the Lockdown extension.

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 we can get syntax highlighting for code and if 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