+ def format_dir(self):
+ out = '== '
+ path = ''
+ for dir in self.page_name.split('/'):
+ path = (path + '/' + dir) if path else dir
+ out += '[[' + path + '|' + dir + ']]/'
+ out += ' ==\n'
+
+ for file in page_list(self._filename(), file_re):
+ if img_re.match(file):
+ if image_maxwidth:
+ maxwidth_arg = '|maxwidth=' + str(image_maxwidth)
+ out += '{{' + self.page_name + '/' + file + '|' + file + maxwidth_arg + '}}\n'
+ else:
+ out += ' * [[' + self.page_name + '/' + file + ']]\n'
+ return out