Ask Your Question
1

Displaying help in the browser

asked 2019-10-27 16:04:13 +0100

heluani gravatar image

updated 2019-10-27 18:29:19 +0100

while on the interactive shell, ss there anyway to see the outcome of ThisMethod?? displayed on a running browser instead of in the console?

EDIT: I am hoping to get the generated html from the source files. For example I would want to get file:///SAGEROOT/local/share/doc/sage/html/en/reference/algebras/sage/algebras/lie_algebras/lie_algebra.htmlas the output of LieAlgebra??

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-10-27 17:03:55 +0100

updated 2019-10-27 17:11:57 +0100

Use browse_sage_doc:

sage: R.<x> = QQ[]
sage: browse_sage_doc(R.base_ring)

For more help:

sage: browse_sage_doc(browse_sage_doc)

Edit: sorry, I misread your question. If you want the source code, not the just the help message, there is no guaranteed way. You could try this:

sage: from sage.misc.sagedoc import my_getsource
sage: view(my_getsource(R.base_ring))
edit flag offensive delete link more

Comments

Although this technically answers my question the result is generating a pdf that it's somehow worse than the console representation. I am hoping to get the html generated from the rst text in the source files. I should update my question

heluani gravatar imageheluani ( 2019-10-27 18:27:12 +0100 )edit

I now don't understand your question. If you use two question marks, Sage will want to give you the source code, but it looks like you don't want the source code, you want the output as if from a single question mark. In what way does browse_sage_doc(LieAlgebra) not do what you want?

John Palmieri gravatar imageJohn Palmieri ( 2019-10-27 19:08:35 +0100 )edit

You can also do reference() to open the reference manual in a browser, and then go to the page you want.

John Palmieri gravatar imageJohn Palmieri ( 2019-10-27 19:09:40 +0100 )edit

Thanks, indeed browse_sage_doc does open the page, albeit formated in a different way than the html itself in doc/en/reference/...

heluani gravatar imageheluani ( 2019-10-27 20:09:40 +0100 )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

1 follower

Stats

Asked: 2019-10-27 16:04:13 +0100

Seen: 272 times

Last updated: Oct 27 '19