def single(args): ''' For uploading (and converting) to google docs. ''' handle_options(args) options.builder = 'singlehtml' # options.builder = 'epub' if not hasattr(options, 'tags'): options.tags = [] #options.tags.append('standalone') options.conf_overrides['html_theme'] = 'default' #options.conf_overrides['html_theme_options'] = {'nosidebar' : True} #print('options:',options) for book, bookdir in options.books.items(): book_options = options book_options.docroot = bookdir book_options.conf_overrides['project'] = book conf_override(bookdir) paversphinx.run_sphinx(options) in_fname = os.path.join(bookdir, options.builddir, 'singlehtml', 'index.html') out_fname = os.path.join(bookdir, options.builddir, 'singlehtml', book + '.html') insert_gdoc_css(in_fname, out_fname) uncog()
def single(args): ''' For uploading (and converting) to google docs. ''' handle_options(args) options.builder = 'singlehtml' # options.builder = 'epub' if not hasattr(options, 'tags'): options.tags = [] #options.tags.append('standalone') options.conf_overrides['html_theme'] = 'default' #options.conf_overrides['html_theme_options'] = {'nosidebar' : True} #print('options:',options) for book, bookdir in options.books.items(): book_options = options book_options.docroot = bookdir book_options.conf_overrides['project'] = book conf_override(bookdir) paversphinx.run_sphinx(options) in_fname = os.path.join(bookdir,options.builddir,'singlehtml','index.html') out_fname = os.path.join(bookdir,options.builddir,'singlehtml',book+'.html') insert_gdoc_css(in_fname, out_fname) uncog()
def pseudo(args): handle_options(args) options.builder = 'pseudoxml' for book, bookdir in options.books.items(): book_options = options book_options.docroot = bookdir book_options.conf_overrides['project'] = book conf_override(bookdir) paversphinx.run_sphinx(options)
def pdf(args): handle_options(args) override_text = '' options.builder = 'latex' if not hasattr(options, 'tags'): options.tags = [] if hasattr(options, 'pdf_paper_size'): override_text += "latex_elements['paper_size'] = '" + options.pdf_paper_size + "'" #options.tags.append('standalone') #print('options:',options) for book, bookdir in options.books.items(): book_options = options book_options.docroot = bookdir book_options.conf_overrides['project'] = book conf_override(bookdir, {'override_text': override_text}) pdffile = os.path.join(bookdir, options.builddir, 'latex', book + '.pdf') if os.path.exists(pdffile): os.unlink(pdffile) rval = paversphinx.run_sphinx(options) run_latex(os.path.join(bookdir, options.builddir, 'latex')) if os.path.exists(pdffile): print('copy', pdffile, bookdir) shutil.copy(pdffile, bookdir) else: print('pdf file not created') uncog()
def pdf(args): handle_options(args) override_text = '' options.builder = 'latex' if not hasattr(options, 'tags'): options.tags = [] if hasattr(options, 'pdf_paper_size'): override_text += "latex_elements['paper_size'] = '"+options.pdf_paper_size+"'" #options.tags.append('standalone') #print('options:',options) for book, bookdir in options.books.items(): book_options = options book_options.docroot = bookdir book_options.conf_overrides['project'] = book conf_override(bookdir, {'override_text' : override_text}) pdffile = os.path.join(bookdir, options.builddir, 'latex', book+'.pdf') if os.path.exists(pdffile): os.unlink(pdffile) rval = paversphinx.run_sphinx(options) run_latex(os.path.join(bookdir, options.builddir, 'latex')) if os.path.exists(pdffile): print('copy',pdffile,bookdir) shutil.copy(pdffile, bookdir) else: print('pdf file not created') uncog()
def epub(args): handle_options(args) options.builder = 'epub' if not hasattr(options, 'tags'): options.tags = [] #options.tags.append('standalone') options.conf_overrides['html_theme'] = 'default' #options.conf_overrides['html_theme_options'] = {'nosidebar' : True} #print('options:',options) for book, bookdir in options.books.items(): book_options = options book_options.docroot = bookdir book_options.conf_overrides['project'] = book conf_override(bookdir) paversphinx.run_sphinx(options) epubfile = os.path.join(bookdir, options.builddir, 'epub', book+'.epub') print('copy',epubfile,bookdir) shutil.copy(epubfile, bookdir)
def epub(args): handle_options(args) options.builder = 'epub' if not hasattr(options, 'tags'): options.tags = [] #options.tags.append('standalone') options.conf_overrides['html_theme'] = 'default' #options.conf_overrides['html_theme_options'] = {'nosidebar' : True} #print('options:',options) for book, bookdir in options.books.items(): book_options = options book_options.docroot = bookdir book_options.conf_overrides['project'] = book conf_override(bookdir) paversphinx.run_sphinx(options) epubfile = os.path.join(bookdir, options.builddir, 'epub', book + '.epub') print('copy', epubfile, bookdir) shutil.copy(epubfile, bookdir)
def all(args): handle_options(args) #rint('options:',options) options.conf_overrides['standalone'] = False paversphinx.run_sphinx(options, 'html')