MediaWiki-Uploader Dokumentation: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 11: Zeile 11:
  
 
* Python 3 (Tested with standard library of Python 3.10)
 
* Python 3 (Tested with standard library of Python 3.10)
 +
** sublist 1
 +
** sublist 2
 
* Pandoc (Markdown to MediaWiki conversion)
 
* Pandoc (Markdown to MediaWiki conversion)
  
Zeile 25: Zeile 27:
 
Create a Markdown file with the contents for the desired wiki page. Only mandatory metadata is the title of the page to be created or edited. Additional metadata can be used to influence the bot behaviour, like not creating new pages or not editing existing pages. Headers, lists, text or any other type of block should be separated by a newline. To upload execute:
 
Create a Markdown file with the contents for the desired wiki page. Only mandatory metadata is the title of the page to be created or edited. Additional metadata can be used to influence the bot behaviour, like not creating new pages or not editing existing pages. Headers, lists, text or any other type of block should be separated by a newline. To upload execute:
  
  '''python3 xinux-wiki''' ''file''
+
  '''python3 xinux-wiki''' ''file.md''
 
<span id="examples"></span>
 
<span id="examples"></span>
 
== Examples ==
 
== Examples ==
Zeile 31: Zeile 33:
 
<span id="lists"></span>
 
<span id="lists"></span>
 
=== Lists ===
 
=== Lists ===
 +
 +
Lists can be
  
 
<span id="code-blocks"></span>
 
<span id="code-blocks"></span>

Version vom 13. September 2022, 14:18 Uhr

MediaWiki-Uploader

Requires a bot with sufficient rights to edit and create pages. The bot credentials have to be written into the upload script.

Requirements

Essential

  • Python 3 (Tested with standard library of Python 3.10)
    • sublist 1
    • sublist 2
  • Pandoc (Markdown to MediaWiki conversion)

Optional

  • vim-table-mode

Usage

Create a Markdown file with the contents for the desired wiki page. Only mandatory metadata is the title of the page to be created or edited. Additional metadata can be used to influence the bot behaviour, like not creating new pages or not editing existing pages. Headers, lists, text or any other type of block should be separated by a newline. To upload execute:

python3 xinux-wiki file.md

Examples

Lists

Lists can be

Code blocks

Colours

Tables

Tables in Markdown are much more intuitive than in MediaWiki format. If you are using Vim, then installing the vim-table-mode extension will help you generate tables which keep good formatting. Therefore writing this:

| **Header 1** | **Header 2** |
|--------------+--------------|
| column 1     | column2      |
| row 3        | value 6      |

Should yield this:

Header 1 Header 2
column 1 column2
row 3 value 6

Template

---
title: MediaWiki Template
bot: 1
createonly: 1
---