Documenting our software: Difference between revisions

From BanghamLab
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
[[Software|Return to Software]]<br><br>
[[Software|Return to Software]]<br><br>
==Maintaining colours when copying Matlab code into the wiki==
==Maintaining colours when copying Matlab code into the wiki==
The simplest is to use  
To produce a wiki page such as [[Full freshly minted interaction function|this]]. The simplest is to use  
  webify_interaction_function(filename)
  webify_interaction_function(filename)
from the DArT_Toolshed. Change directory into the project then call the function. It will put an HTML copy of the function into the same directory which can be copied and pasted directly into the wiki. (Note - in the wiki, indented text is rendered verbatim, e.g. the function name above.)
from the DArT_Toolshed. Change directory into the project then call the function. It will put an HTML copy of the function into the same directory which can be copied and pasted directly into the wiki. (Note - in the wiki, indented text is rendered verbatim, e.g. the function name above.)


==Finding toolbox dependencies and collecting everything a toolbox needs into a single directory==
==Finding toolbox dependencies and collecting everything a toolbox needs into a single directory==
This provides a way of distributing a toolbox without providing access to the entire ''DArT_Toolshed'' by finding all the dependencies of a toolbox and copying any that are not actually in the toolbox directory into a folder within the toolbox directory.<br><br>
Use
Use
  myDepFun(mfile,toolboxDirectory)
  myDepFun(mfile,toolboxDirectory)
which is in the ''DArT_Toolshed\ToolBag''. ''myDepFun'' recursively (slowly) finds all the'' .m'' files on which ''mfile'' depends. Those that are not in the'' toolboxDirectory'' will be copied into a subdirectory of ''toolboxDirectory'' so that a zipfile of the whole directory will include all the files needed by the toolbox. (CARE: if the mfile depends on a Matlab class library, i.e. directory name begins with @, then the class library must be copied intact beforehand - read the help on ''myDepFun''.)
which is in the ''DArT_Toolshed\ToolBag''. ''myDepFun'' recursively (slowly) finds all the'' .m'' files on which ''mfile'' depends. Those that are not in the'' toolboxDirectory'' will be copied into a subdirectory of ''toolboxDirectory'' so that a zipfile of '' toolboxDirectory'' will include all the files needed by the toolbox. (CARE: if the ''mfile'' depends on a Matlab class library, i.e. directory name that begins with @, then the class library must be copied intact beforehand - read the help on ''myDepFun''.)
  myDepFun('AAMToolbox','ShapeModelToolbox');
  myDepFun('AAMToolbox','ShapeModelToolbox');
took 50 minutes to assemble the files into the current directory
took 50 minutes to assemble the files into the current directory

Latest revision as of 21:39, 28 October 2012

Return to Software

Maintaining colours when copying Matlab code into the wiki

To produce a wiki page such as this. The simplest is to use

webify_interaction_function(filename)

from the DArT_Toolshed. Change directory into the project then call the function. It will put an HTML copy of the function into the same directory which can be copied and pasted directly into the wiki. (Note - in the wiki, indented text is rendered verbatim, e.g. the function name above.)

Finding toolbox dependencies and collecting everything a toolbox needs into a single directory

This provides a way of distributing a toolbox without providing access to the entire DArT_Toolshed by finding all the dependencies of a toolbox and copying any that are not actually in the toolbox directory into a folder within the toolbox directory.

Use

myDepFun(mfile,toolboxDirectory)

which is in the DArT_Toolshed\ToolBag. myDepFun recursively (slowly) finds all the .m files on which mfile depends. Those that are not in the toolboxDirectory will be copied into a subdirectory of toolboxDirectory so that a zipfile of toolboxDirectory will include all the files needed by the toolbox. (CARE: if the mfile depends on a Matlab class library, i.e. directory name that begins with @, then the class library must be copied intact beforehand - read the help on myDepFun.)

myDepFun('AAMToolbox','ShapeModelToolbox');

took 50 minutes to assemble the files into the current directory