MediaWiki-Uploader Dokumentation: Unterschied zwischen den Versionen
| Zeile 95: | Zeile 95: | ||
= Troubleshooting = | = Troubleshooting = | ||
| − | <span style= | + | &lt;span style="color:#ff0000"\&gt\;Red\&lt\;/span\&gt\; |
Version vom 19. September 2022, 13:55 Uhr
Requires a bot with sufficient rights to edit and create pages. The bot credentials have to be written into “$XDG_CONFIG_HOME/xinux-wiki.config”.
WIKI_URL = "xxx" BOTNAME = "xxx" BOTPW = "xxx"
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:
python3 xinux-wiki 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 |
Troubleshooting
<span style="color:#ff0000"\>\;Red\<\;/span\>\;