Update of /cvsroot/audacity/audacity-src/scripts/mw2html_audacity
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10803

Modified Files:
        mw2html.py sidebar.html 
Log Message:
Local dump now uses online sidebar.
sidebar.html is directly added to the local html (links in the sidebar.html 
file should now be based on the local dump).

Index: sidebar.html
===================================================================
RCS file: /cvsroot/audacity/audacity-src/scripts/mw2html_audacity/sidebar.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- sidebar.html        22 Jun 2009 23:44:29 -0000      1.5
+++ sidebar.html        25 Jun 2009 13:24:29 -0000      1.6
@@ -1,34 +1,8 @@
-<div class="portlet" id="p-logo">
-  <a style="background-image: 
url(http://audacityteam.org/images/NEW_AudacityTransMediaWikiMANUAL.png);" 
href="http://audacityteam.org/manual"; title="Main Page"></a>
-</div>
-<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
-
-<div class="portlet">
-   <h5>Navigation</h5>
-   <div class="pBody">
-      <ul>
-         <li><a href="/manual/index.php?title=Main_Page">Front Page</a></li>
-         <li><a 
href="/manual/index.php?title=Main_Page#Tutorials">Tutorials</a></li>
-         <li><a href="/manual/index.php?title=Main_Page#Using_Audacity">Using 
Audacity</a></li>
-         <li><a 
href="/manual/index.php?title=Main_Page#Reference">Reference</a></li>
-         <ul>
-            <li><a href="/manual/index.php?title=Menu_Reference">Menu 
Bar</a></li>
-            <li><a 
href="/manual/index.php?title=Main_Page#Toolbars:_buttons_and_controls_for_playback.2Crecording_and_editing">Toolbars</a></li>
-            <li><a 
href="/manual/index.php?title=Main_Page#Project_Window:">Project Window</a></li>
-            <li><a 
href="/manual/index.php?title=Preferences">Preferences</a></li>
-         </ul>
-         <li><a href="/manual/index.php?title=FAQ">FAQ</a></li>
-         <li><a href="/manual/index.php?title=Glossary">Glossary</a></li>
-         <li><a href="/manual/index.php?title=Index">Index</a></li>
-      </ul>
-   </div>
-</div>
-
 <div class="portlet">
    <h5>Help Location</h5>
    <div class="pBody">
       <ul>
-         <li><a href="/manual/index.php?title=Main_Page">Local manual in 
use</a></li>
+         <li><a href="index.html">Local manual in use</a></li>
          <li><a href="http://audacityteam.org/manual/index.php";>Internet 
manual</a></li>
       </ul>
    </div>

Index: mw2html.py
===================================================================
RCS file: /cvsroot/audacity/audacity-src/scripts/mw2html_audacity/mw2html.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- mw2html.py  8 Jun 2009 22:10:09 -0000       1.8
+++ mw2html.py  25 Jun 2009 13:24:29 -0000      1.9
@@ -52,7 +52,7 @@
 url_filename_cache = {}
 redir_cache        = {}
 wrote_file_set     = set()
-sidebar_content    = ''
+sidebar_html       = ''
 footer_text        = ''
 counter            = 0
 errors             = 0
@@ -178,37 +178,15 @@
   """
   Sets sidebar for Mediawiki 1.4beta6 Monobook HTML output.
   """
-  global sidebar_content, config
+  global config
  
   if config.made_by:
     doc = doc.replace('<html xmlns=', MADE_BY_COMMENT + '\n<html xmlns=')
 
-  SIDEBAR_ID = 'SIDEBAR' + hashlib.md5(str(random.random())).hexdigest()
-
-  # Remove sidebar HTML
-  doc = re.sub(
-    r'(<!-- end content -->)[\s\S]+?' +
-    r'(<!-- end of the left \(by default at least\) column -->)',
-    r'\1<div class="visualClear"></div></div></div></div>' + SIDEBAR_ID + 
r'\2', doc)
-
-  pre_sidebar = """
-    <div id="column-one">
-  """
-
-  post_sidebar = """
-    </div>
-    <!-- end left column -->
-  """
-  
-  if config.sidebar != None and sidebar_content == '':
-    f = open(config.sidebar, 'rU')
-    sidebar_content = f.read()
-    f.close()
-
-  sidebar_html = pre_sidebar + sidebar_content + post_sidebar
+  doc = remove_tag(doc, '<div class="portlet" id="p-personal">', '</div>', 
'<div')
+  doc = remove_tag(doc, '<div id="p-search" class="portlet">', '</div>','<div')
+  doc = remove_tag(doc, '<div class="portlet" id="p-editors">', '</div>', 
'<div')
   
-  doc = doc.replace(SIDEBAR_ID, sidebar_html)
-
   #andre special mode
   if config.special_mode:
     # Remove ul list
@@ -271,9 +249,17 @@
   return doc
   
 def pos_html_transform(doc, url):
-  global footer_text, config
+  global footer_text, config, sidebar_html
   url = normalize_url(url, False)
   
+  # Add sidebar.html
+  if config.sidebar != None and sidebar_html == '':
+    f = open(config.sidebar, 'rU')
+    sidebar_html = f.read()
+    f.close()
+
+  doc = re.sub( r'(<!-- end of the left \(by default at least\) column -->)', 
sidebar_html + r'\1', doc)
+  
   # Remove empty links
   doc = clean_tag(doc, 'href=""', '</a>', '<a ');
   


------------------------------------------------------------------------------
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to