diff --git a/README.md b/README.md index 3c88d9f..df84d5c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Mcider Mcider is to convert markdown into slideshow. -![mcider](https://github.com/ogom/python-mcider/raw/master/mcider.png) +![mcider](https://ogom.github.com/python-mcider/images/mcider.png) ### Examples of themes @@ -32,22 +32,26 @@ Simple, the file is output to the same directory as the markdown. $ mcider ./slide.md -If you wanted to display the WEB browser with the option of `-b`. +`-b` option is displayed in the web browser. $ mcider ./slide.md -b -The output destination can be changed in the options `-o`. +`-o` option to change the location to save the file. $ mcider ./slide.md -o /tmp/my.html -Theme is provided io2012 and io2011. Select the option `-t`. +`-t` option to change the theme of the slide. $ mcider ./slide.md -t io2011 -[Extensions](http://freewisdom.org/projects/python-markdown/Available_Extensions) of markdown is the options `-x`. +`-x` option to extend the markdown. [(Available Extensions)](http://freewisdom.org/projects/python-markdown/Available_Extensions) $ mcider ./slide.md -x fenced_code tables +`--presenter` option is displayed in Presenter mode. Only theme `io2012`. + + $ mcider ./slide.md -b --presenter + See also `mcider --help`. @@ -65,6 +69,27 @@ io2012 or io2011 of the theme to change the class of article in the horizon. *** | fill +### I/O 2012 + +#### Presenter note + +converted to the presenter note from markdown comment tag. + +```markdown + +``` + +```html + +``` + +![presenter](https://ogom.github.com/python-mcider/images/presenter.png) + + ## Examples ### Theme of io2012 diff --git a/mcider.png b/mcider.png deleted file mode 100644 index 24e510b..0000000 Binary files a/mcider.png and /dev/null differ diff --git a/mcider/cli_helper.py b/mcider/cli_helper.py index 38f5bce..4a9c7f9 100644 --- a/mcider/cli_helper.py +++ b/mcider/cli_helper.py @@ -40,6 +40,11 @@ help='Theme was to clean the output.' ) +parser.add_argument( + '--presenter', action='store_true', default=False, + help='Presenter mode.' +) + parser.add_argument( '--themes', metavar='PATH', help='Path of the custom themes' diff --git a/mcider/converter.py b/mcider/converter.py index 682c7e8..7e6db6a 100644 --- a/mcider/converter.py +++ b/mcider/converter.py @@ -125,6 +125,11 @@ def _get_slide_io2012(self, contents=None, extensions=[]): html += md.convert(slide['article']) + '\n' html += '\n' html += '\n\n' + + # from comment out to presener note + html = html.replace('\n\n', '\n\n') + return html def _get_slide_io2011(self, contents=None, extensions=[]): diff --git a/mcider/main.py b/mcider/main.py index b5c9364..9fba6f5 100644 --- a/mcider/main.py +++ b/mcider/main.py @@ -40,7 +40,11 @@ def main(): html = slide.maker(output_path) util.fs_writer(output_file, html) if args.browser: - webbrowser.open_new_tab('file://' + output_file) + url = 'file://' + output_file + if slide.options['theme'] == 'io2012': + url += '?presentme=' + url += 'true' if args.presenter else 'false' + webbrowser.open_new_tab(url) except KeyError as e: print "KeyError: %s" % e else: diff --git a/setup.py b/setup.py index ff45caa..dcd6bd4 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ def set_install_requires(): setup( name='mcider', - version='0.0.9', + version='0.1.0', description='to convert markdown into slideshow', license='Apache 2.0', url='http://ogom.github.com/python-mcider', diff --git a/test/unit/converter_test.py b/test/unit/converter_test.py index 326deff..8202489 100644 --- a/test/unit/converter_test.py +++ b/test/unit/converter_test.py @@ -22,9 +22,14 @@ def setUp(self): def test_set_theme(self): self.assertEqual(self.slide.options['theme'], 'io2012') - def test_get_slide(self): + def test_get_slide_base(self): self.assertIsNotNone(self.slide._get_slide('io2012', self.contents, [])) #print self.slide._get_slide('io2012', self.contents, []).encode('utf-8') + def test_get_slide_note(self): + contents = util.fs_reader(os.path.join(test_path, 'fixtures', 'note.md')) + self.assertIsNotNone(self.slide._get_slide('io2012', contents, [])) + #print self.slide._get_slide('io2012', contents, []).encode('utf-8') + if __name__ == '__main__': unittest.main()