Ask Your Question
3

Atomatic building of documentation for a custom library

asked 2012-10-31 04:36:59 -0600

Jesustc gravatar image

Hi there,

I have created a .sage file with functions of my own, and have documented every function following http://www.sagemath.org/doc/developer...

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)?

Cheers!

edit retag flag offensive close merge delete

Comments

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 04:53:36 -0600 )edit

I do, thanks.

Jesustc gravatar imageJesustc ( 2012-11-02 05:57:02 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-11-01 07:32:07 -0600

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

Comments

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 04:54:48 -0600 )edit
1

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 05:17:36 -0600 )edit
1

Shame on me: http://ask.sagemath.org/question/432/using-sphinx-to-document-a-module-using-sage. Still, I would say it is not a perfect solution.

Jesustc gravatar imageJesustc ( 2012-11-02 05:44:08 -0600 )edit

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

kcrisman gravatar imagekcrisman ( 2012-11-02 07:47:18 -0600 )edit
2

See also http://trac.sagemath.org/sage_trac/ticket/13679. This works for me with .py and .sage files, but not with .pyx files.

John Palmieri gravatar imageJohn Palmieri ( 2012-11-02 08:28:18 -0600 )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

2 followers

Stats

Asked: 2012-10-31 04:36:59 -0600

Seen: 133 times

Last updated: Nov 01 '12