Mediawiki -> HTML conversion

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

  1. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,963
    Trophy Points:
    87,660
    EcoDollars:
    $27,000,000
    Ratings:
    +4,866
    @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. lambiser

    lambiser Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Jun 4, 2017
    Messages:
    858
    Trophy Points:
    13,590
    Gender:
    Female
    Ratings:
    +906
    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 lambiser, Jan 28, 2018
    Last edited: Jan 28, 2018
  3. Nicit6

    Nicit6 N6
    Mayor ⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ II ⭐ Gameplay Architect Premium Upgrade

    Joined:
    Jul 13, 2013
    Messages:
    9,914
    Trophy Points:
    102,160
    Ratings:
    +8,058
    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 GameAdmin
    Builder ⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ I ⭐ Premium Upgrade

    Joined:
    Dec 10, 2013
    Messages:
    2,808
    Trophy Points:
    73,660
    Gender:
    Male
    Ratings:
    +754
    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 PokeManiac
    Resident ⛰️ Ex-President ⚒️⚒️ Prestige ⭐ I ⭐ Premium Upgrade

    Joined:
    May 3, 2017
    Messages:
    787
    Trophy Points:
    26,010
    EcoDollars:
    $0
    Ratings:
    +1,547
  6. MadMonster_

    MadMonster_ Retired GameAdmin
    Builder ⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ I ⭐ Premium Upgrade

    Joined:
    Dec 10, 2013
    Messages:
    2,808
    Trophy Points:
    73,660
    Gender:
    Male
    Ratings:
    +754
  7. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,963
    Trophy Points:
    87,660
    EcoDollars:
    $27,000,000
    Ratings:
    +4,866
    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. lambiser

    lambiser Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Jun 4, 2017
    Messages:
    858
    Trophy Points:
    13,590
    Gender:
    Female
    Ratings:
    +906
    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 lambiser, Jan 30, 2018
    Last edited: Jan 30, 2018
  9. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,963
    Trophy Points:
    87,660
    EcoDollars:
    $27,000,000
    Ratings:
    +4,866
    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