Markdown to MediaWiki Conversion Guide: Difference between revisions

VS Code: added other common conversations
Exporting to Intellipedia: added header md to mw
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Markdown to MediaWiki Conversion Guide =
== Convert Markdown to MediaWiki ==
== Convert Markdown to MediaWiki ==
Mediawiki syntax is a bit different from markdown syntax and GPT tends to prefer markdown syntax and defaults to it even when you ask it to convert to mediawiki.
Mediawiki syntax is a bit different from markdown syntax and GPT tends to prefer markdown syntax and defaults to it even when you ask it to convert to mediawiki.
Line 4: Line 5:
This template is a guide to convert markdown to mediawiki syntax using gpt along with regex instructions to do the find and replace what is often missed by gpt.
This template is a guide to convert markdown to mediawiki syntax using gpt along with regex instructions to do the find and replace what is often missed by gpt.


=== REGEX Instructions ===
=== Exporting to Intellipedia ===
==== VS Code ====
Intellipedia at every enclave doesn't allow importing by default. It does however allow you to create pages using the source editor (Edit Source).
 
On any pages you want on this wiki or even wikipedia you can view source or edit source and copy the text and paste it into the source editor as a file with extension .txt.
 
Transfer that file over to your government computer securely then open the file in notepad or any other text editor and copy the text. Paste that text into the source editor on Intellipedia.
 
{| class="wikitable"
{| class="wikitable"
! Title !! Find !! Replace !! Description
! Title !! Find !! Replace !! Description
|-
|-
| Bold || \*\*(.*?)\*\* || '''$1''' || Converts markdown bold to MediaWiki bold
| Bold || <pre>\*\*(?!\s)(.*?)(?<!\s)\*\*</pre> || <pre>'''$1'''</pre> || Converts markdown bold to MediaWiki bold
|-
|-
| Heading || =(.*?)= || ==$1== || Adjusts heading level since MediaWiki doesn't support multiple h1 headers
| Heading || <pre>=(.*?)=</pre> || <pre>==$1==</pre> || Adjusts heading level since MediaWiki doesn't support multiple h1 headers
|-
|-
| Bullet || ^ \* || ** || Converts indented bullets to MediaWiki double asterisk
| Bullet || <pre>^ \*</pre> || <pre>**</pre> || Converts indented bullets to MediaWiki double asterisk
|-
|-
| Numbering || ^\d(.?) || # || Converts numbered lists with digits to MediaWiki numbered list format
| Numbering || <pre>^\d(.*?)</pre> || <pre>#</pre> || Converts numbered lists with digits to MediaWiki numbered list format
|-
|-
| Italics || \_(.*?)\_ || ''$1'' || Converts markdown italics to MediaWiki italics
| Italics || <pre>\_(.*?)\_</pre> || <pre>''$1''</pre> || Converts markdown italics to MediaWiki italics
|-
|-
| External Links || \[(.*?)\]\((https?:\/\/.*?)\) || [$2 $1] || Converts markdown external links to MediaWiki format
| External Links || <pre>\[(.*?)\]\((https?:\/\/.*?)\)</pre> || <pre>[$2 $1]</pre> || Converts markdown external links to MediaWiki format
|-
|-
| Internal Links || \[(.*?)\]\((.*?)\.md\) || [[$2|$1]] || Converts markdown internal links to MediaWiki format
| Internal Links || <pre>\[(.*?)\]\((.*?)\.md\)</pre> || <pre>[[$2|$1]]</pre> || Converts markdown internal links to MediaWiki format
|-
|-
| Images || !\[(.*?)\]\((.*?)\) || [[File:$2|alt=$1]] || Converts markdown images to MediaWiki format
| Images || <pre>!\[(.*?)\]\((.*?)\)</pre> || <pre>[[File:$2|alt=$1]]</pre> || Converts markdown images to MediaWiki format
|-
|-
| Code Blocks || ```(.*?)``` ||<nowiki><pre>$1</pre></nowiki>
| Code Blocks || <pre>```(.*?)```</pre> || <pre><nowiki><pre>$1</pre></nowiki></pre> || Converts markdown code blocks to MediaWiki pre tags
| Converts markdown code blocks to MediaWiki pre tags
|-
|-
| Inline Code || `(.*?)` || <code>$1</code> || Converts markdown inline code to MediaWiki code tags
| Inline Code || <pre>`(.*?)`</pre> || <pre><code>$1</code></pre> || Converts markdown inline code to MediaWiki code tags
|-
|-
| Horizontal Rule || ^---$ || ---- || Converts markdown horizontal rule to MediaWiki format
| Horizontal Rule || <pre>^---$</pre> || <pre>----</pre> || Converts markdown horizontal rule to MediaWiki format
|-
| Level 1 Heading (Markdown #) || <pre>^# (.*?)$</pre> || <pre>= $1 =</pre> || Converts Markdown level 1 heading to MediaWiki heading
|-
| Level 2 Heading (Markdown ##) || <pre>^## (.*?)$</pre> || <pre>== $1 ==</pre> || Converts Markdown level 2 heading to MediaWiki heading
|-
| Level 3 Heading (Markdown ###) || <pre>^### (.*?)$</pre> || <pre>=== $1 ===</pre> || Converts Markdown level 3 heading to MediaWiki heading
|}
|}


==== SED ====
==== SED ====
Line 39: Line 49:
==== Python ====
==== Python ====


=== GPT Instructions ===
=== GPT Prompt Template Markdown to Mediawiki ===
<pre>
<pre>
Please convert the following page into MediaWiki format, adhering to the following guidelines:
Please convert the following page into MediaWiki format, adhering to the following guidelines:
Line 108: Line 118:
Apply these instructions to the provided content, ensuring that the final output complies with MediaWiki standards and preserves readability and accuracy.
Apply these instructions to the provided content, ensuring that the final output complies with MediaWiki standards and preserves readability and accuracy.
</pre>
</pre>
[[Category:AI Template]]
[[Category: Guides]]