title: Sphinx: How to generate documentation using Sphinx
body: <p>When we enter the command <strong>sphinx-quickstart</strong>, we have to enter values for so many times.<br>
  For example:  </p>
  
  <pre><code>&gt; Root path for the documentation [.]:
  &gt; Separate source and build directories (y/n) [n]: 
  &gt; Name prefix for templates and static dir [_]:
  &gt; Project name: 
  &gt; Author name(s):
  &gt; Project version []: 
  &gt; Project release []:
  &gt; Project language [en]: 
  &gt; Source file suffix [.rst]: 
  &gt; Name of your master document (without suffix) [index]:
  &gt; Do you want to use the epub builder (y/n) [n]:
  &gt; autodoc: automatically insert docstrings from modules (y/n) [n]:
  &gt; doctest: automatically test code snippets in doctest blocks (y/n) [n]:
  &gt; intersphinx: link between Sphinx documentation of different projects (y/n) [n]: 
  &gt; todo: write "todo" entries that can be shown or hidden on build (y/n) [n]: 
  &gt; coverage: checks for documentation coverage (y/n) [n]: 
  &gt; imgmath: include math, rendered as PNG or SVG images (y/n) [n]: 
  &gt; mathjax: include math, rendered in the browser by MathJax (y/n) [n]: 
  &gt; ifconfig: conditional inclusion of content based on config values (y/n) [n]: 
  &gt; viewcode: include links to the source code of documented Python objects (y/n) [n]: 
  &gt; githubpages: create .nojekyll file to publish the document on GitHub pages (y/n) [n]:
  &gt; Create Makefile? (y/n) [y]: 
  &gt; Create Windows command file? (y/n) [y]:
  </code></pre>
  
  <p>Is there any way around that we don't have to this tiresome job?<br>
  For example any bash script or python script ?    </p>
  
  <p>The relevant arguments are:  </p>
  
  <pre><code>&gt; Project name: My Project
  &gt; Author name(s): My Name
  &gt; Project version []: 1
  &gt; autodoc: automatically insert docstrings from modules (y/n) [n]: y 
  &gt; doctest: automatically test code snippets in doctest blocks (y/n) [n]: y
  &gt; viewcode: include links to the source code of documented Python objects (y/n) [n]: y
  </code></pre>
  
  <p>All the rest are just empty strings.  </p>
  
  <p><strong>My attempts</strong>  </p>
  
  <pre><code>printf '\n\n\nMyProject\nBhishan Poudel\n1\n\n\n\n\n\ny\ny\n\n\n\n\n\n\ny\n\n\n\n' | sphinx-quickstart
  </code></pre>
  
  <p><strong>Attempt 2</strong>  </p>
  
  <pre><code># run_sphinx_quickstart.py
  #!/usr/bin/env python3
  import subprocess
  
  sphinx_args = {
  'Root_path'        : '',
  'Separate_source'  : '',
  'Name_prefix'      : '',
  'Project_name'     : 'My Project',
  'Author_name'      : 'Bhishan Poudel',
  'Project_version'  : '1',
  'Project_release'  : '',
  'Project_language' : 'en',
  'Source_file'      : '.rst',
  'master_document'  : 'index',
  'epub'             : '',
  'autodoc'          : 'y',
  'doctest'          : 'y',
  'intersphinx'      : 'n',
  'todo'             : 'n',
  'coverage'         : 'n',
  'imgmath'          : 'n',
  'mathjax'          : 'n',
  'ifconfig'         : 'n',
  'viewcode'         : 'y',
  'githubpages'      : 'n',
  'Makefile'         : 'y',
  'Windows_Makefile ': 'n' }
  
  for k,v in sphinx_args.items():
      print(k,'\t\t:', v)
  
  
  subprocess.call('sphink-quickstart', shell=True)
  
  # I don't know how to caputre the outputs of shell commands!!
  </code></pre>
  
  <p>Help will be truly appreciated.</p>
  
  <p>Related links:  </p>