diff Doc/tools/support.py @ 22849:d6d64239aa05 legacy-trunk

Add support for the "Aesop Meta Tag". Not widely used, but not a bad idea, either.
author Fred Drake <fdrake@acm.org>
date Fri, 05 Apr 2002 17:34:50 +0000
parents 5043b738b072
children bc81d531c629
line wrap: on
line diff
--- a/Doc/tools/support.py	Fri Apr 05 17:10:16 2002 +0000
+++ b/Doc/tools/support.py	Fri Apr 05 17:34:50 2002 +0000
@@ -28,6 +28,24 @@
     uplink = "index.html"
     uptitle = "Python Documentation Index"
 
+    # The "Aesop Meta Tag" is poorly described, and may only be used
+    # by the Aesop search engine (www.aesop.com), but doesn't hurt.
+    #
+    # There are a number of values this may take to roughly categorize
+    # a page.  A page should be marked according to its primary
+    # category.  Known values are:
+    #   'personal'    -- personal-info
+    #   'information' -- information
+    #   'interactive' -- interactive media
+    #   'multimedia'  -- multimedia presenetation (non-sales)
+    #   'sales'       -- sales material
+    #   'links'       -- links to other information pages
+    #
+    # Setting the aesop_type value to one of these strings will cause
+    # get_header() to add the appropriate <meta> tag to the <head>.
+    #
+    aesop_type = None
+
     def __init__(self):
         self.args = []
         self.variables = {"address": "",
@@ -96,6 +114,12 @@
                 link = '<link rel="up" href="%s">' % self.uplink
             repl = "  %s\n</head>" % link
             s = s.replace("</head>", repl, 1)
+        if self.aesop_type:
+            meta = '\n  <meta name="aesop" content="%s">'
+            # Insert this in the middle of the head that's been
+            # generated so far, keeping <meta> and <link> elements in
+            # neat groups:
+            s = s.replace("<link ", meta + "<link ", 1)
         return s
 
     def get_footer(self):