help-octave
[Top][All Lists]

## Re: Extract docstrings from my functions

 From: Johan Ekh Subject: Re: Extract docstrings from my functions Date: Wed, 29 May 2013 11:21:13 +0000

Hi all,
sorry for bringing this up again, but I still don't quite understand how to do
this. I will rephrase my question slightly.

Let's say I'm working on a project that involves writing a number of octave
functions. Together they make up a useful tool that I want to package
and distribute to several users. I prefer to use docstrings in my functions to
document the function and I want to automatically extract those and insert them
into a manual to their respective section. But I also want to add other
sections in the manual, i.e. theory, installing instructions, user guide etc.
I'd like to develop the manual in parallel to developing the code so I need an
efficient way of repeatedly extract the docstrings and build the manual.

What are the preferred tools and workflow for doing this?

BR / Johan

On Dec 28, 2012, at 4:10 PM, Ben Abbott <address@hidden> wrote:

> *** PLEASE DON'T TOP-POST ***
> *** REPLY AT THE BOTTOM, SO LATE ARRIVALS CAN FOLLOW ALONG ***
>
> On Dec 28, 2012, at 5:17 AM, Johan Ekh wrote:
>
>> On Fri, Dec 28, 2012 at 5:58 AM, c. <address@hidden> wrote:
>>
>>> On 28 Dec 2012, at 01:14, Johan Ekh wrote:
>>>
>>>> Hi all,
>>>> How can I extract my texinfo docstrings from all my functions and create a
>>>> pdf manual?
>>>> I've never used texinfo before, so please be gentle.
>>>>
>>>> Best regards,
>>>> Johan
>>>
>>> Some time ago I started working on a package which is meant to do this:
>>>
>>> http://sourceforge.net/p/octave/code/11522/tree/trunk/octave-forge/extra/generate_latex/
>>>
>>> it is not finished yet, so producing a working LaTeX document might still
>>> require some manual
>>> adjustments, but I think it mitght serve as a good starting point.
>>>
>>> Notice that texinfo can produce TeX output but not proper LaTeX, so what I
>>> did was to include
>>> the docstrings as text inside a \verbatim environment and manage the
>>> indexing separately.
>>>
>>> HTH,
>>> c.
>>
>> Thanks!
>>
>> But I still wonder how everyone is doing it today? E.g. how are the
>> docstrings in the functions distributed with octave
>> used to create info and pdf documentation?
>>
>> Best regards,
>> Johan
>
> Converting texinfo to pdf ...
>
>
> http://www.gnu.org/software/texinfo/manual/texinfo/html_node/PDF-Output.html
>
> From Octave you can extract the texinfo help text with
>
>       help get_help_text_from_file
>
> Ben
>
>
> _______________________________________________
> Help-octave mailing list