Any html template framework or tools ? (urgent)

Discussion in 'HTML' started by Googy, Mar 2, 2007.

  1. Googy

    Googy Guest

    Hi,

    I need to prepare a bunch of static html pages, and they all have lot
    of common content parts, so I need a tool that can assemble all these
    common parts in the end so I don't need to manually insert common
    parts in each page manually. I need links of frame work or tool asap,
    Please I prefer a free tools which is as simple as possible.

    Thanks.
     
    Googy, Mar 2, 2007
    #1
    1. Advertisements

  2. Googy

    Rik Guest

    SSI?
     
    Rik, Mar 2, 2007
    #2
    1. Advertisements

  3. Googy

    Googy Guest

    Thanks for ur reply, I don't need SSI all I need is a command line
    tool or gui tool that can assemble files by identifying markers like
    what php smarty do except that It should generate html files and save
    them to destination folder. I hope you now understand it.
     
    Googy, Mar 2, 2007
    #3
  4. Googy

    Googy Guest

    def readFile(filename)
    return "" if not File.exists?(filename)
    contents = ""
    begin
    file = File.new(filename)
    while(line = file.readline)
    contents += line
    end
    rescue EOFError
    file.close
    end
    return contents
    end

    def gen (infile)
    incontents = readFile(infile)
    markers = []
    incontents.scan(/<<(.*?)>>/) {|filename| markers << filename.to_s}
    for filename in markers
    markcon = gen(filename)
    incontents = incontents.gsub(Regexp.new('<<'+filename+">>"),
    markcon) if not markcon.nil?
    end

    return incontents
    end

    def process (infile)
    outfile =""
    infile.scan(/(.*?).tel/){|outname| outfile = outname.to_s+".html"}
    puts "Output file: "+outfile
    ofile = File.new(outfile, "w")
    ofile << gen(infile)
    ofile.close
    end


    Here is simple ruby code that I came up with in 1 hr. It just saved
    lot of time for me. It can't handle recursive file includes.

    File include syntax "<<include file name>>"

    just give the input filename to process function.

    Thanks anyways.

    Bye.
     
    Googy, Mar 2, 2007
    #4
  5. Googy

    dorayme Guest

    You could take a deko at:

    <http://en.wikipedia.org/wiki/Preprocessor>
     
    dorayme, Mar 2, 2007
    #5
  6. What's deko? Is it Martian?
     
    Jonathan N. Little, Mar 2, 2007
    #6
  7. Googy

    dorayme Guest

    "deko" is my mispelling of the Australian expression "decko"
    which means to "look".

    Sometimes, especially in rude contexts, it is combined with
    "ringside", either explicitly or implicitly, as in

    "Mate, did she get a ringside of your tattoo?"
     
    dorayme, Mar 2, 2007
    #7
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.