예제 #1
0
def main():
    description = 'formd: A (for)matting (M)ark(d)own tool.'
    p = argparse.ArgumentParser(description=description)
    p.add_argument('-r', '--ref', help="convert text to referenced Markdown",
                   action='store_true', default=False)
    p.add_argument('-i', '--inline', help="convert text to inline Markdown",
                   action='store_true', default=False)
    p.add_argument('-f', '--flip', help="convert to opposite style Markdown",
                   action='store_true', default=True)
    args = p.parse_args()
    md = stdin.read()
    text = ForMd(md)
    if (args.inline):
        [stdout.write(t) for t in text.inline_md()]
    elif (args.ref):
        [stdout.write(t) for t in text.ref_md()]
    elif (args.flip):
        [stdout.write(t) for t in text.flip()]
예제 #2
0
파일: tests.py 프로젝트: TingoL/dotfiles
 def test_flip_lst_link(self):
     """ Format links embedded in markdown lists
     """
     f = ForMd(self.lref)
     inline_conv = list(f.inline_md())[0]
     self.assertEqual(self.linl, inline_conv)
예제 #3
0
파일: tests.py 프로젝트: TingoL/dotfiles
 def test_flip(self):
     f = ForMd(self.ref)
     inline_conv = list(f.inline_md())[0]
     self.assertEqual(self.inl, inline_conv)
예제 #4
0
 def test_flip_lst_link(self):
     """ Format links embedded in markdown lists
     """
     f = ForMd(self.lref)
     inline_conv = list(f.inline_md())[0]
     self.assertEqual(self.linl, inline_conv)
예제 #5
0
 def test_flip(self):
     f = ForMd(self.ref)
     inline_conv = list(f.inline_md())[0]
     self.assertEqual(self.inl, inline_conv)