def ask_user(d): """Wrap sphinx_quickstart.ask_user, and add additional questions.""" # Print welcome message msg = bold('Welcome to the Hieroglyph %s quickstart utility.') % ( version(), ) print(msg) msg = """ This will ask questions for creating a Hieroglyph project, and then ask some basic Sphinx questions. """ print(msg) # set a few defaults that we don't usually care about for Hieroglyph d.update({ 'version': datetime.date.today().strftime('%Y.%m.%d'), 'release': datetime.date.today().strftime('%Y.%m.%d'), 'ext_autodoc': False, 'ext_doctest': True, 'ext_intersphinx': True, 'ext_todo': True, 'ext_coverage': True, 'ext_pngmath': True, 'ext_mathjax': False, 'ext_ifconfig': True, 'ext_viewcode': False, }) if 'project' not in d: print(''' The presentation title will be included on the title slide.''') sphinx_quickstart.do_prompt(d, 'project', 'Presentation title') if 'author' not in d: sphinx_quickstart.do_prompt(d, 'author', 'Author name(s)') # slide_theme msg = """ Hieroglyph includes two themes: * """ + bold("slides") + """ The default theme, with different styling for first, second, and third level headings. * """ + bold("single-level") + """ All slides are styled the same, with the heading at the top. Which theme would you like to use?""" print(msg) # XXX make a themes dict that has the keys/descriptions sphinx_quickstart.do_prompt( d, 'slide_theme', 'Slide Theme', 'slides', sphinx_quickstart.choice('slides', 'single-level',), ) # Ask original questions print("") sphinx_ask_user(d)
def ask_user(d): """Wrap sphinx.quickstart.ask_user, and add additional questions.""" # Print welcome message msg = bold('Welcome to the Hieroglyph %s quickstart utility.') % ( version(), ) print(msg) msg = """ This will ask questions for creating a Hieroglyph project, and then ask some basic Sphinx questions. """ print(msg) # set a few defaults that we don't usually care about for Hieroglyph d.update({ 'version': datetime.date.today().strftime('%Y.%m.%d'), 'release': datetime.date.today().strftime('%Y.%m.%d'), 'make_mode': True, }) if 'project' not in d: print(''' The presentation title will be included on the title slide.''') sphinx.quickstart.do_prompt(d, 'project', 'Presentation title') if 'author' not in d: sphinx.quickstart.do_prompt(d, 'author', 'Author name(s)') # slide_theme theme_entrypoints = pkg_resources.iter_entry_points('hieroglyph.theme') themes = [t.load() for t in theme_entrypoints] msg = """ Available themes: """ for theme in themes: msg += '\n'.join([ bold(theme['name']), theme['desc'], '', '', ]) msg += """Which theme would you like to use?""" print(msg) sphinx.quickstart.do_prompt( d, 'slide_theme', 'Slide Theme', themes[0]['name'], sphinx.quickstart.choice(*[t['name'] for t in themes]), ) # Ask original questions print("") sphinx.quickstart.ask_user(d)
def main(): parser = ArgumentParser() parser.add_argument('hieroglyph', nargs='?', help="Run hieroglyph -q to start a presentation") parser.add_argument('-v', '--version', action='store_true', help="Print current version of hieroglyph") parser.add_argument('-q', '--quickstart', action='store_true', help="Start a hieroglyph project") args = vars(parser.parse_args()) if (args['version']): print(version()) elif (args['quickstart']): sphinx_quickstart.main()
def main(): parser = ArgumentParser( description='Run hieroglyph -q to start a presentation', ) parser.add_argument('-v', '--version', action='store_true', help="Print current version of hieroglyph") parser.add_argument('-q', '--quickstart', action='store_true', help="Start a hieroglyph project") parser.add_argument('path', nargs='?', default=None, help='Output directory for new presentation.') args = vars(parser.parse_args()) if (args['version']): print(version()) elif (args['quickstart']): quickstart(args['path'])
def ask_user(d): """Wrap sphinx.quickstart.ask_user, and add additional questions.""" # Print welcome message msg = bold('Welcome to the Hieroglyph %s quickstart utility.') % ( version(), ) print(msg) msg = """ This will ask questions for creating a Hieroglyph project, and then ask some basic Sphinx questions. """ print(msg) # set a few defaults that we don't usually care about for Hieroglyph d.update({ 'version': datetime.date.today().strftime('%Y.%m.%d'), 'release': datetime.date.today().strftime('%Y.%m.%d'), 'ext_autodoc': False, 'ext_doctest': True, 'ext_intersphinx': True, 'ext_todo': True, 'ext_coverage': True, 'ext_pngmath': True, 'ext_mathjax': False, 'ext_ifconfig': True, 'ext_viewcode': False, }) if 'project' not in d: print(''' The presentation title will be included on the title slide.''') sphinx.quickstart.do_prompt(d, 'project', 'Presentation title') if 'author' not in d: sphinx.quickstart.do_prompt(d, 'author', 'Author name(s)') # slide_theme theme_entrypoints = pkg_resources.iter_entry_points('hieroglyph.theme') themes = [ t.load() for t in theme_entrypoints ] msg = """ Available themes: """ for theme in themes: msg += '\n'.join([ bold(theme['name']), theme['desc'], '', '', ]) msg += """Which theme would you like to use?""" print(msg) sphinx.quickstart.do_prompt( d, 'slide_theme', 'Slide Theme', themes[0]['name'], sphinx.quickstart.choice( *[t['name'] for t in themes] ), ) # Ask original questions print("") sphinx_ask_user(d)