Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e03e1fe

Browse files
committed
Add support for the "Aesop Meta Tag". Not widely used, but not a bad idea,
either.
1 parent cc8fe04 commit e03e1fe

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

Doc/perl/l2hinit.perl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ package main;
3737
$HAVE_GENERAL_INDEX = 0;
3838
$HAVE_TABLE_OF_CONTENTS = 0;
3939

40+
$AESOP_META_TYPE = 'information';
41+
4042

4143
# A little painful, but lets us clean up the top level directory a little,
4244
# and not be tied to the current directory (as far as I can tell). Testing
@@ -639,6 +641,8 @@ sub make_head_and_body {
639641
, "<html>\n<head>\n<title>", $title, "</title>\n"
640642
, &meta_information($title)
641643
, $MY_PARTIAL_HEADER
644+
, ($AESOP_META_TYPE eq '' ? ''
645+
: "\n<meta name='aesop' content='$AESOP_META_TYPE'>")
642646
, "\n</head>\n<body$body>");
643647
}
644648

Doc/tools/mkackshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def main():
3030
colnums = []
3131
for i in range(options.columns):
3232
colnums.append(percol*i)
33+
options.aesop_type = "information"
3334
fp = options.get_output_file()
3435
fp.write(string.rstrip(options.get_header()) + "\n")
3536
fp.write(THANKS + "\n")

Doc/tools/mkmodindex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import sys
3434

3535

3636
class IndexOptions(support.Options):
37+
aesop_type = "links"
38+
3739
def __init__(self):
3840
support.Options.__init__(self)
3941
self.add_args("l", ["letters"])

Doc/tools/support.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ class Options:
2828
uplink = "index.html"
2929
uptitle = "Python Documentation Index"
3030

31+
# The "Aesop Meta Tag" is poorly described, and may only be used
32+
# by the Aesop search engine (www.aesop.com), but doesn't hurt.
33+
#
34+
# There are a number of values this may take to roughly categorize
35+
# a page. A page should be marked according to its primary
36+
# category. Known values are:
37+
# 'personal' -- personal-info
38+
# 'information' -- information
39+
# 'interactive' -- interactive media
40+
# 'multimedia' -- multimedia presenetation (non-sales)
41+
# 'sales' -- sales material
42+
# 'links' -- links to other information pages
43+
#
44+
# Setting the aesop_type value to one of these strings will cause
45+
# get_header() to add the appropriate <meta> tag to the <head>.
46+
#
47+
aesop_type = None
48+
3149
def __init__(self):
3250
self.args = []
3351
self.variables = {"address": "",
@@ -96,6 +114,12 @@ def get_header(self):
96114
link = '<link rel="up" href="%s">' % self.uplink
97115
repl = " %s\n</head>" % link
98116
s = s.replace("</head>", repl, 1)
117+
if self.aesop_type:
118+
meta = '\n <meta name="aesop" content="%s">'
119+
# Insert this in the middle of the head that's been
120+
# generated so far, keeping <meta> and <link> elements in
121+
# neat groups:
122+
s = s.replace("<link ", meta + "<link ", 1)
99123
return s
100124

101125
def get_footer(self):

0 commit comments

Comments
 (0)