示例#1
0
 def test_convert_creates_markdown_from_branch_titles(self):
     test_dir = './data/test/'
     prepare_test_directory(test_dir)
     shutil.copy('data/OTW-Afternoondemos.mm',
                 'data/test/OTW-Afternoondemos.mm')
     converter = Converter('data/test/OTW-Afternoondemos.mm')
     converter.convert_map()
     md = contents_of(test_dir, 'manuscript', 'Chapter0.txt')
     assert_that(md, contains_string('{frontmatter}\n\n#Introduction\n\n'))
     md = contents_of(test_dir, 'manuscript', 'Chapter1.txt')
     assert_that(md, contains_string('{mainmatter}\n\n#Richard Bowman\n\n'))
     assert_that(
         md,
         contains_string('\n\n##3d Printed Platform for Microscopy\n\n'))
     md = contents_of(test_dir, 'manuscript', 'Chapter3.txt')
     assert_that(md, contains_string('\n\n#Josie Hughes and James Ritchie'))
     assert_that(md, contains_string('\n{width=30%, float=right}\n'))
     md = contents_of(test_dir, 'manuscript', 'Chapter5.txt')
     assert_that(
         md,
         contains_string(
             '\n\nPratap is a year 10 student at the Perse School, Cambridge. \n\n'
         ))  ## space!
     script = contents_of(test_dir, 'copy-images.sh')
     assert_that(script, contains_string('#! /usr/bin/bash\n'))
     assert_that(
         script,
         contains_string(
             'cp ../../../Dropbox/rareblog/images/opentechworkshop/josie.jpg data/test/manuscript/images/\n'
         ))
示例#2
0
 def test_convert_creates_markdown_from_branch_titles(self):
     test_dir = './data/test/'
     prepare_test_directory(test_dir)
     shutil.copy('data/OTW-Afternoondemos.mm', 'data/test/OTW-Afternoondemos.mm')
     converter = Converter('data/test/OTW-Afternoondemos.mm')
     converter.convert_map()
     md = contents_of(test_dir, 'manuscript','Chapter0.txt')
     assert_that(md, contains_string('{frontmatter}\n\n#Introduction\n\n'))
     md = contents_of(test_dir, 'manuscript','Chapter1.txt')
     assert_that(md, contains_string('{mainmatter}\n\n#Richard Bowman\n\n'))
     assert_that(md, contains_string('\n\n##3d Printed Platform for Microscopy\n\n'))
     md = contents_of(test_dir, 'manuscript','Chapter3.txt')
     assert_that(md, contains_string('\n\n#Josie Hughes and James Ritchie'))
     assert_that(md, contains_string('\n{width=30%, float=right}\n'))
     md = contents_of(test_dir, 'manuscript','Chapter5.txt')
     assert_that(md, contains_string('\n\nPratap is a year 10 student at the Perse School, Cambridge. \n\n')) ## space!
     script = contents_of(test_dir, 'copy-images.sh')
     assert_that(script, contains_string('#! /usr/bin/bash\n'))
     assert_that(script, contains_string('cp ../../../Dropbox/rareblog/images/opentechworkshop/josie.jpg data/test/manuscript/images/\n'))
示例#3
0
#! /usr/bin/python
from fm2md.convert import Converter
from sys import argv

path = argv[1]
converter = Converter(path)
converter.convert_map()
示例#4
0
#!/usr/bin/env python
from fm2md.convert import Converter
from sys import argv

path = argv[1]
converter = Converter(path)
converter.convert_map()