function opt=defPublishOpt(type,file)
% defPublishOpt <creates default publish options structure>
% Usage:: opt=defPublishOpt(type['html'],filename|[false])
%

% revision history:
% 05/05/20 Mark D. Shattuck <mds> defPublishOpt.m

%% Parse Input
if(~exist('type','var') || isempty(type))
	type='html';
end

if(~exist('file','var') || isempty(file))
	isfile=false;
else
  isfile=true;
  if(file==false)
    isfile=false;
  end
end

type=lower(type);

%% Main

opt.format=type;

opt.evalCode=true;
opt.useNewFigure=false;
opt.showCode=true;
opt.stylesheet=[];

opt.createThumbnail=true;
opt.figureSnapMethod='entireGUIWindow';

if(isfile)
opt.codeToEvaluate=sprintf('%s\n',...
  '% Modify expression to add input arguments.',...
  '% Example:',...
  '%   a = [1 2 3; 4 5 6];',... 
  '%   foo(a);',...
  file);
end

switch type 
  case 'html'
  case 'pdf'
    opt.outputDir='.';
  case 'latex'
  case 'ppt'
  case 'doc'
  case 'xml'
  otherwise
    opt=false;
    fprintf('Invalid type: ');
    disp(type);
end

