Code Monkey home page Code Monkey logo

seanpm2001 / learn-mediawiki Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 347 KB

A repository for showcasing my knowledge of the MediaWiki (WikiText) markup language, and continuing to learn the language.

Home Page: https://github.com/seanpm2001/Learn/

License: GNU General Public License v3.0

Wikitext 100.00%
article collection education gpl3 gplv3 md mediawiki seanpm2001 seanpm2001-education seanpm2001-life-archive txt wikimedia wikitext learn-wikitext learn-wikitext-lang learn-wikitext-language wikitext-collection wikitext-lang wikitext-language

learn-mediawiki's Introduction


/MediaWiki_Sunflower.png

Learning WikiText

I am pretty inexperienced with WikiText at the moment, but I still have more to learn. This document will go over my current knowledge of the WikiText markup language.

This document uses version 1.3.11 of the Wikimedia Wikitext markup specification for the WikiText markup language.

Comments in WikiText

Comments in WikiText are the same as most other markup languages (such as XML, HTML, etc.) they are written like this:

<!-- This is a comment !-->
<!-- The same syntax for single-line
comments is also used in block comments.
!-->

Break keyword in WikiText

WikiText does not support the break statement/keyword, it has no need for it.

To this day, I am still not entirely sure what the break keyword does, but most languages support it.

Headings in WikiText

Headings in WikiText work like so:

Heading 1

It is advised to skip heading 1, as it is the same level of the page name.

Heading 2

== Heading level 2 ==

Heading 3

=== Heading level 3 ===

Heading 4

==== Heading level 4 ====

Heading 5

===== Heading level 5 =====

Heading 6

====== Heading level 6 ======

Just like HTML and other document standards, a 7th heading level does not exist. Attempting to do so will result in plain unformatted text, rather than a heading

####### Heading 7 (non-existant)

======= Heading 7 (non-existant) =======

Table of contents

A document with 4 or more headings will automatically render with a table of contents unless it is defined by the magic word __NOTOC__

__NOTOC__

=== Etymology ===

Lorem Ipsum

=== History ===

Warfare, invasions, Caesar, expansion, conquest.

=== Fall ===

Fall of the Western Roman Empire.

=== Middle ages ===

Holy Roman Empire

=== Fall 2 ===

Fall of the Holy Roman Empire

Without it, a table of contents is automatically generated:

=== Etymology ===

Lorem Ipsum

=== History ===

Warfare, invasions, Caesar, expansion, conquest.

=== Fall ===

Fall of the Western Roman Empire.

=== Middle ages ===

Holy Roman Empire

=== Fall 2 ===

Fall of the Holy Roman Empire

Lists in WikiText

Lists can be formed in WikiText in multiple ways. The following examples showcase bullet lists.

Bullet list
* Start
* Each
* Bullet
* List
* Entry
* With
* An
* Asterisk

Bold in WikiText

Text can be bolded in WikiText by doing the following:

This text is not bold

'''This text is bold'''

Italics in WikiText

Text can be italicized in WikiText by doing the following:

This text is not italicized

''This text is italicized''

Code blocks in WikiText

A code block can be formed in WikiText by doing the following:

<syntaxhighlight lang="python">
print("Hello, WIkiText")
</syntaxhighlight>
Images in WikiText

Referencing an image in WikiText is very easy, and is done like so:

[[File:filename.extension|options|caption]]

[[File:Example.svg|options|A good example image]]

Horizontal Lines in WikiText

Horizontal Lines/divider lines are supported in WikiText. They can be defined like so:

***

== Section 1 ==

---

== Section 2 ==

***

Hyperlinks in WikiText

Hyperlinks are supported in WikiText. They can be defined like so:

https://wikipedia.org/

You must fill every entry in the table, or it won't render.

Infoboxes in WikiText

I am still trying to figure out how to make a functional infobox for Wikipedia. This is as close as I can currently get:

<code><nowiki>{{</nowiki>[[User:UBX/Programmer]]<nowiki>}}</nowiki></code>

/!\ This example has not been tested yet, and may not work

Videos in WikiText

I don't know how to embed videos in WikiText yet, as I never tried.

Audio in WikiText

I don't know how to embed audio files/clips in WikiText yet, as I never tried.

Source

The majority of my WikiText knowledge comes from experimenting, viewing Wikipedia page source code, and reading Wikimedia documentation on the MediaWiki specification page and Wikipedia.

Notable resources:

SeansLifeArchive/Extras/Wikipedia

Help:Formatting - MediaWiki

Wikipedia (English)

Other knowledge of WikiText

  1. WikiText is not a curly bracket language, and also does not use semicolons at the end of each line

  2. WikiText is a lighweight markup language

  3. WikiText is most widely used for documentation, notably Wikipedia articles, and articles on WikiMedia sister projects,.

  4. WikiText uses the *.wiki file extension

  5. WikiText is a language recognized by GitHub, but you have to use a .gitattributes file to recognize it in the GitHub Linguist

  6. WikiText is a markup language

  7. WikiText is owned by MediaWiki, which is not to be confused with WikiMedia.

  8. I am using the old sunflower MediaWiki logo, as I prefer it over the 2020 April 1st logo

  9. No other knowledge of WikiText at the moment.


File version: 1 (2022, Monday, April 18th at 1:17 pm PST)


learn-mediawiki's People

Contributors

seanpm2001 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

seanwallawalla

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.