[doc] In the process of refreshing documentation and website.

This commit is contained in:
Gaetan Delannay 2012-08-24 16:39:45 +02:00
parent 812bda7452
commit 5c2d94236f
12 changed files with 98 additions and 210 deletions

View file

@ -373,20 +373,20 @@ class Publisher:
res = produceNiceMessage(res[3:]) res = produceNiceMessage(res[3:])
return res return res
mainToc = re.compile('<span class="doc"(.*?)</span>', re.S) mainToc = re.compile('<span class="doc">(.*?)</span>', re.S)
tocLink = re.compile('<a href="(.*?)">(.*?)</a>') tocLink = re.compile('<a href="(.*?)">(.*?)</a>')
subSection = re.compile('<h1>(.*?)</h1>') subSection = re.compile('<h1>(.*?)</h1>')
subSectionContent = re.compile('<a name="(.*?)">.*?</a>(.*)') subSectionContent = re.compile('<a name="(.*?)">.*?</a>(.*)')
def createDocToc(self): def createDocToc(self):
res = '<table width="100%"><tr>' res = '<table width="100%"><tr valign="top">'
docToc = '%s/docToc.html' % self.genFolder docToc = '%s/docToc.html' % self.genFolder
# First, parse template.html to get the main TOC structure # First, parse template.html to get the main TOC structure
template = file('%s/doc/template.html' % appyPath) template = file('%s/doc/template.html' % appyPath)
mainData = self.mainToc.search(template.read()).group(0) mainData = self.mainToc.search(template.read()).group(0)
links = self.tocLink.findall(mainData)[1:] links = self.tocLink.findall(mainData)
sectionNb = 0 sectionNb = 0
for url, title in links: for url, title in links:
if title in ('gen', 'pod'): if title in ('appy.gen', 'appy.pod'):
tag = 'h1' tag = 'h1'
indent = 0 indent = 0
styleBegin = '' styleBegin = ''
@ -433,6 +433,14 @@ class Publisher:
if os.path.exists(self.genFolder): if os.path.exists(self.genFolder):
FolderDeleter.delete(self.genFolder) FolderDeleter.delete(self.genFolder)
shutil.copytree('%s/doc' % appyPath, self.genFolder) shutil.copytree('%s/doc' % appyPath, self.genFolder)
# Copy appy.css from gen, with minor updates.
f = file('%s/gen/ui/appy.css' % appyPath)
css = f.read().replace('ui/li.gif', 'img/li.gif')
f.close()
f = file('%s/appy.css' % self.genFolder, 'w')
f.write(css)
f.close()
shutil.copy('%s/gen/ui/li.gif' % appyPath, '%s/img' % self.genFolder)
# Create a temp clean copy of appy sources (without .svn folders, etc) # Create a temp clean copy of appy sources (without .svn folders, etc)
genSrcFolder = '%s/appy' % self.genFolder genSrcFolder = '%s/appy' % self.genFolder
os.mkdir(genSrcFolder) os.mkdir(genSrcFolder)

View file

