Mediawiki -> HTML conversion

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

  1. 314

    314 Irratioπal ServerAdmin
    Server Admin Premium User Wiki Team

    Joined:
    Apr 1, 2014
    Messages:
    7,268
    Trophy Points:
    66,370
    Gender:
    Male
    EcoDollars:
    $1,620,000
    Ratings:
    +4,610
    @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
    • Optimistic Optimistic x 1
    • List
  2. lambielove

    lambielove President

    Joined:
    Jun 4, 2017
    Messages:
    1,073
    Trophy Points:
    7,260
    Gender:
    Female
    Ratings:
    +883
    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?)
     
    #2 lambielove, Jan 28, 2018
    Last edited: Jan 28, 2018
  3. Nicit6

    Nicit6 Does Stuff Sometimes
    Prestige ⭐⭐ Premium User Wiki Team

    Joined:
    Jul 13, 2013
    Messages:
    8,888
    Trophy Points:
    84,470
    EcoDollars:
    $99,762
    Ratings:
    +6,355
    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
    • List
  4. MadMonster_

    MadMonster_ Retired GA
    Premium User

    Joined:
    Dec 10, 2013
    Messages:
    2,554
    Trophy Points:
    30,460
    Gender:
    Male
    Ratings:
    +646
    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
    • List
  5. pokeball92870

    pokeball92870 Wiki Team Leader
    Server Admin Premium User Wiki Leader

    Joined:
    May 3, 2017
    Messages:
    599
    Trophy Points:
    17,520
    EcoDollars:
    $500,001
    Ratings:
    +974
  6. MadMonster_

    MadMonster_ Retired GA
    Premium User

    Joined:
    Dec 10, 2013
    Messages:
    2,554
    Trophy Points:
    30,460
    Gender:
    Male
    Ratings:
    +646
  7. 314

    314 Irratioπal ServerAdmin
    Server Admin Premium User Wiki Team

    Joined:
    Apr 1, 2014
    Messages:
    7,268
    Trophy Points:
    66,370
    Gender:
    Male
    EcoDollars:
    $1,620,000
    Ratings:
    +4,610
    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
    • Optimistic Optimistic x 1
    • List
    #7 314, Jan 29, 2018
    Last edited: Jan 29, 2018
  8. lambielove

    lambielove President

    Joined:
    Jun 4, 2017
    Messages:
    1,073
    Trophy Points:
    7,260
    Gender:
    Female
    Ratings:
    +883
    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
     
    #8 lambielove, Jan 30, 2018
    Last edited: Jan 30, 2018
  9. 314

    314 Irratioπal ServerAdmin
    Server Admin Premium User Wiki Team

    Joined:
    Apr 1, 2014
    Messages:
    7,268
    Trophy Points:
    66,370
    Gender:
    Male
    EcoDollars:
    $1,620,000
    Ratings:
    +4,610
    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
    • Optimistic Optimistic x 1
    • List