Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build sphinx docs for a single file #13679

Closed
jhpalmieri opened this issue Nov 2, 2012 · 20 comments
Closed

Build sphinx docs for a single file #13679

jhpalmieri opened this issue Nov 2, 2012 · 20 comments

Comments

@jhpalmieri
Copy link
Member

The patch here implements

sage --docbuild file=/path/to/foo.py TYPE

where TYPE may be any of the standard documentation types (e.g., html or pdf). This lets you build the docs for a file inside or outside the Sage library. It doesn't work for .sage or .pyx files right now, only .py files.

CC: @kcrisman @simon-king-jena @seblabbe @sagetrac-tjolivet @sagetrac-okazymyrov @videlec

Component: documentation

Keywords: Sphinx

Work Issues: Cython files, .sage files

Author: John Palmieri

Branch: a92dd08

Reviewer: Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/13679

@KPanComputes
Copy link

comment:2

ping: Hello!! There is a patch file here! So, does this code need review? :) Thanks!

@jhpalmieri
Copy link
Member Author

comment:3

Well, it doesn't work for .pyx files, and I think that should be fixed before it's ready for review. When I wrote the original patch, I didn't spend a lot of time working on it, so there are probably other flaws as well. You can certainly test it out and report the results here.

@simon-king-jena
Copy link
Member

comment:4

Attachment: trac_13679-single-file.patch.gz

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@jhpalmieri
Copy link
Member Author

New commits:

a0f7676Build documentation for a single Python file

@jhpalmieri
Copy link
Member Author

Changed work issues from Cython files to Cython files, .sage files

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member Author

Branch: u/jhpalmieri/sphinx-single-file

@jhpalmieri
Copy link
Member Author

Commit: a0f7676

@jhpalmieri
Copy link
Member Author

comment:11

It would be nice if this worked for .pyx or .sage files, but I think it could be reviewed as is, and merged if it's okay. Then later someone can add the functionality for .pyx or .sage files.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@videlec
Copy link
Contributor

videlec commented Jun 13, 2014

comment:13

cc me...

@videlec
Copy link
Contributor

videlec commented Jun 13, 2014

comment:14

Hi there,

The option does not appear within sage -docbuild --help but it should!

Another minor question: it is a bit annoying that the resulting file belongs to $HOME/.sage/docbuild/output/$NAME_OF_THE_FILE/output/html. Is it possible to do otherwise?

This is a really amazing gadget!

Vincent

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 25, 2014

Changed commit from a0f7676 to a92dd08

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 25, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

017dad0Merge branch 'u/jhpalmieri/sphinx-single-file' of git://trac.sagemath.org/sage into develop
a92dd08Sphinx single-file: more documentation, option to save output elsewhere

@jhpalmieri
Copy link
Member Author

comment:16

This option will now appear in the help message. Also, you can specify the flag -o DIR to write the output to DIR.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@vbraun
Copy link
Member

vbraun commented Oct 13, 2014

Reviewer: Volker Braun

@vbraun
Copy link
Member

vbraun commented Oct 14, 2014

Changed branch from u/jhpalmieri/sphinx-single-file to a92dd08

@nthiery
Copy link
Contributor

nthiery commented Oct 22, 2014

comment:20

I just discovered this gadget. Yeah! Finally! I have been dreaming of this for a while. Indeed, I write my course notes and work sheets in ReST, and my workflow to convert them to html is, err, painful.

I am just missing one feature: having it work on .rst files as well. Would it be hard?

Thanks!

@nthiery
Copy link
Contributor

nthiery commented Oct 22, 2014

Changed commit from a92dd08 to none

@kcrisman
Copy link
Member

comment:21

I am just missing one feature: having it work on .rst files as well. Would it be hard?

You could check out the documentation for sage -sws2rst where it tells how to convert the rst files to actual documentation using Sphinx; maybe that will give you an idea of how to do it easily with this (it's been a while since I looked at it).

@jhpalmieri
Copy link
Member Author

comment:22

sage -sws2txt is not a bad first draft for this. Maybe some modification of that script would do what you want. (It seems to produce html, not txt, despite the name. I guess that's consistent with its documentation.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants