def __init__(self): checkFileExists ('course.md') self.content = parse_markdown('course.md') self.title = getHeadder('course.md') ignoreList = getIgnoreList() self.topicList = [] allTopics = glob('topic*') topicsToPublish = [t for t in allTopics if t not in ignoreList] for topic in topicsToPublish: self.topicList.append(TopicSummary(topic))
def parse(self, mdFile): self.content = parse_markdown(mdFile) self.title = getHeadder(mdFile) with open(mdFile, 'r') as fin: data = fin.read().splitlines(True) with open('temp.md', 'w') as fout: fout.writelines(data[1:]) fout.close() self.contentWithoutHeadder = parse_markdown('temp.md') remove ('temp.md')
def __init__(self): checkFileExists('course.md') self.content = parse_markdown('course.md') self.title = getHeadder('course.md') self.courseUrl = getCourseUrl() ignoreList = getIgnoreList() self.topicList = [] allTopics = glob('topic*') topicsToPublish = [t for t in allTopics if t not in ignoreList] for topic in topicsToPublish: self.topicList.append(TopicSummary(topic))
def parse(self, mdFile): self.content = parse_markdown(mdFile) self.title = getHeadder(mdFile) with open(mdFile, 'r') as fin: data = fin.read().splitlines(True) with open('temp.md', 'w') as fout: fout.writelines(data[1:]) fout.close() self.contentWithoutHeadder = parse_markdown('temp.md') remove('temp.md')
def __init__(self): mdFile = 'profile.md' checkFileExists (mdFile) self.title = getHeadder(mdFile) with open(mdFile, 'r') as fin: data = fin.read().splitlines(True) with open('temp.md', 'w') as fout: fout.writelines(data[1:]) fout.close() self.content = parse_markdown('temp.md') remove ('temp.md')
def __init__(self): mdFile = 'profile.md' checkFileExists(mdFile) self.title = getHeadder(mdFile) with open(mdFile, 'r') as fin: data = fin.read().splitlines(True) with open('temp.md', 'w') as fout: fout.writelines(data[1:]) fout.close() self.content = parse_markdown('temp.md') remove('temp.md')
def __init__(self, topicFolder, name): self.name = name self.topicFolder = topicFolder self.pdf = name + '.pdf' self.img = getImageFile ('./pdf/' + name) if self.img: self.fullImgPath = topicFolder + self.img[1:] self.fullPdfPath = topicFolder + '/pdf/' + self.pdf mdFile = "./pdf/" + name + ".md" if (path.isfile(mdFile)): self.text = parse_markdown ("./pdf/" + name + ".md") self.title = getHeadder("./pdf/" + name + ".md") self.textWithoutHeadder = parse_markdown_without_header ("./pdf/" + name + ".md")
def __init__(self): checkFileExists ('topic.md') root, self.folder = path.split(getcwd()) self.content = parse_markdown('topic.md') self.title = getHeadder('topic.md') self.pdfs = [] pdfList = glob('./pdf/*.pdf') for pdf in pdfList: self.pdfs.append(path.basename(pdf)) self.bookList = [] books = glob('./book*') for lab in books: self.bookList.append( BookSummary(path.basename(lab), "") )
def __init__(self, topicFolder, name): self.name = name self.topicFolder = topicFolder self.pdf = name + '.pdf' self.img = getImageFile('./pdf/' + name) if self.img: self.fullImgPath = topicFolder + self.img[1:] self.fullPdfPath = topicFolder + '/pdf/' + self.pdf mdFile = "./pdf/" + name + ".md" if (path.isfile(mdFile)): self.text = parse_markdown("./pdf/" + name + ".md") self.title = getHeadder("./pdf/" + name + ".md") self.textWithoutHeadder = parse_markdown_without_header("./pdf/" + name + ".md")
def __init__(self, folder): checkFileExists ('topic.md') root, self.folder = path.split(getcwd()) self.content = parse_markdown('topic.md') self.title = getHeadder('topic.md') self.topicElements = [] self.topicFolder = folder pdfList = glob('./pdf/*.pdf') for pdf in pdfList: elementName, type = path.splitext(path.basename(pdf)) self.topicElements.append(TopicElement(self.topicFolder, elementName)) self.bookList = [] books = glob('./book*') for lab in books: self.bookList.append( BookSummary(self.topicFolder, path.basename(lab), "") )
def __init__(self, folder): checkFileExists('topic.md') root, self.folder = path.split(getcwd()) self.content = parse_markdown('topic.md') self.title = getHeadder('topic.md') self.topicElements = [] self.topicFolder = folder pdfList = glob('./pdf/*.pdf') for pdf in pdfList: elementName, type = path.splitext(path.basename(pdf)) self.topicElements.append( TopicElement(self.topicFolder, elementName)) self.bookList = [] books = glob('./book*') for lab in books: self.bookList.append( BookSummary(self.topicFolder, path.basename(lab), ""))
def __init__(self, folder): self.folder = folder checkFileExists(folder + '/topic.md') self.title = getHeadder(folder + '/topic.md')
def __init__(self, folder): self.folder = folder; checkFileExists (folder + '/topic.md') self.title = getHeadder(folder + '/topic.md')