Esempio n. 1
0
 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))  
Esempio n. 2
0
 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')
Esempio n. 3
0
 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))
Esempio n. 4
0
    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')
Esempio n. 5
0
 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')
Esempio n. 6
0
    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')
Esempio n. 7
0
 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")
Esempio n. 8
0
 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), "") )
Esempio n. 9
0
 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")
Esempio n. 10
0
  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), "") )
Esempio n. 11
0
    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), ""))
Esempio n. 12
0
 def __init__(self, folder):
     self.folder = folder
     checkFileExists(folder + '/topic.md')
     self.title = getHeadder(folder + '/topic.md')
Esempio n. 13
0
 def __init__(self, folder):
   self.folder = folder;
   checkFileExists (folder + '/topic.md')
   self.title = getHeadder(folder + '/topic.md')