@ -1,149 +0,0 @@
/* HTML element types */
a:link { COLOR: #888888; text-decoration: none; }
a:visited{ COLOR: #888888; text-decoration: none; }
a:active { COLOR: #888888; text-decoration: none; }
a:hover { COLOR: #888888; text-decoration: underline; }
input {
font-family: Verdana;
font-size: 10pt;
font-weight:normal;
}
textarea {
font-family: Verdana;
font-size: 10pt;
width: auto;
}
select {
font-family: Verdana, helvetica, sans-serif;
font-size: 10pt;
font-weight:normal;
width: auto;
}
table {
border-collapse: separate;
border-spacing: 0 0;
}
tr {
vertical-align: top;
}
td {
font-family: Verdana, helvetica, sans-serif;
font-size: 10pt;
}
th {
font-family: Verdana, helvetica, sans-serif;
font-size: 10pt;
font-style: italic;
font-weight: bold;
padding: 0 1em 0.1em 0;
border-bottom: 1px solid black;
text-align: left;
}
p {
font-family: Verdana, helvetica, sans-serif;
font-size: 10pt;
}
img {
border-width: 0
}
div {
font-family: Verdana, helvetica, sans-serif;
font-size: 10pt;
}
body {
margin:10;
padding-left:10px;
padding-right:10px;
}
h1 {
font-family: Verdana, helvetica, sans-serif;
font-size: 10pt;
font-weight: bold;
}
h2 {
font-family: Verdana, helvetica, sans-serif;
font-size: 11pt;
font-style: italic;
font-weight: normal;
}
ul {
font-family: Verdana, helvetica, sans-serif;
font-size: 10pt;
list-style-type:circle;
}
li {
font-family: Verdana, helvetica, sans-serif;
font-size: 10pt;
}
/* Classes */
.borders {
border-bottom-style: inset;
border-bottom-width: 1px;
padding-top: 8px;
padding-bottom: 8px;
}
.code {
font-family: Courier new, Nimbus Mono L, sans-serif;
font-size: 10pt;
}
.appyTable {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.siteTitle {
font-size: 12pt;
padding-left: 10px;
}
.headerStrip {
text-align: right;
font-size: 11pt;
font-style: italic;
background-color: #f1f1ed;
padding-right: 1em;
}
.bottomStrip {
font-size: 10pt;
font-weight:bold;
background-color: #F8F8F8;
padding-bottom: 0.1em;
padding-top: 0.1em;
}
.doc {
padding-left: 14px;
font-style: italic;
}
.tabs {
padding-left: 1em;
font-size: 10pt;
}
.footer {
text-align: right;
font-size: 9pt;
font-style: italic;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

View file

@ -8,7 +8,7 @@
<p>In order to render a pod template, the first thing to do is to create a renderer (create a <span class="code">appy.pod.Renderer</span> instance). The constructor for this class looks like this:</p> <p>In order to render a pod template, the first thing to do is to create a renderer (create a <span class="code">appy.pod.Renderer</span> instance). The constructor for this class looks like this:</p>
<p class="code"> <p class="code codePara">
<b>def</b> __init__(self, template, context, result, pythonWithUnoPath=None, ooPort=2002, stylesMapping={}, forceOoCall=False):<br> <b>def</b> __init__(self, template, context, result, pythonWithUnoPath=None, ooPort=2002, stylesMapping={}, forceOoCall=False):<br>
&nbsp;&nbsp;'''This Python Open Document Renderer (PodRenderer) loads a document<br/> &nbsp;&nbsp;'''This Python Open Document Renderer (PodRenderer) loads a document<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;template (p_template) which is a OpenDocument file with some elements<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;template (p_template) which is a OpenDocument file with some elements<br/>

View file

@ -1,58 +1,78 @@
<html> <html>
<head> <head>
<title>Appy framework</title> <title>Appy</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JAVASCRIPT"> <script language="JAVASCRIPT">
function sendMail(domain, user) { function sendMail(domain, user) {
var loc = 'mailto:' + user + '@' + domain; var loc = 'mailto:' + user + '@' + domain;
parent.location = loc; parent.location = loc;
} }
</script> </script>
<link rel="stylesheet" href="appy.css" type="text/css">
<link rel="stylesheet" href="appy.css" type="text/css"> </head>
</head> <body>
<body> <table class="main" align="center" width="100%" cellpadding="0" cellspacing="0">
<table align="center" width="100%"> <tr>
<tr> <td>
<td> <table width="100%" cellpadding="0" cellspacing="0">
<table width="100%" align="left"> <tr valign="top">
<tr> <td width="120px"><img src="img/appy.jpg"/>
<td class="borders">
<img src="img/appy.jpg" align="left"/>
<img src="img/advisory.png" align="right"/>
<span class="siteTitle">The <b>Appy</b> framework</span>
<span class="tabs" align="left">
<a href="/"><img src="img/home.png"/>&nbsp;Home</a>&nbsp;
<a href="http://launchpad.net/appy"><img src="img/download.gif"/>&nbsp;Download</a>
<a href="https://answers.launchpad.net/appy"><img src="img/forum.png"/>Forum</a>
<a href="https://blueprints.launchpad.net/appy"><img src="img/todo.gif"/>&nbsp;To do</a>&nbsp;
<a href="javascript:sendMail('appyframework.org', 'info')"><img src="img/contact.gif"/>&nbsp;Contact</a>&nbsp;
</span><br/>
<span class="doc"><a href="docToc.html">Documentation</a> || <a href="gen.html">gen</a> - creating <a href="genCreatingBasicClasses.html">basic</a> and <a href="genCreatingAdvancedClasses.html">advanced</a> classes - <a href="genSecurityAndWorkflows.html">security and workflows</a> || <a href="pod.html">pod</a> - creating <a href="podWritingTemplates.html">basic</a> and <a href="podWritingAdvancedTemplates.html">advanced</a> templates - <a href="podRenderingTemplates.html">rendering</a> templates</span>
</td>
</tr>
<tr>
<td class="borders headerStrip" valign="top">{{ title }}</td>
</tr>
<tr>
<td class="borders" valign="top">{{ content }}</td>
</tr>
<tr>
<td class="borders bottomStrip"><a href="http://launchpad.net/appy"><img src="img/download.gif"/>&nbsp;Download</a></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" align="right">
<tr>
<td valign="bottom" class="footer"> All software on this site is distributed under the <br/><a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License (GPL)</a>.</td>
<td align="right"><img src="img/gnu.png"/><img src="img/python.gif"/></td>
</tr>
</table>
</td>
</tr>
</table>
</td> </td>
</tr> <td style="padding-top: 5px" align="right">
</table> <i>
</body> <a href="/">Home</a>&nbsp;
<a href="docToc.html">Doc</a>&nbsp;
<a href="http://launchpad.net/appy">Download</a>&nbsp;
<a href="https://answers.launchpad.net/appy">Forum</a>&nbsp;
<a href="https://blueprints.launchpad.net/appy">To do</a>&nbsp;
<a href="javascript:sendMail('appyframework.org', 'info')">Contact</a>
</i>
</td>
<td align="right" width="150px"><img src="img/advisory.png"/>
</td>
</tr>
</table>
</td>
</tr>
<!-- The stripe -->
<tr>
<td>
<table class="userStrip" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<span class="doc"><!-- class="doc" is required when parsed by publish.py -->
<a href="gen.html">appy.gen</a> create <a href="genCreatingBasicClasses.html">basic</a> &amp;
<a href="genCreatingAdvancedClasses.html">advanced</a> classes
<a href="genSecurityAndWorkflows.html">security &amp; workflows</a> ||
<a href="pod.html">appy.pod</a> create <a href="podWritingTemplates.html">basic</a> &amp;
<a href="podWritingAdvancedTemplates.html">advanced</a> templates
<a href="podRenderingTemplates.html">render</a> templates.
</span>
</td>
</tr>
</table>
</td>
</tr>
<!-- Content -->
<tr>
<td align="center" style="padding: 10px; font-size:150%; border-bottom: 1px black dashed">{{ title }}</td>
</tr>
<tr>
<td style="padding: 15px">{{ content }}
</td>
</tr>
<tr>
<td>
<table class="footer" cellpadding="0" cellspacing="0" width="100%">
<tr valign="middle">
<td class="footer"> All software on this site is distributed under the <br/>
<a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License (GPL)</a>.
</td>
<td align="right"><img src="img/gnu.png"/><img src="img/python.gif"/></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html> </html>

View file

@ -1724,7 +1724,9 @@ class File(Type):
else: else:
# I store value "None", excepted if I find in the request the desire # I store value "None", excepted if I find in the request the desire
# to keep the file unchanged. # to keep the file unchanged.
action = obj.REQUEST.get('%s_delete' % self.name, None) action = None
rq = getattr(obj, 'REQUEST', None)
if rq: action = rq.get('%s_delete' % self.name, None)
if action == 'nochange': pass if action == 'nochange': pass
else: setattr(obj, self.name, None) else: setattr(obj, self.name, None)

View file

@ -55,6 +55,8 @@ img { border: 0; vertical-align: middle}
.userStrip { background-color: #6282B3; height: 35px; .userStrip { background-color: #6282B3; height: 35px;
border-top: 3px solid #034984; border-bottom: 2px solid #034984; } border-top: 3px solid #034984; border-bottom: 2px solid #034984; }
.userStripText { font-size: 110%; padding: 0 0.3em 0 0.3em; color: white } .userStripText { font-size: 110%; padding: 0 0.3em 0 0.3em; color: white }
.userStrip a { color: #e7e7e7 }
.userStrip a:visited { color: #e7e7e7 }
.login { margin-top: 2px; margin-bottom: 2px; color: black;} .login { margin-top: 2px; margin-bottom: 2px; color: black;}
.buttons { margin-left: 4px;} .buttons { margin-left: 4px;}
.fakeButton { border: 1px solid #D7DEE4; background-color: #fde8e0; .fakeButton { border: 1px solid #D7DEE4; background-color: #fde8e0;
@ -128,3 +130,8 @@ img { border: 0; vertical-align: middle}
.footer { font-size: 95% } .footer { font-size: 95% }
.footer td { background-color: #CBCBC9; border-top: 1px solid grey; .footer td { background-color: #CBCBC9; border-top: 1px solid grey;
padding: 0.4em 1em 0.5em } padding: 0.4em 1em 0.5em }
.code { font-family: "Lucida Console","Courier New";}
.codePara { background-color: #EEFFCC; border-color: grey;
border-style: solid none; border-width: 1px medium;
color: #333333; line-height: 120%;
padding: 10px; margin: 10px 0 10px 0}