From 62dcf1d9fa2e816224b460fb7eb15bad75d8bd01 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 20 Aug 2010 16:16:05 +0000 Subject: [PATCH] Added start link. git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@105 7bb0bf08-9e0d-0410-b083-99cee3bf18b8 --- dotfiles2html/dotfiles2html.py | 10 +++++++--- phd_pp_ru.tmpl | 16 ++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/dotfiles2html/dotfiles2html.py b/dotfiles2html/dotfiles2html.py index 887eae3..10ec3c2 100755 --- a/dotfiles2html/dotfiles2html.py +++ b/dotfiles2html/dotfiles2html.py @@ -13,7 +13,7 @@ from m_lib.m_path import get_homedir home_dir = get_homedir() -def add_headers(fname, prev, next): +def add_headers(fname, start, prev, next): head_fname = os.path.join(home_dir, fname + ".head") head_file = open(head_fname, 'r') head = head_file.read() @@ -36,11 +36,13 @@ def add_headers(fname, prev, next): html_file.write("#implements respond\n") html_file.write("#attr $Title = \"%s\"\n" % dot_name) html_file.write("#attr $Copyright = 2003\n") + if start: + html_file.write("#attr $Start = \"index.html\"\n") if prev: html_file.write("#attr $Prev = \"%s.html\"\n" % prev) if next: html_file.write("#attr $Next = \"%s.html\"\n" % next) - html_file.write('#attr $alternates = (("text/plain", "Plain text version", "%s"),)' % txt_name) + html_file.write('#attr $alternates = (("Plain text version", "text/plain", "%s"),)' % txt_name) html_file.write("\n") html_file.write("#def body_html\n") html_file.write("#raw\n") @@ -90,14 +92,16 @@ for i, (fname, ftype) in enumerate(file_types): """ % (ftype, home_dir, fname)) if i == 0: + start = None prev = None else: + start = True prev = file_types[i-1][0] if i >= ft_len - 1: next = None else: next = file_types[i+1][0] - add_headers(fname, prev, next) + add_headers(fname, start, prev, next) if os.path.exists(fname + ".tmpl") and filecmp.cmp(fname + ".html", fname + ".tmpl"): os.remove(fname + ".html") diff --git a/phd_pp_ru.tmpl b/phd_pp_ru.tmpl index 63ce06f..c87bfce 100644 --- a/phd_pp_ru.tmpl +++ b/phd_pp_ru.tmpl @@ -5,6 +5,7 @@ #attr $Description = None #attr $Keywords = None #attr $Copyright = None +#attr $Start = None #attr $Prev = None #attr $Next = None #attr $refresh = None @@ -42,14 +43,17 @@ #if $root - - + + +#end if +#if $Start + #end if #if $Prev - + #end if #if $Next - + #end if #if $styles @@ -61,8 +65,8 @@ $style #end for #end if #if $alternates -#for $type, $title, $href in $alternates - +#for $title, $type, $href in $alternates + #end for #end if -- 2.39.2