publish depfun in separate files, split by code sections

2 views (last 30 days)
I have created a program that consists of several (100+) functions which are each called from one main routine file. I would like to create an html-based documentation in which the user can navigate through the functions by clicking on links of the called and the calling functions for each function, starting from the main routine file.
I am aware that there exists the function publishdepfun that should be possible to modify in order to obtain the desired result. Essentially, I will have to create separate output files (next to the appended full file), replace the in-document hyperlinks under ‘Called functions’ with full-path hyperlinks and add a section for calling functions. Additionally, it would be great if the called functions could be split along the sections of the calling function – I’ll try to illustrate:
The report for the main function would look like this (imagine the formatting of the documentation reports here, I don’t know how to generate these in the question tool):
mainRoutine
Calls all other routines
Calls:
  • Load
  • Compute
  • Save
Other comments…
Where load, compute and save are hyperlinks. Following the one of the links then should lead to the report page:
Load
Loads data from various data sources to workspace
Called in:
mainRoutine
Contents:
  • LoadRawData
  • Transform
LoadRawData:
Loads raw data from external sources
Calls:
  • loadDataSourceA
  • loadDataSourceB
Transform:
Transforms data formats from external sources to data format used in the program
Calls:
  • transformDataFromSourceA2DataFormatUsed
  • transformDataFromSourceB2DataFormatUsed
So the called functions are split by sections, instead of having two separate hierarchies like this (what the publishdepfun creates automatically):
Load
Loads data from various data sources to workspace
Called in:
  • mainRoutine
Contents:
  • LoadRawData
  • Transform
Calls:
  • loadDataSourceA
  • loadDataSourceB
  • transformDataFromSourceA2DataFormatUsed
  • transformDataFromSourceB2DataFormatUsed
_ LoadRawData:_
Loads raw data from external sources
_ Transform:_
Transforms data formats from external sources to data format used in the program
I do not know how to tackle the splitting by sections, so if you have any ideas I would be very grateful! Additionally, if you know a function similar to publishdepfun that creates the mentioned output (also without splitting by sections) this would be very much appreciated as it would save me the effort of modifying it.

Answers (1)

per isakson
per isakson on 2 Apr 2013
Edited: per isakson on 2 Apr 2013
  3 Comments
per isakson
per isakson on 3 Apr 2013
Edited: per isakson on 3 Apr 2013
Doc says: fopen [...]To open files in text mode, attach the letter 't' to the permission, such as 'rt' or 'wt+'. [...]
Christoph
Christoph on 3 Apr 2013
So true, I should have read the doc further - my bad! I fixed everything back, the routine does run nicely now. I'll see if I can use it or whether I'll just go and make an adapted version of publishdepfun...

Sign in to comment.

Categories

Find more on File Operations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!