Ticket #7611: trac_7611-rest-notebook-object.patch

File trac_7611-rest-notebook-object.patch, 5.7 KB (added by timdumol, 12 years ago)

Adds a few code blocks, and marks variables as code.

  • sagenb/notebook/notebook_object.py

    #7611 Minor ReST improvements for the notebook object documentation.
    diff -r 311fdcd49eb1 -r 90edb5501ef6 sagenb/notebook/notebook_object.py
    a b  
    2828
    2929    INPUT:
    3030   
    31         - directory     -- directory that contains the Sage notebook files;
     31        - ``directory``     -- directory that contains the Sage notebook files;
    3232          the default is .sage/sage_notebook, in your home directory.
    33         - port          -- (default: 8000), port to serve the notebook on.
    34         - address       -- (default: 'localhost'), address of network
     33        - ``port``          -- (default: 8000), port to serve the notebook on.
     34        - ``address``       -- (default: 'localhost'), address of network
    3535          interface to listen on; give '' to listen on all interfaces.
    36         - port_tries    -- (default: 0), number of additional ports to try if
     36        - ``port_tries``    -- (default: 0), number of additional ports to try if
    3737          the first one doesn't work (*not* implemented).
    38         - secure        -- (default: False) if True use https so all
     38        - ``secure``        -- (default: False) if True use https so all
    3939          communication, e.g., logins and passwords, between
    4040          web browsers and the Sage notebook is encrypted
    4141          via GNU TLS.  *Highly recommended!*
    42         - require_login -- (default: True) if True login is required else web
     42        - ``require_login`` -- (default: True) if True login is required else web
    4343          user is automatically logged in as user admin.
    44         - reset         -- (default: False) if True allows you to set the
     44        - ``reset``         -- (default: False) if True allows you to set the
    4545          admin password.  Use this if you forget your admin
    4646          password.
    47         - accounts      -- (default: False) if True, any visitor to the
     47        - ``accounts``      -- (default: False) if True, any visitor to the
    4848          website will be able to create a new account.  If
    4949          False, only the admin can create accounts
    5050          (currently, this can only be done by running with
    5151          accounts=True for a few minutes, or on the command
    52           line with, e.g.,
     52          line with, e.g.,
     53
     54          ::
    5355
    5456              nb = load('./sage/sage_notebook/nb.sobj')
    55              
    5657              nb.set_accounts(True)
    57              
    5858              nb.add_user("username", "password", "email@place", "user")
    59              
    6059              nb.save()
    6160             
    62         - open_viewer   -- (default: True) whether to pop up a web browser.
     61        - ``open_viewer``   -- (default: True) whether to pop up a web browser.
    6362          You can override the default browser by setting the
    6463          SAGE_BROWSER environment variable, e.g., by putting
    6564              export SAGE_BROWSER="firefox"
    6665          in the file .bashrc in your home directory.
    67         - timeout       -- (default: 0) seconds until idle worksheet
     66        - ``timeout``       -- (default: 0) seconds until idle worksheet
    6867          sessions automatically timeout, i.e., the
    6968          corresponding Sage session terminates. 0 means
    7069          `never timeout'. If your server is running out
    7170          of memory, setting a timeout can be useful as
    7271          this will free the memory used by idle sessions.
    73         - server_pool   -- (default: None) list; this option specifies that
     72        - ``server_pool``   -- (default: None) list; this option specifies that
    7473          worksheet processes run as a separate user (chosen
    7574          from the list in the server_pool -- see below).
    7675                     
     
    8079   
    8180    EXAMPLES:
    8281
    83     1. I just want to run the Sage notebook.  Type
     82    1. I just want to run the Sage notebook.  Type::
    8483
    8584           notebook()
    8685
    8786    2. I want to run the Sage notebook server on a remote machine and be the
    88        only person allowed to log in.  Type
     87       only person allowed to log in.  Type::
    8988
    9089           notebook(address='', secure=True)
    9190
     
    9493       notebook.setup() again and change the hostname.
    9594
    9695    3. I just want to run the server locally on my laptop and do not want to
    97        be bothered with having to log in:
     96       be bothered with having to log in::
    9897 
    9998           notebook(require_login=False)
    10099
     
    106105       the world to create new accounts. To run the Sage notebook publicly
    107106       (1) at a minimum run it from a chroot jail or inside a virtual
    108107       machine (see wiki.sagemath.org/StartingTheNotebook and the Sage
    109        install guide) and (2) use a command like
     108       install guide) and (2) use a command like::
    110109   
    111110           notebook(address='', server_pool=['sage1@localhost'],
    112111           ulimit='-v 500000', accounts=True)
     
    133132    NOTE: The values of these two properties default to what they were last
    134133    time the notebook command was called.
    135134
    136         - server_pool -- (initial default: None), if given, should be a list
     135        - ``server_pool`` -- (initial default: None), if given, should be a list
    137136          like ['sage1@localhost', 'sage2@localhost'], where
    138137          you have setup ssh keys so that typing
    139138              ssh sage1@localhost
     
    147146          now, so if the machines are separate the server machine must
    148147          NSF export /tmp.
    149148
    150         - ulimit      -- (initial default: None -- leave as is), if given and
     149        - ``ulimit``      -- (initial default: None -- leave as is), if given and
    151150          server_pool is also given, the worksheet processes
    152151          are run with these constraints. See the ulimit
    153152          documentation. Common options include: