Ask Your Question

Atomatic building of documentation for a custom library

asked 2012-10-31 10:36:59 +0200

Jesustc gravatar image

Hi there,

I have created a .sage file with functions of my own, and have documented every function following

Is there a way of generating automatically a pdf or html with the docstring of every function in the library, such as the ones in the sage documentation?

Or, more or less the same: can I use something like 'sage -docbuild' for a custom file (with standard doctrings)?


edit retag flag offensive close merge delete


Well, it *is* possible if you add your file to your Sage installation (presumably as a .py file?) and then add it to the list of things in the reference manual. But I think you mean as a separate file.

kcrisman gravatar imagekcrisman ( 2012-11-02 10:53:36 +0200 )edit

I do, thanks.

Jesustc gravatar imageJesustc ( 2012-11-02 11:57:02 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-11-01 13:32:07 +0200

I don't think this is possible now, but it's an interesting idea. I wonder how hard it would be to implement.

edit flag offensive delete link more


I wouldn't imagine it would be that hard, if we could just automate the sphinx quickstart thing to add the files and then do whatever magic extracts the function definitions in Sage's ReST format. I'd be very open to reviewing any work you do on that ;)

kcrisman gravatar imagekcrisman ( 2012-11-02 10:54:48 +0200 )edit

I've been playing with it for the last day. I may have something soon. One issue is to decide where to do the building; I think it makes most sense to do everything in the user's .sage directory.

John Palmieri gravatar imageJohn Palmieri ( 2012-11-02 11:17:36 +0200 )edit

Shame on me: Still, I would say it is not a perfect solution.

Jesustc gravatar imageJesustc ( 2012-11-02 11:44:08 +0200 )edit

I had a feeling, but was also too lazy... not perfect, but certainly doable.

kcrisman gravatar imagekcrisman ( 2012-11-02 13:47:18 +0200 )edit

See also This works for me with .py and .sage files, but not with .pyx files.

John Palmieri gravatar imageJohn Palmieri ( 2012-11-02 14:28:18 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2012-10-31 10:36:59 +0200

Seen: 362 times

Last updated: Nov 01 '12