+ updated wiki 2 qhelp (and 2 pdf) scripts

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5202 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
yorikvanhavre 2011-11-30 19:22:17 +00:00
parent d70992df76
commit 2c07aeebf1
3 changed files with 25 additions and 10 deletions

View File

@ -30,7 +30,7 @@ __url__ = "http://free-cad.sf.net"
This script builds qhrlp files from a local copy of the wiki
"""
import sys, os, re, tempfile, getopt
import sys, os, re, tempfile, getopt, shutil
from urllib2 import urlopen, HTTPError
# CONFIGURATION #################################################
@ -40,6 +40,7 @@ INDEX = "Online_Help_Toc" # the start page from where to crawl the wiki
VERBOSE = True # to display what's going on. Otherwise, runs totally silent.
QHELPCOMPILER = 'qhelpgenerator'
QCOLLECTIOMGENERATOR = 'qcollectiongenerator'
RELEASE = '0.12'
# END CONFIGURATION ##############################################
@ -65,6 +66,12 @@ def crawl():
print "Error at compiling"
return 1
if VERBOSE: print "All done!"
i=raw_input("Copy the files to their correct location in the source tree? y/n (default=no) ")
if i.upper() in ["Y","YES"]:
shutil.copy("localwiki/freecad.qch","../../Doc/freecad.qch")
shutil.copy("localwiki/freecad.qhc","../../Doc/freecad.qhc")
else:
print 'Files are in localwiki. Test with "assistant -collectionFile localwiki/freecad.qhc"'
return 0
def compile(qhpfile):
@ -77,7 +84,7 @@ def compile(qhpfile):
def generate(qhcpfile):
"generates qassistant-specific settings like icon, title, ..."
txt="""
<center>FreeCAD 0.11 help files<br/>
<center>FreeCAD """+RELEASE+""" help files<br/>
<a href="http://free-cad.sf.net">http://free-cad.sf.net</a></center>
"""
about=open(FOLDER + os.sep + "about.txt","w")
@ -142,15 +149,15 @@ def buildtoc():
<namespace>org.freecad.usermanual</namespace>
<virtualFolder>doc</virtualFolder>
<!--
<customFilter name="FreeCAD 0.11">
<customFilter name="FreeCAD '''+RELEASE+'''">
<filterAttribute>FreeCAD</filterAttribute>
<filterAttribute>0.11</filterAttribute>
<filterAttribute>'''+RELEASE+'''</filterAttribute>
</customFilter>
-->
<filterSection>
<!--
<filterAttribute>FreeCAD</filterAttribute>
<filterAttribute>0.11</filterAttribute>
<filterAttribute>'''+RELEASE+'''</filterAttribute>
-->
<toc>
<inserttoc>

View File

@ -49,7 +49,8 @@ LISTFILE = "wikifiles.txt"
URL = DEFAULTURL
wikiindex = "/index.php?title="
defaultfile = "<html><head><link type='text/css' href='wiki.css' rel='stylesheet'></head><body>&nbsp;</body></html>"
css = """/* Basic CSS for offline wiki rendering */
css = """
/* Basic CSS for offline wiki rendering */
body {
font-family: Arial,Helvetica,sans-serif;
@ -65,15 +66,15 @@ h1 {
background: #46A4D0;
color: white;
padding: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
pre {
border: 1px dashed #333333;
border: 1px solid #888888;
text-align: left;
background: #EEEEEE;
padding: 5px;
border-radius: 5px;
}
a:link, a:visited {
@ -100,6 +101,12 @@ a:hover {
display: none;
}
.ct, .ctTitle, .ctOdd, .ctEven th {
text-align: left;
width: 200px;
float: right;
background: #eeeeee;
}
"""
def crawl():

View File

@ -617,5 +617,6 @@ def main(arg):
crawl()
if __name__ == "__main__":
main(sys.argv[1:])
# main(sys.argv[1:])
print "Warning! This script is obsolete. Use the scripts in the offlinedocs folder..."