Process the documentation with Markdown to produce HTML.

def markdown(self,md,project):
        """
        Process the documentation with Markdown to produce HTML.
        """
        if len(self.doc) > 0:
            if len(self.doc) == 1 and ':' in self.doc[0]:
                words = self.doc[0].split(':')[0].strip()
                if words.lower() not in ['author','date','license','version','category','summary','deprecated','display','graph']:
                    self.doc.insert(0,'')
                self.doc.append('')
            self.doc = '\n'.join(self.doc)
            self.doc = md.convert(self.doc)
            self.meta = md.Meta
            md.reset()
            md.Meta = {}
        else:
            if self.settings['warn'].lower() == 'true' and self.obj != 'sourcefile' and self.obj != 'genericsource':
                #TODO: Add ability to print line number where this item is in file
                print('Warning: Undocumented {} {} in file {}'.format(self.obj, self.name, self.hierarchy[0].name))
            self.doc = ""
            self.meta = {}

        if self.parent:
            self.display = self.parent.display

        #~ print (self.meta)
        for key in self.meta:
            #~ print(key, self.meta[key])
            if key == 'display':
                tmp = [ item.lower() for item in self.meta[key] ]
                if type(self) == FortranSourceFile:
                    while 'none' in tmp:
                        tmp.remove('none')
                if len(tmp) == 0:
                    pass
                elif 'none' in tmp:
                    self.display = []
                elif 'public' not in tmp and 'private' not in tmp and 'protected' not in tmp:
                    pass
                else:
                    self.display = tmp
            elif len(self.meta[key]) == 1:
                self.meta[key] = self.meta[key][0]
            elif key == 'summary':
                self.meta[key] = '\n'.join(self.meta[key])
        if hasattr(self,'num_lines'): self.meta['num_lines'] = self.num_lines

        self.doc = ford.utils.sub_macros(ford.utils.sub_notes(self.doc),self.base_url)

        if 'summary' in self.meta:
            self.meta['summary'] = md.convert(self.meta['summary'])
            self.meta['summary'] = ford.utils.sub_macros(ford.utils.sub_notes(self.meta['summary']),self.base_url)
        elif PARA_CAPTURE_RE.search(self.doc):
            if self.get_url() == None:
                # There is no stand-alone webpage for this item (e.g.,
                # an internal routine in a routine, so make the whole
                # doc blob appear, without the link to "more..."
                self.meta['summary'] = self.doc
            else:
                self.meta['summary'] = PARA_CAPTURE_RE.search(self.doc).group()
        else:
            self.meta['summary'] = ''
        if self.meta['summary'].strip() != self.doc.strip():
            self.meta['summary'] += '<a href="{}" class="pull-right"><emph>Read more&hellip;</emph></a>'.format(self.get_url())
        if 'graph' not in self.meta:
            self.meta['graph'] = self.settings['graph']
        else:
            self.meta['graph'] = self.meta['graph'].lower()
        if 'graph_maxdepth' not in self.meta:
            self.meta['graph_maxdepth'] = self.settings['graph_maxdepth']
        if 'graph_maxnodes' not in self.meta:
            self.meta['graph_maxnodes'] = self.settings['graph_maxnodes']

        if self.obj == 'proc' or self.obj == 'type' or self.obj == 'program':
            if 'source' not in self.meta:
                self.meta['source'] = self.settings['source'].lower()
            else:
                self.meta['source'] = self.meta['source'].lower()
            if self.meta['source'] == 'true':
                if self.obj == 'proc':
                    obj = self.proctype.lower()
                else:
                    obj = self.obj
                regex = re.compile(self.SRC_CAPTURE_STR.format(obj,self.name), re.IGNORECASE|re.DOTALL|re.MULTILINE)
                match = regex.search(self.hierarchy[0].raw_src)
                if match:
                    self.src = highlight(match.group(),FortranLexer(),HtmlFormatter())
                else:
                    self.src = ''
                    if self.settings['warn'].lower() == 'true':
                        print('Warning: Could not extract source code for {} {} in file {}'.format(self.obj, self.name, self.hierarchy[0].name))

        if self.obj == 'proc':
            if 'proc_internals' not in self.meta:
                self.meta['proc_internals'] = self.settings['proc_internals'].lower()
            else:
                self.meta['proc_internals'] = self.meta['proc_internals'].lower()

        # Create Markdown
        for item in self.iterator('variables', 'modules', 'submodules', 'common',
                                   'subroutines', 'modprocedures', 'functions',
                                   'interfaces', 'absinterfaces', 'types',
                                   'programs', 'blockdata', 'boundprocs',
                                   'finalprocs', 'args', 'enums'):
            if isinstance(item, FortranBase):
                item.markdown(md, project)
        if hasattr(self,'retvar'):
            if self.retvar:
                if isinstance(self.retvar, FortranBase):
                    self.retvar.markdown(md, project)
        if hasattr(self,'procedure'):
            if isinstance(self.procedure, FortranBase):
                self.procedure.markdown(md, project)
        return