Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to hide _some_ commands in published m-files?
Date: Fri, 10 Oct 2008 08:49:17 +0000 (UTC)
Organization: Pierburg GmbH
Lines: 28
Message-ID: <gcn4ud$7r4$1@fred.mathworks.com>
References: <gcl429$pco$1@fred.mathworks.com> <gcl95d$1bd$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1223628557 8036 172.30.248.37 (10 Oct 2008 08:49:17 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 10 Oct 2008 08:49:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 872224
Xref: news.mathworks.com comp.soft-sys.matlab:494526


"Steven Lord" <slord@mathworks.com> wrote in message <gcl95d$1bd$1@fred.mathworks.com>...
> 
> "Andres " <rantore@werb.deNoRs> wrote in message 
> news:gcl429$pco$1@fred.mathworks.com...
> > Hi,
> >
> > is there any kind of switch to hide a specific command in a published 
> > m-file? [..] 
> There may be a more sophisticated way to do this, but one easy way is to 
> write a short script file and call that script file instead of DISP:
> [..]

Thanks for your idea, Steve. I'd then have to write a script or function for any kind of code I want to hide, but it would definitely make the published file look a bit better. 

Maybe the only 'more sophisticated' method would be to post-process the html-file, i.e.

- add a keyword comment to each line of code to hide, like '% *hide*'
- write a function publishAndHide.m that publishes the m-file, looks for the keyword in the source part of the published file (after '##### SOURCE BEGIN #####'), and finally removes the corresponding lines in the html-part ...

Humph, i'll think about if it's worth the effort. 
Does anybody know if the part of html-code containing one line of matlab-code could possibly span over more than a single line (wrapping,...?)? If not, finding the html-code to delete should be quite easy by directly searching the html lines (but there might be other pitfalls).
Any further thoughts about this are appreciated.

(Btw, just now I found a similar thread
http://www.mathworks.com/matlabcentral/newsreader/view_thread/174366#449320 )

Regards
Andres