Wikipedia code

Discussion in 'Computer Science & Culture' started by pluto2, Jun 13, 2008.

Thread Status:
Not open for further replies.
  1. pluto2 Banned Valued Senior Member

    Messages:
    1,085
    What does this code mean? Can someone explain me this wikipedia code? Is it HTML?

    Code:
    :{| style="border:1px solid #ddd; text-align:center; margin: auto;" cellspacing="15"
    | [[Image:LĂ­nea de Wallace.jpg|96px]] || [[Image:Cyclone Catarina from the ISS on March 26 2004.JPG|96px]] || [[Image:90 mile beach.jpg|96px]] || [[Image:Gavin Plant.JPG|96px]] || [[Image:Meridian convergence and spehrical excess.png|96px]] || [[Image:Delicate Arch LaSalle.jpg|96px]] || [[Image:Receding glacier-en.svg|96px]]
    |-
    | [[Biogeography]] ||  [[Climatology]] & [[paleoclimatology]] || [[Coastal geography]] || [[Environmental geography]] & [[Environmental management|management]] || [[Geodesy]] || [[Geomorphology]] || [[Glaciology]]
    |-
    |[[Image:Meander.svg|96px]] || [[Image:Khajuraho-landscape.jpg|96px]] || [[Image:World11.jpg|96px]] || [[Image:Soil profile.jpg|96px]] || [[Image:Pangea animation 03.gif|96px]] || [[Image:Milankovitch Variations sv.png|96px]]
    |-
    |[[Hydrology]] & [[Hydrography]] || [[Landscape ecology]] || [[Oceanography]] || [[Pedology (soil study)|Pedology]] || [[Palaeogeography]] || [[Quaternary science]]
    |}
     
    Last edited: Jun 14, 2008
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. s0meguy Worship me or suffer eternally Valued Senior Member

    Messages:
    1,635
    uh well from what i can gather everything between [[ ]] is a link, there's also some css (style sheet) in there, what exactly do you want to know?

    And no it is not normal html.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. domesticated om Stickler for details Valued Senior Member

    Messages:
    3,277
    That's wiki code, and it will output a table.

    Below is the open and closing tags for the table.
    In HTML, the equivalent would be <table><tr><td></td></tr></table>
    Code:
    {|
    |-
    |
    |}
    
    Wiki uses a mix of HTML and CSS syntax to construct the dimensions of the table. It needs to be listed within various places to specify which cells columns etc have different properties. Example -- if you wanted the entire table to have a black background and white border 1 pixel wide with white font, you could say something like:
    Code:
    {|style="color:#ffffff; background-color: #000000; border-width: 1px; border-style: solid;  border-color: #ffffff"|
    |-
    |Hello SciForums
    |}
    


    Two lines next to each other like this || means there were no special properties added to the specific cell on that row. If you wanted to give it special properties, you could do this:
    Code:
    {|style="color:#ffffff; background-color: #000000; border-width: 1px; border-style: solid;  border-color: #ffffff"|
    |-
    |Hello SciForums
    |-
    |style="background-color: #ffffff"|I am the greatest ninja||style="color:#ffffff; background-color: #000000"|in the world
    |}
    
    .....at least I think I got that right.....


    [[ ]] gives you an internal link to an article.
    For example --- if I want to go to an article about ninjas, I would say
    [[ninja]]



    [[term|somethingelse ]] Allows you to make a link with a different name.
    For example, If I wanted to link to an article about ninjas, but I want the link to say "ninja warriors", I could do this:
    [[ninja|ninja warriors]]


    Image tags allow you to use internally stored images within the article (as in -- stored within the wikipedia server, and not hotlinked). The second part specifies the size.
    If I wanted to put a picture of a ninja in my ninja article, and there is an image file stored in wiki server called "ninja.gif", I could say:
    [[Image:ninja.gif|96px]]
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. pluto2 Banned Valued Senior Member

    Messages:
    1,085
    The code i posted above produces the images in the page under physical geography:

    http://en.wikipedia.org/wiki/Geography

    The language is called wikitext or wiki markup.

    It also written in this page that CSS and JS pages are not interpreted as wikitext, and therefore can have arbitrary HTML. What does it mean?
     
  8. Stryder Keeper of "good" ideas. Valued Senior Member

    Messages:
    13,105
    CSS (Cascaded Style Sheets) a Markup language and JS (Javascript or JScript if MS related) an Interpreter language are both interpreted by your browser. What the statement meant was that because your browser is interpreting those particular markups, you can use standard HTML in your page creation.

    Basically Wiki code is not interpreted by your Browser, it's interpreted by a parser written in PHP (or some other CGI [Common Gateway Interface] language) to be turned into HTML/CSS and Jscript/Javascript that can be interpreted by your browser.
     
  9. pluto2 Banned Valued Senior Member

    Messages:
    1,085
    What do you mean by interpreted? Is the browser also an interpreter? Also how do you write an interpreter?
     
  10. Stryder Keeper of "good" ideas. Valued Senior Member

    Messages:
    13,105
    The browser is an interpreter, it takes the Markup languages and some variations of code (Javascript, JScript/VBScript depending on browser used) and Interprets them. What an Interpreter is, is basically an environment where this code is converted from a programming form into an overall output.

    I.e. a classic HTML tag for creating a Heading is < H1 >A heading < /H1 > (Obviously without the spaces in the arrow bracketed tags)

    That's how the code would look uninterpreted, however the browser is programmed to graphically alter the text between the tags, in this case into a heading.

    Wiki code works similar, however it's not interpreted by the browser, instead a CGI (Common Gateway Interface) language is used which is interpreted by the Server and then outputs raw HTML for your browser to interpret.

    Basically PHP, Perl and Python can be used as "Scripting" languages for the server. Obviously the execution time of a Script over a "Compiled" program is slower. Compiling code converts the program into machine code that can then be executed without having to be interpreted each time, it costs less in resources than interpreters and is faster at executing. Of course the down side is they aren't so easy to "Hack" (Which basically means alter the original code to do different things, added things or patch bugs)
     
Thread Status:
Not open for further replies.

Share This Page