def pageToFile(self, page):

        # When exists foo.md, foo.mkd, foo.markdown,
        # the one with defExt will be returned
        extName = ['.md', '.mkd', '.markdown']
        defExt = self.settings.fileExt
        if defExt in extName:
            extName.remove(defExt)
        else:
            print("Warning: detected file extension name is", defExt)
            print("    Your config file is located in", self.notePath + "/notebook.conf")
        extName.insert(0, defExt)
        for ext in extName:
            filepath = os.path.join(self.notePath, page + ext)
            if QFile.exists(filepath):
                return filepath

        # return filename with default extension name even if file not exists.
        return os.path.join(self.notePath, page + defExt)
get filepath from page
dataset/ETHPy150Open ShadowKyogre/mikidown/mikidown/mikitree.py/MikiTree.pageToFile