HTML preprocessor

Discussion in 'HTML' started by Bart Vandewoestyne, Jan 17, 2007.

  1. The webspace I have access to from my ISP only allows me to use static
    (X)HTML pages, so I'm trying to stick with static (X)HTML content for
    my personal webpage.

    There are however certain things that i need in each .html file, such as
    the navigation, header, footer,... and therefore I'm looking for a good,
    clean and maintainable way to create my .html files with navigation,
    header, footer,... without the need to copy them to each .html file.

    After some googling, I've found out that probably the best solution for me
    is to use a HTML preprocessor, see for examle
    http://www.htmlhelp.com/faq/html/all.html#15
    A list of HTML preprocessors can be found at
    http://www.htmlhelp.com/links/preprocessors.html

    Now before I begin to look at these one by one, i would like to know
    if there are people who can recommend me a certain HTML preprocessor from
    that list. I don't need very complicated things, the most important is
    that I can include my navigation, header and footer stuff into each page
    and that the system allows easy modifications to the content of my static
    (X)HTML website. Some playing with variables would also be nice.

    I am only looking for Opebn Source Software that works on Linux or Windows,
    so i won't consider freeware or closed source stuff.

    Are there any recommended and easy to use HTML preprocessors?

    Thanks,
    Bart

    --
    "Share what you know. Learn what you don't."
     
    Bart Vandewoestyne, Jan 17, 2007
    #1
    1. Advertising

  2. Bart Vandewoestyne wrote:

    > Are there any recommended and easy to use HTML preprocessors?


    These days I'm using a homebrew thing in Perl that does a bunch of
    processing on documents (such as tagish indexes, related page blocks
    and tables of content generated from the headings in the document), but
    at the heart of it is Template-Toolkit.

    http://www.template-toolkit.org/

    The ttree program that comes with it sounds like just what you need.

    http://www.template-toolkit.org/docs/plain/Tools/ttree.html

    Note the insert and include directives.

    http://www.template-toolkit.org/doc...ml#Processing_Other_Template_Files_and_Blocks
     
    David Dorward, Jan 17, 2007
    #2
    1. Advertising

  3. Bart Vandewoestyne

    Jim Moe Guest

    Bart Vandewoestyne wrote:
    > The webspace I have access to from my ISP only allows me to use static
    > (X)HTML pages, so I'm trying to stick with static (X)HTML content for
    > my personal webpage.
    >

    I presume that you can create the pages locally and upload them to the site.

    > There are however certain things that i need in each .html file, such as
    > the navigation, header, footer,... and therefore I'm looking for a good,
    > clean and maintainable way to create my .html files with navigation,
    > header, footer,... without the need to copy them to each .html file.
    >

    Although PHP is normally a server-side addition, it has an executable
    version that can process a page; it outputs HTML. Use PHP to generate all
    of the common parts.

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
     
    Jim Moe, Jan 18, 2007
    #3
  4. On 2007-01-18, Jim Moe <> wrote:
    >
    > [...]
    > I presume that you can create the pages locally and upload them to the site.


    Yes.

    > Although PHP is normally a server-side addition, it has an executable
    > version that can process a page; it outputs HTML.
    > Use PHP to generate all of the common parts.


    Aha... this might indeed also be an interesting approach... I
    thought I could not use PHP because it gets processed on the
    server and my ISP does not support PHP. But if I can process my
    ..php files locally and then upload them, that might be a solution.

    The only question that I'm left with is if that php-executable is
    in some Debian (stable) package? Searching for 'php' at the
    Debian packages website gives me

    http://packages.debian.org/cgi-bin/...les&case=insensitive&version=stable&arch=i386

    Or does the executable have another name?

    Thanks,
    Bart

    --
    "Share what you know. Learn what you don't."
     
    Bart Vandewoestyne, Jan 18, 2007
    #4
  5. Bart Vandewoestyne wrote:

    > The only question that I'm left with is if that php-executable is
    > in some Debian (stable) package? Searching for 'php' at the
    > Debian packages website gives me


    I think you'll want "php4-cgi" which has the executable (as opposed to
    Apache module) version.
     
    David Dorward, Jan 18, 2007
    #5
  6. Bart Vandewoestyne

    aa Guest

    Javascript?
     
    aa, Jan 18, 2007
    #6
  7. aa wrote:
    > Javascript?


    Running on the client? Very bad idea. It becomes invisible to anyone
    without JS enabled, including search engine indexing bots.
     
    David Dorward, Jan 18, 2007
    #7
  8. On 2007-01-18, David Dorward <> wrote:
    >
    > I think you'll want "php4-cgi" which has the executable (as opposed to
    > Apache module) version.


    Hmm... I've just installed php4-cli and that seems to have what i
    need:

    mc303@forsythe:~$ php -v
    PHP 4.3.10-18 (cli) (built: Nov 3 2006 21:56:29)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

    I'm not sure what the difference is with the cli-client from the php4-cgi
    package.

    Thanks!
    Bart

    --
    "Share what you know. Learn what you don't."
     
    Bart Vandewoestyne, Jan 18, 2007
    #8
  9. Bart Vandewoestyne

    aa Guest

    "David Dorward" <>
    > > Javascript?

    > Running on the client? Very bad idea. It becomes invisible to anyone
    > without JS enabled, including search engine indexing bots.


    1. The author is talking about navigation, header, footer do not need to be
    scanned by Search Engines. I appreciate that navigation, header, footer can
    be loaded with keywords, but it is considered a dirty trick

    2. What is the percentage of non-JS visitors? Are you saying that JS
    should not be used at all?
     
    aa, Jan 18, 2007
    #9
  10. Bart Vandewoestyne

    aa Guest

    Interesting thing, yet not perfectly clear. If you install it on your local
    machine only, then it is not more than a sort of an authoring assistant, is
    it ?
    If you change, say a footer, you will have to "recompile" all the pages
    using the footer and then upload them?
    What am I missing?

    "Bart Vandewoestyne" <> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ ×
    ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ: news:...
    > On 2007-01-18, David Dorward <> wrote:
    > >
    > > I think you'll want "php4-cgi" which has the executable (as opposed to
    > > Apache module) version.

    >
    > Hmm... I've just installed php4-cli and that seems to have what i
    > need:
    >
    > mc303@forsythe:~$ php -v
    > PHP 4.3.10-18 (cli) (built: Nov 3 2006 21:56:29)
    > Copyright (c) 1997-2004 The PHP Group
    > Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    >
    > I'm not sure what the difference is with the cli-client from the php4-cgi
    > package.
    >
    > Thanks!
    > Bart
    >
    > --
    > "Share what you know. Learn what you don't."
     
    aa, Jan 18, 2007
    #10
  11. aa wrote:

    > > Running on the client? Very bad idea. It becomes invisible to anyone
    > > without JS enabled, including search engine indexing bots.

    >
    > 1. The author is talking about navigation, header, footer do not need to be
    > scanned by Search Engines. I appreciate that navigation, header, footer can
    > be loaded with keywords, but it is considered a dirty trick


    Search engines don't need to access the navigation? How are the going
    to find the other pages on the site then?

    > 2. What is the percentage of non-JS visitors?


    Last time I looked at any statistics, I think it was something in the
    order of 10%. Usual provisos about statistics apply.

    With the increase in the mobile web, I wouldn't be surprised if this
    figure increased (Opera Mini is a very nice piece of software, but it
    doesn't do JS).

    > Are you saying that JS should not be used at all?


    No. The key is progressive enhancement.

    In short:

    Essential functionality should be provided by the server.
    Data should be provided by HTML.
    Style by CSS.
    Then JavaScript to increase usability and generally add convienience
    methods to the page.
     
    David Dorward, Jan 18, 2007
    #11
  12. aa wrote:
    > Interesting thing, yet not perfectly clear. If you install it on your local
    > machine only, then it is not more than a sort of an authoring assistant, is
    > it ?


    Yes.

    > If you change, say a footer, you will have to "recompile" all the pages
    > using the footer and then upload them?


    Yes. So what? Once its set up, its usually a two button process to get
    it online (assuming you want to have a chance to test the changes
    before they go public, if you don't case then its a one button process).
     
    David Dorward, Jan 18, 2007
    #12
  13. On 2007-01-18, aa <> wrote:
    > Javascript?


    I prefer not to use Javascript because of two reasons:

    1) My knowledge of Javascript is quasi zero

    2) I don't want to force my users to have Javascript enabled in
    their browser.

    Best wishes,
    Bart

    --
    "Share what you know. Learn what you don't."
     
    Bart Vandewoestyne, Jan 18, 2007
    #13
  14. Bart Vandewoestyne

    Toby Inkster Guest

    aa wrote:

    > 1. The author is talking about navigation, header, footer do not need to be
    > scanned by Search Engines. I appreciate that navigation, header, footer can
    > be loaded with keywords, but it is considered a dirty trick


    Navigation most certainly *does* need to be scanned by search engines --
    how else are they going to find your other pages?

    > 2. What is the percentage of non-JS visitors?


    Varies from site to site, but typically 5-15%.

    > Are you saying that JS should not be used at all?


    It is unwise to *rely* on Javascript for basic site functionality, but
    that doesn't mean that it can't be used for some visual/behavioural
    nicities.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Jan 18, 2007
    #14
  15. Bart Vandewoestyne

    Toby Inkster Guest

    aa wrote:

    > If you change, say a footer, you will have to "recompile" all the pages
    > using the footer and then upload them?


    Yep, but that recompilation only needs to be a matter of running a single
    script, taking at most a few seconds to complete.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Jan 18, 2007
    #15
  16. On 2007-01-18, aa <> wrote:
    > Interesting thing, yet not perfectly clear. If you install it on your local
    > machine only, then it is not more than a sort of an authoring assistant, is
    > it ?


    Indeed.

    > If you change, say a footer, you will have to "recompile" all the pages
    > using the footer and then upload them?


    Indeed.

    > What am I missing?


    I think you didn't miss anything and understood things right. My
    ISP doesn't support PHP so I have to stick with a static webpage.
    It isn't a big project, just a simple personal homepage. One
    of the problems I'm having is that for now I copy-paste my
    navigation to each .html file... and I want to make things a bit
    more manageable, so I think my best option is to use some kind of
    HTML-preprocessing system to generate the static HTML pages.

    So my cycle will be:

    1. Modify the templates/content
    2. `Compile' the templates/content to static .html files
    3. Upload these static .html files to the webspace my ISP
    provides me.

    For now, I am in doubt whether I will use the PHP command line
    client, the Template Toolkit (http://www.template-toolkit.org/)
    or htp (http://htp.sourceforge.net/) or anything alike...

    I like the fact that PHP is used by many users and is currently
    still under very active development (so lots of support). That
    could be a good reason to choose PHP and not the Template Toolkit
    or htp or a thing like that...

    Best wishes,
    Bart

    --
    "Share what you know. Learn what you don't."
     
    Bart Vandewoestyne, Jan 18, 2007
    #16
  17. Bart Vandewoestyne

    Chaddy2222 Guest

    aa wrote:
    > "David Dorward" <>
    > > > Javascript?

    > > Running on the client? Very bad idea. It becomes invisible to anyone
    > > without JS enabled, including search engine indexing bots.

    >
    > 1. The author is talking about navigation, header, footer do not need to be


    > scanned by Search Engines.

    Umm well they do, *unless you don't mind loseing customers (or sales
    for that matter).


    >I appreciate that navigation, header, footer can
    > be loaded with keywords, but it is considered a dirty trick
    >

    Well, they can't and the keywords Meta Tag has nothing to do with what
    where talking about!.

    > 2. What is the percentage of non-JS visitors? Are you saying that JS
    > should not be used at all?

    Yes, where items such as navigation are concerned anyway.
    Nor should Flash be used, (for such things), for similar reasons.
    --
    Regards Chad. http://freewebdesign.cjb.cc
     
    Chaddy2222, Jan 18, 2007
    #17
  18. Bart Vandewoestyne

    aa Guest

    "David Dorward" <> wrote in message
    news:...
    Yes. So what?
    Nothing. I just want to have understanding if I will pay for it.

    Once its set up, its usually a two button process to get
    > it online (assuming you want to have a chance to test the changes
    > before they go public, if you don't case then its a one button process).


    Do you mean that no need to compile every single file, but all the files are
    recompiled at two keystrokes?
    When you say "to get it online" do you mean that it automatically uploads
    the files?
     
    aa, Jan 18, 2007
    #18
  19. Bart Vandewoestyne

    aa Guest

    "David Dorward" <> > Search engines don't need to access
    the navigation? How are the going
    to find the other pages on the site then?

    By Navigarion I mean the navigation bar. I do not mean other links which are
    always there.
    From my experience on about 6 sites which I promoted in Google and a coulple
    of others, they do not need to find the other pages
    If the home page is correctly designed, they index it pretty well.
    Of course if they changed their algorithm and do not rate well sites with
    navigational menu available, then I totally agree with you


    > > 2. What is the percentage of non-JS visitors?


    > Last time I looked at any statistics, I think it was something in the
    > order of 10%. Usual provisos about statistics apply.


    Is it a matter of business model and the target audience. In some cases it
    makes sense to sacrifice 5% of DIY browsers to deliver good interactive
    stuff to the rest

    Disclaimer. Without prejudice. Please take this as a personal opinion not
    intended to be imposed on anyone, for I noticed that some people here take
    opinions different from theirs as personal offence
     
    aa, Jan 18, 2007
    #19
  20. Bart Vandewoestyne

    Ed Seedhouse Guest

    On Thu, 18 Jan 2007 01:12:19 -0700, Jim Moe
    <> wrote:

    >Bart Vandewoestyne wrote:


    > Although PHP is normally a server-side addition, it has an executable
    >version that can process a page; it outputs HTML.


    Oh no it doesn't. Not unless you make it do so.

    And the Apache module and the executable (CGI) version do substantially
    the exact same thing.
     
    Ed Seedhouse, Jan 18, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris P
    Replies:
    0
    Views:
    448
    Chris P
    Oct 28, 2003
  2. The Weiss Family

    VHDL Preprocessor

    The Weiss Family, Jul 14, 2004, in forum: VHDL
    Replies:
    2
    Views:
    3,264
    The Weiss Family
    Jul 14, 2004
  3. =?Utf-8?B?SSBhbSBTYW0=?=

    C# Preprocessor

    =?Utf-8?B?SSBhbSBTYW0=?=, Mar 13, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,608
    =?Utf-8?B?SSBhbSBTYW0=?=
    Mar 13, 2005
  4. Cronus
    Replies:
    1
    Views:
    715
    Paul Mensonides
    Jul 15, 2004
  5. Steve Howell
    Replies:
    1
    Views:
    317
    Steve Howell
    Dec 1, 2009
Loading...

Share This Page