Ticket #3733: sagenb-3733.patch

File sagenb-3733.patch, 10.4 KB (added by was, 12 years ago)
  • sagenb/notebook/notebook_object.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1258673133 28800
    # Node ID 268af5f5dbd4e83e078b383e093802b54ec93fcd
    # Parent  698c4163e276db4da2d1073251dc23cc684fdcb5
    trac 3733 -- document notebook.css; I also sphinxified the notebook? docstring
    
    diff -r 698c4163e276 -r 268af5f5dbd4 sagenb/notebook/notebook_object.py
    a b  
    2727chapter, and at http://wiki.sagemath.org/StartingTheNotebook.
    2828
    2929    INPUT:
    30         directory     -- directory that contains the Sage notebook files;
    31                          the default is .sage/sage_notebook, in your home
    32                          directory.
    33         port          -- (default: 8000), port to serve the notebook on.
    34         address       -- (default: 'localhost'), address of network
    35                          interface to listen on; give '' to listen on all
    36                          interfaces.
    37         port_tries    -- (default: 0), number of additional ports to try if
    38                          the first one doesn't work (*not* implemented).
    39         secure        -- (default: False) if True use https so all
    40                          communication, e.g., logins and passwords, between
    41                          web browsers and the Sage notebook is encrypted
    42                          via GNU TLS.  *Highly recommended!*
    43         require_login -- (default: True) if True login is required else web
    44                          user is automatically logged in as user admin.
    45         reset         -- (default: False) if True allows you to set the
    46                          admin password.  Use this if you forget your admin
    47                          password.
    48         accounts      -- (default: False) if True, any visitor to the
    49                          website will be able to create a new account.  If
    50                          False, only the admin can create accounts
    51                          (currently, this can only be done by running with
    52                          accounts=True for a few minutes, or on the command
    53                          line with, e.g.,
    54                              nb = load('./sage/sage_notebook/nb.sobj')
    55                              nb.set_accounts(True)
    56                              nb.add_user("username", "password",
    57                                  "email@place", "user")
    58                              nb.save()
    59         open_viewer   -- (default: True) whether to pop up a web browser.
    60                          You can override the default browser by setting the
    61                          SAGE_BROWSER environment variable, e.g., by putting
    62                              export SAGE_BROWSER="firefox"
    63                          in the file .bashrc in your home directory.
    64         timeout       -- (default: 0) seconds until idle worksheet
    65                          sessions automatically timeout, i.e., the
    66                          corresponding Sage session terminates. 0 means
    67                          `never timeout'. If your server is running out
    68                          of memory, setting a timeout can be useful as
    69                          this will free the memory used by idle
    70                          sessions.
    71         server_pool   -- (default: None) list; this option specifies that
    72                          worksheet processes run as a separate user (chosen
    73                          from the list in the server_pool -- see below).
     30   
     31        - directory     -- directory that contains the Sage notebook files;
     32          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
     35          interface to listen on; give '' to listen on all interfaces.
     36        - port_tries    -- (default: 0), number of additional ports to try if
     37          the first one doesn't work (*not* implemented).
     38        - secure        -- (default: False) if True use https so all
     39          communication, e.g., logins and passwords, between
     40          web browsers and the Sage notebook is encrypted
     41          via GNU TLS.  *Highly recommended!*
     42        - require_login -- (default: True) if True login is required else web
     43          user is automatically logged in as user admin.
     44        - reset         -- (default: False) if True allows you to set the
     45          admin password.  Use this if you forget your admin
     46          password.
     47        - accounts      -- (default: False) if True, any visitor to the
     48          website will be able to create a new account.  If
     49          False, only the admin can create accounts
     50          (currently, this can only be done by running with
     51          accounts=True for a few minutes, or on the command
     52          line with, e.g.,
     53
     54              nb = load('./sage/sage_notebook/nb.sobj')
     55             
     56              nb.set_accounts(True)
     57             
     58              nb.add_user("username", "password", "email@place", "user")
     59             
     60              nb.save()
     61             
     62        - open_viewer   -- (default: True) whether to pop up a web browser.
     63          You can override the default browser by setting the
     64          SAGE_BROWSER environment variable, e.g., by putting
     65              export SAGE_BROWSER="firefox"
     66          in the file .bashrc in your home directory.
     67        - timeout       -- (default: 0) seconds until idle worksheet
     68          sessions automatically timeout, i.e., the
     69          corresponding Sage session terminates. 0 means
     70          `never timeout'. If your server is running out
     71          of memory, setting a timeout can be useful as
     72          this will free the memory used by idle sessions.
     73        - server_pool   -- (default: None) list; this option specifies that
     74          worksheet processes run as a separate user (chosen
     75          from the list in the server_pool -- see below).
    7476                     
    75     \begin{verbatim}
    7677
    7778    NOTE: If you have problems with the server certificate hostname not
    7879    matching, do \code{notebook.setup()}.
     
    132133    NOTE: The values of these two properties default to what they were last
    133134    time the notebook command was called.
    134135
    135         server_pool -- (initial default: None), if given, should be a list
    136                        like ['sage1@localhost', 'sage2@localhost'], where
    137                        you have setup ssh keys so that typing
    138                            ssh sage1@localhost
    139                        logs in without requiring a password, e.g., by typing
    140                        `ssh-keygen' as the notebook server user, then
    141                        putting ~/.ssh/id_rsa.pub as the file
    142                        .ssh/authorized_keys. Note: you have to get the
    143                        permissions of files and directories just right --
    144                        see the above wiki page for more details.
     136        - server_pool -- (initial default: None), if given, should be a list
     137          like ['sage1@localhost', 'sage2@localhost'], where
     138          you have setup ssh keys so that typing
     139              ssh sage1@localhost
     140          logs in without requiring a password, e.g., by typing
     141          `ssh-keygen' as the notebook server user, then
     142          putting ~/.ssh/id_rsa.pub as the file
     143          .ssh/authorized_keys. Note: you have to get the
     144          permissions of files and directories just right --
     145          see the above wiki page for more details.  Also, every user
     146          in the serverpool must share the same /tmp/ directory right
     147          now, so if the machines are separate the server machine must
     148          NSF export /tmp.
    145149
    146         ulimit      -- (initial default: None -- leave as is), if given and
    147                        server_pool is also given, the worksheet processes
    148                        are run with these constraints. See the ulimit
    149                        documentation. Common options include:
    150                            -t   The maximum amount of cpu time in seconds.
    151                                 NOTE: For Sage, -t is the wall time, not cpu time.
    152                            -u   The maximum number of processes available to
    153                                 a single user.
    154                            -v   The maximum amount of virtual memory
    155                                 available to the process.
    156                        Values are in 1024-byte increments, except for `-t',
    157                        which is in seconds, and `-u' which is a positive
    158                        integer. Example:  ulimit="-v 400000 -t 30"
    159     \end{verbatim}
     150        - ulimit      -- (initial default: None -- leave as is), if given and
     151          server_pool is also given, the worksheet processes
     152          are run with these constraints. See the ulimit
     153          documentation. Common options include:
     154
     155              - ``-t``   The maximum amount of cpu time in seconds.
     156                NOTE: For Sage, -t is the wall time, not cpu time.
     157               
     158              - ``-u``   The maximum number of processes available to a single user.
     159             
     160              - ``-v``   The maximum amount of virtual memory available to the process.
     161
     162          Values are in 1024-byte increments, except for `-t',
     163          which is in seconds, and `-u' which is a positive
     164          integer. Example:  ulimit="-v 400000 -t 30"
     165
     166    OTHER NOTES:
     167   
     168       - If you create a file ``$DOT_SAGE/notebook.css`` then it will
     169         get applied when rendering the notebook HTML.  This allows
     170         notebook administrators to customize the look of the
     171         notebook.  Note that by default ``$DOT_SAGE`` is
     172         ``$HOME/.sage``.
    160173    """
    161174    def __call__(self, *args, **kwds):
    162175        return self.notebook(*args, **kwds)
  • sagenb/notebook/tutorial.py

    diff -r 698c4163e276 -r 268af5f5dbd4 sagenb/notebook/tutorial.py
    a b  
    424424       'Use "save obj1 obj2 ..." and "load obj1 obj2 ...".  This allows for easy moving of objects from one worksheet to another, and saving of objects for later use.'),
    425425      ('Loading and Saving Sessions',
    426426       'Use "save_session(\'name\')" to save all variables to an object.  Use "load_session(\'name\')" to <i>merge</i> in all variables from a saved session.'),
     427      ('Customizing the Notebook CSS',
     428       'If you create a file <tt>$HOME/.sage/notebook.css</tt> then it will get applied when rendering the notebook.   See ')
    427429    ])
    428430    ]