Mediawiki -> HTML conversion

Discussion in 'ECC Wiki Team & User Submissions' started by 314, Jan 28, 2018.

  1. 314

    314 Irratioπal ServerAdmin
    Staff Member Wiki Team Premium User

    Joined:
    Apr 1, 2014
    Messages:
    7,129
    Trophy Points:
    65,370
    Gender:
    Male
    EcoDollars:
    $1,940,000
    Ratings:
    +4,118
    @ECC Wiki Team, right now our top priority is to convert the Mediawiki pages from https://ecocitycraft.com/wiki to HTML code at https://www.ecocitycraft.com/forum/wiki. We are using HTML instead of BBCode because of tables, but the list syntax is a bit more complex. My bash script can convert most mediawiki codes, but lists are impossible to convert using my current approach. I'm going to run the wiki pages through my script and the remaining team members can then convert the mediawiki lists from those files to HTML.

    Here's a short tutorial about HTML lists.




    This is what the example list looks like:

    This paragraph is not part of the list.
    • This is a list entry at level 1.
    • This is another list entry at level 1 and it has a sublist.
      • This is a list entry at level 2.
      • This is another list entry at level 2.
    • This is a list entry at level 1 again and it has a sublist.
      • This is a list entry at level 2 again and it has a sublist.
        • This is a list entry at level 3.
    This paragraph is not part of the list.




    This is what the current mediawiki code looks like:
    Code:
    This paragraph is not part of the list.
    *This is a list entry at level 1.
    *This is another list entry at level 1 and it has a sublist.
    **This is a list entry at level 2.
    **This is another list entry at level 2.
    *This is a list entry at level 1 again and it has a sublist.
    **This is a list entry at level 2 again and it has a sublist.
    ***This is a list entry at level 3.
    This paragraph is not part of the list.
    



    This is what it will need to look like in HTML:
    Code:
    This paragraph is not part of the list.
    <ul>
       <li>This is a list entry at level 1.</li>
       <li>This is another list entry at level 1 and it has a sublist.
           <ul>
               <li>This is a list entry at level 2.</li>
               <li>This is another list entry at level 2.</li>
           </ul>
       </li>
       <li>This is a list entry at level 1 again and it has a sublist.
           <ul>
               <li>This is a list entry at level 2 again and it has a sublist.
                   <ul>
                       <li>This is a list entry at level 3.</li>
                   </ul>
               </li>
           </ul>
       </li>
    </ul>
    This paragraph is not part of the list.
    
    Indentation is optional (but recommended to remain sane). <ul> marks the start of an unordered list and </ul> marks its end, you can also use <ol> and </ol> for ordered/numbered lists. <li>Content</li> marks the content of a single line inside the current list; sublists must be placed within the <li>...</li> of their parent element.




    My half-converted wiki pages are located at https://tinyurl.com/yb5cdrul, new pages will be added soon. Please look at those files and convert the mediawiki lists to HTML ones. Once you are done with a list (or even only part of a list), post it here and I'll update the files. Thanks.
     
    • Informative Informative x 2
  2. lambielove

    lambielove President

    Joined:
    Jun 4, 2017
    Messages:
    943
    Trophy Points:
    5,110
    Gender:
    Female
    Ratings:
    +709
    Was this supposed to be a conversation or a thread for all to see?

    (also, will there be bold/italics/underlines? if so, what are their codes?)

    (Also, could players convert some of the files?)
     
    • Agree Agree x 1
    #2 lambielove, Jan 28, 2018
    Last edited: Jan 28, 2018
  3. Nicit6

    Nicit6 has Star Tools for sale on payment plans
    Wiki Team Premium User

    Joined:
    Jul 13, 2013
    Messages:
    8,787
    Trophy Points:
    77,970
    EcoDollars:
    $6,966,687
    Ratings:
    +6,246
    Have you tried looking for ways to automate this with existing scripts? When I proposed this at one point I believe I looked up ways to do this and there were a couple promising options.
     
    • Like Like x 1
    • Informative Informative x 1
  4. MadMonster_

    MadMonster_ Retired GA
    Premium User

    Joined:
    Dec 10, 2013
    Messages:
    2,553
    Trophy Points:
    30,460
    Gender:
    Male
    Ratings:
    +623
    Just before section 5 to the end of section 11 converted.


    Warning: I haven't had time to go over this; I'll be checking it tomorrow.
     
    • Like Like x 1
    • Winner Winner x 1
  5. pokeball92870

    pokeball92870 AEM Network Admin
    Staff Member Wiki Team Premium User

    Joined:
    May 3, 2017
    Messages:
    463
    Trophy Points:
    15,890
    EcoDollars:
    $76,450
    Ratings:
    +580
    • Like Like x 2
  6. MadMonster_

    MadMonster_ Retired GA
    Premium User

    Joined:
    Dec 10, 2013
    Messages:
    2,553
    Trophy Points:
    30,460
    Gender:
    Male
    Ratings:
    +623
    • Friendly Friendly x 1
  7. 314

    314 Irratioπal ServerAdmin
    Staff Member Wiki Team Premium User

    Joined:
    Apr 1, 2014
    Messages:
    7,129
    Trophy Points:
    65,370
    Gender:
    Male
    EcoDollars:
    $1,940,000
    Ratings:
    +4,118
    It's a message to the wiki team, that's why I posted it in the (public) wiki team forum.
    My script already converts that kind of formatting.

    The admin who posted this thread is an idiot who didn't even think of that...

    Thanks for the idea, I'll look into it.
     
    • Winner Winner x 2
    #7 314, Jan 29, 2018
    Last edited: Jan 29, 2018
  8. lambielove

    lambielove President

    Joined:
    Jun 4, 2017
    Messages:
    943
    Trophy Points:
    5,110
    Gender:
    Female
    Ratings:
    +709
    Like this?

    Edit: I'll revise to look for errors in spelling or grammar later. :3 But I first need to know if I coded correctly. XD
     
    • Like Like x 1
    #8 lambielove, Jan 30, 2018
    Last edited: Jan 30, 2018
  9. 314

    314 Irratioπal ServerAdmin
    Staff Member Wiki Team Premium User

    Joined:
    Apr 1, 2014
    Messages:
    7,129
    Trophy Points:
    65,370
    Gender:
    Male
    EcoDollars:
    $1,940,000
    Ratings:
    +4,118
    No, because <li> tags always need to be enclosed by <ul> or <ol> tags and <ul>/<ol> tags need to contain at least one <li> element (which can contain a nested <ul>/<ol> tag).

    Anyway - I have found a partial Mediawiki parser; lists seem to be working properly. Tables aren't being converted, I'll try to combine that parser with my own script.
     
    • Like Like x 1