#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2005 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pubilc License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
"Web Site/Generate Web Site"
#------------------------------------------------------------------------
#
# python modules
#
#------------------------------------------------------------------------
import os
import shutil
from gettext import gettext as _
#------------------------------------------------------------------------
#
# GNOME/gtk
#
#------------------------------------------------------------------------
import gtk
import gnome.ui
#------------------------------------------------------------------------
#
# GRAMPS module
#
#------------------------------------------------------------------------
import os
import RelLib
import const
import GrampsKeys
import GenericFilter
import Sort
import Report
import Errors
import Utils
from QuestionDialog import ErrorDialog
import ReportOptions
import BaseDoc
from NameDisplay import displayer as _nd
from DateHandler import displayer as _dd
import ReportUtils
_NARRATIVE = "narrative.css"
_css = [
'BODY {\nfont-family: "Arial", "Helvetica", sans-serif;',
'letter-spacing: 0.05em;\nbackground-color: #fafaff;',
'color: #003;\n}',
'P,BLOCKQUOTE {\nfont-size: 14px;\n}',
'DIV {\nmargin: 2px;\npadding: 2px;\n}',
'TD {\nvertical-align: top;\n}',
'H1 {',
'font-family: "Verdana", "Bistream Vera Sans", "Arial", "Helvetica", sans-serif;',
'font-weight: bolder;\nfont-size: 160%;\nmargin: 2px;\n}\n',
'H2 {',
'font-family: "Verdana", "Bistream Vera Sans", "Arial", "Helvetica", sans-serif;',
'font-weight: bolder;\nfont-style: italic;\nfont-size: 150%;\n}',
'H3 {\nfont-weight: bold;\nmargin: 0;\npadding-top: 10px;',
'padding-bottom: 10px;\ncolor: #336;\n}',
'H4 {\nmargin-top: 1em;\nmargin-bottom: 0.3em;',
'padding-left: 4px;\nbackground-color: #667;\ncolor: #fff;\n}',
'H5 {\nmargin-bottom: 0.5em;\n}',
'H6 {\nfont-weight: normal;\nfont-style: italic;',
'font-size: 100%;\nmargin-left: 1em;\nmargin-top: 1.3em;',
'margin-bottom: 0.8em;\n}',
'HR {\nheight: 0;\nwidth: 0;\nmargin: 0;\nmargin-top: 1px;',
'margin-bottom: 1px;\npadding: 0;\nborder-top: 0;',
'border-color: #e0e0e9;\n}',
'A:link {\ncolor: #006;\ntext-decoration: underline;\n}',
'A:visited {\ncolor: #669;\ntext-decoration: underline;\n}',
'A:hover {\nbackground-color: #eef;\ncolor: #000;',
'text-decoration: underline;\n}',
'A:active {\nbackground-color: #eef;\ncolor: #000;\ntext-decoration: none;\n}',
'.navheader {\npadding: 4px;\nbackground-color: #e0e0e9;',
'margin: 2px;\n}',
'.navtitle {\nfont-size: 160%;\ncolor: #669;\nmargin: 2px;\n}',
'.navbyline {\nfloat: right;\nfont-size: 14px;\nmargin: 2px;',
'padding: 4px;\n}',
'.nav {\nmargin: 0;\nmargin-bottom: 4px;\npadding: 0;',
'font-size: 14px;\nfont-weight: bold;\n}',
'.summaryarea {',
'min-height: 100px;',
'height: expression(document.body.clientHeight < 1 ? "100px" : "100px" );',
'}',
'.portrait {\njustify: center;\nmargin: 5px;\nmargin-right: 20px;',
'padding: 3px;\nborder-color: #336;\nborder-width: 1px;\n}',
'.snapshot {\nfloat: right;\nmargin: 5px;\nmargin-right: 20px;',
'padding: 3px;\n}',
'.thumbnail {\nheight: 100px;\nborder-color: #336;\nborder-width: 1px;\n}',
'.leftwrap {\nfloat: left;\nmargin: 2px;\nmargin-right: 10px;\n}',
'.rightwrap {\nfloat: right;\nmargin: 2px;\nmargin-left: 10px;\n}',
'TABLE.infolist {\nborder: 0;\nfont-size: 14px;\n}',
'TD.category {\npadding: 3px;\npadding-right: 3em;',
'font-weight: bold;\n}',
'TD.field {\npadding: 3px;\npadding-right: 3em;\n}',
'TD.data {\npadding: 3px;\npadding-right: 3em;',
'font-weight: bold;\n}',
'.pedigree {\nmargin: 0;\nmargin-left: 2em;\npadding: 0;',
'background-color: #e0e0e9;\nborder: 1px;\n}',
'.pedigreeind {\nfont-size: 14px;\nmargin: 0;\npadding: 2em;',
'padding-top: 0.25em;\npadding-bottom: 0.5em;\n}',
'.footer {\nmargin: 1em;\nfont-size: 12px;\nfloat: right;\n}',
]
class BasePage:
def __init__(self,title):
self.title_str = title
def lnkfmt(self,text):
return text.replace(' ','%20')
def display_footer(self,ofile):
ofile.write('
\n')
ofile.write('
\n')
ofile.write('