#! /usr/bin/env python
# -*- Python -*-

####################################################################################################
# 
# PySpice - A Spice package for Python
# Copyright (C) 2014 Salvaire Fabrice
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
# 
####################################################################################################

####################################################################################################

import argparse

####################################################################################################

from ExampleRstFactory import ExampleRstFactory
    
####################################################################################################
#
# Options
#

argument_parser = argparse.ArgumentParser(description='Generate Examples RST files')

argument_parser.add_argument('--skip-figure',
                             action='store_true', default=False,
                             help="Don't generate figures")

argument_parser.add_argument('--skip-circuit-figure',
                             action='store_true', default=False,
                             help="Don't generate circuit figures")

argument_parser.add_argument('--force',
                             action='store_true', default=False,
                             help="Force the figure generation")

args = argument_parser.parse_args()

####################################################################################################

examples_path = 'examples'
rst_directory = 'doc/sphinx/source/examples'

rst_factory = ExampleRstFactory(examples_path, rst_directory)
rst_factory.process_recursively(make_figure=not args.skip_figure,
                                make_circuit_figure=not args.skip_circuit_figure,
                                force=args.force)

####################################################################################################
# 
# End
# 
####################################################################################################
