MediaWiki-Uploader Dokumentation: Unterschied zwischen den Versionen
| (49 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
| − | + | Download: '''git clone https://git.willux.de/EinYakAmNil/mediawiki-uploader.git''' | |
| − | |||
| − | Requires a bot with sufficient rights to edit and create pages. The bot credentials | + | Requires a [[Spezial:BotPasswords|bot]] with sufficient rights to edit and create pages. The bot credentials default into “$XDG_CONFIG_HOME/xinux-wiki.config”, but can be customised by adding the ''–config'' flag. |
| − | WIKI_URL = | + | WIKI_URL=xxx |
| − | BOTNAME = | + | BOTNAME=xxx |
| − | BOTPW = | + | BOTPW=xxx |
<span id="requirements"></span> | <span id="requirements"></span> | ||
| − | + | = Requirements = | |
<span id="essential"></span> | <span id="essential"></span> | ||
| − | + | == Essential == | |
* Python 3 (Tested with standard library of Python 3.10) | * Python 3 (Tested with standard library of Python 3.10) | ||
| Zeile 17: | Zeile 16: | ||
<!-----> | <!-----> | ||
| + | Ubuntu/Debian: | ||
| + | |||
| + | apt install python3 pandoc | ||
| + | Arch: | ||
| + | |||
| + | pacman -S python3 pandoc | ||
<span id="optional"></span> | <span id="optional"></span> | ||
| − | + | == Optional == | |
* vim-table-mode | * vim-table-mode | ||
| Zeile 24: | Zeile 29: | ||
<!-----> | <!-----> | ||
<span id="usage"></span> | <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. These should be the first lines of the file. | ||
| − | + | --- | |
| + | title: MediaWiki-Uploader Dokumentation | ||
| + | --- | ||
| + | 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'' | + | '''python3 xinux-wiki''' ''--config config_file'' ''file.md'' |
<span id="examples"></span> | <span id="examples"></span> | ||
| − | + | = Examples = | |
<span id="lists"></span> | <span id="lists"></span> | ||
| − | + | == Lists == | |
Lists can be created with either '''-''', '''+''' at the beginning of the line separated from the point by a space. The level of the list is determined by the indent. | Lists can be created with either '''-''', '''+''' at the beginning of the line separated from the point by a space. The level of the list is determined by the indent. | ||
| Zeile 54: | Zeile 64: | ||
** Subpoint 3 | ** Subpoint 3 | ||
| + | Numbered lists can be done by not leaving a space between your text and '''#''': | ||
| + | |||
| + | #first point | ||
| + | #second point | ||
| + | ##first subpoint | ||
| + | ##first subpoint | ||
| + | #first point | ||
| + | #second point | ||
| + | ##first subpoint | ||
| + | ##first subpoint | ||
<span id="code-blocks"></span> | <span id="code-blocks"></span> | ||
| − | + | == Code blocks == | |
| + | |||
| + | You can have areas of code by indenting the desired text with tab or enclosing it with ''<pre>'' tags. | ||
<span id="colours"></span> | <span id="colours"></span> | ||
| − | + | == Colours == | |
| + | |||
| + | Text can be coloured by enclosing it in a ''<span style=“color:#HEXCODE”>'' tag. | ||
<span id="tables"></span> | <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: | 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: | ||
| Zeile 81: | Zeile 105: | ||
|} | |} | ||
| − | <span id=" | + | <span id="troubleshooting"></span> |
| − | == | + | = Troubleshooting = |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Aktuelle Version vom 12. Oktober 2022, 10:18 Uhr
Download: git clone https://git.willux.de/EinYakAmNil/mediawiki-uploader.git
Requires a bot with sufficient rights to edit and create pages. The bot credentials default into “$XDG_CONFIG_HOME/xinux-wiki.config”, but can be customised by adding the –config flag.
WIKI_URL=xxx BOTNAME=xxx BOTPW=xxx
Requirements
Essential
- Python 3 (Tested with standard library of Python 3.10)
- Pandoc (Markdown to MediaWiki conversion)
Ubuntu/Debian:
apt install python3 pandoc
Arch:
pacman -S python3 pandoc
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. These should be the first lines of the file.
--- title: MediaWiki-Uploader Dokumentation ---
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 --config config_file file.md
Examples
Lists
Lists can be created with either -, + at the beginning of the line separated from the point by a space. The level of the list is determined by the indent.
Writing this:
+ Point 1
+ Point 2
+ Subpoint 1
+ Subpoint 2
+ Point 3
+ Subpoint 3
yields:
- Point 1
- Point 2
- Subpoint 1
- Subpoint 2
- Point 3
- Subpoint 3
Numbered lists can be done by not leaving a space between your text and #:
#first point #second point ##first subpoint ##first subpoint
- first point
- second point
- first subpoint
- first subpoint
Code blocks
You can have areas of code by indenting the desired text with tab or enclosing it with <pre> tags.
Colours
Text can be coloured by enclosing it in a <span style=“color:#HEXCODE”> tag.
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 |