MediaWiki-Uploader Dokumentation: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Der Seiteninhalt wurde durch einen anderen Text ersetzt: „wg wgdfsdf“) Markierung: Ersetzt |
|||
| Zeile 1: | Zeile 1: | ||
| − | + | <span id="mediawiki-uploader"></span> | |
| + | = MediaWiki-Uploader = | ||
| + | |||
| + | Requires a bot with sufficient rights to edit and create pages. The bot credentials have to be written into the upload script. | ||
| + | |||
| + | <span id="requirements"></span> | ||
| + | == Requirements == | ||
| + | |||
| + | <span id="essential"></span> | ||
| + | === Essential === | ||
| + | |||
| + | * Python 3 (Tested with standard library of Python 3.10) | ||
| + | * Pandoc (Markdown to MediaWiki conversion) | ||
| + | |||
| + | <!-----> | ||
| + | <span id="optional"></span> | ||
| + | === Optional === | ||
| + | |||
| + | * vim-table-mode | ||
| + | |||
| + | <!-----> | ||
| + | <span id="usage"></span> | ||
| + | == 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: | ||
| + | |||
| + | python xinux-wiki '''file''' | ||
| + | <span id="examples"></span> | ||
| + | == Examples == | ||
| + | |||
| + | <span id="lists"></span> | ||
| + | === Lists === | ||
| + | |||
| + | <span id="code-blocks"></span> | ||
| + | === Code blocks === | ||
| + | |||
| + | <span id="colours"></span> | ||
| + | === Colours === | ||
| + | |||
| + | <span id="tables"></span> | ||
| + | === Tables === | ||
| + | |||
| + | Tables in Markdown are much more intuitive than in MediaWiki format. If you are using Vim, then installing the [https://github.com/dhruvasagar/vim-table-mode 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: | ||
| + | {| class="wikitable" | ||
| + | ! '''Header 1''' | ||
| + | ! '''Header 2''' | ||
| + | |- | ||
| + | | column 1 | ||
| + | | column2 | ||
| + | |- | ||
| + | | row 3 | ||
| + | | value 6 | ||
| + | |} | ||
| + | |||
| + | <span id="template"></span> | ||
| + | == Template == | ||
| + | |||
| + | --- | ||
| + | title: MediaWiki Template | ||
| + | bot: 1 | ||
| + | createonly: 1 | ||
| + | --- | ||
Version vom 13. September 2022, 14:15 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)
- 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:
python xinux-wiki file
Examples
Lists
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 ---