Example #1
0
    def install_kernel_spec(self):
        """
        Install the Jupyter kernel spec.

        .. NOTE::

            The files are generated, not copied. Therefore, we cannot
            use ``data_files`` for this.
        """
        from sage.repl.ipython_kernel.install import SageKernelSpec
        SageKernelSpec.update()
Example #2
0
    def install_kernel_spec(self):
        """
        Install the Jupyter kernel spec.

        .. NOTE::

            The files are generated, not copied. Therefore, we cannot
            use ``data_files`` for this.
        """
        from sage.repl.ipython_kernel.install import SageKernelSpec
        SageKernelSpec.update()
Example #3
0
    def install_kernel_spec(self):
        """
        Install the Jupyter kernel spec.

        .. NOTE::

            The files are generated, not copied. Therefore, we cannot
            use ``data_files`` for this.
        """
        from sage.repl.ipython_kernel.install import SageKernelSpec
        # Jupyter packages typically use the data_files option to
        # setup() to install kernels and nbextensions. So we should use
        # the install_data directory for installing our Jupyter files.
        SageKernelSpec.update(prefix=self.install_data)
Example #4
0
    def help_links(self):
        r"""
        Help in the Jupyter Notebook

        OUTPUT:

        See the Jupyter documentation.

        .. NOTE::

            Urls starting with "kernelspecs" are prepended by the
            browser with the appropriate path.

        EXAMPLES::

            sage: from sage.repl.ipython_kernel.kernel import SageKernel
            sage: sk = SageKernel.__new__(SageKernel)
            sage: sk.help_links
            [{'text': 'Sage Documentation',
              'url': 'kernelspecs/sagemath/doc/index.html'},
             ...]
        """
        from sage.repl.ipython_kernel.install import SageKernelSpec

        identifier = SageKernelSpec.identifier()
        kernel_url = lambda x: "kernelspecs/{0}/{1}".format(identifier, x)
        return [
            {"text": "Sage Documentation", "url": kernel_url("doc/index.html")},
            {"text": "Sage Tutorial", "url": kernel_url("doc/tutorial/index.html")},
            {"text": "Thematic Tutorials", "url": kernel_url("doc/thematic_tutorials/index.html")},
            {"text": "FAQs", "url": kernel_url("doc/faq/index.html")},
            {"text": "PREP Tutorials", "url": kernel_url("doc/prep/index.html")},
            {"text": "Sage Reference", "url": kernel_url("doc/reference/index.html")},
            {"text": "Developer's Guide", "url": kernel_url("doc/developer/index.html")},
            {"text": "Python", "url": "http://docs.python.org/%i.%i" % sys.version_info[:2]},
            {"text": "IPython", "url": "http://ipython.org/documentation.html"},
            {"text": "Singular", "url": "http://www.singular.uni-kl.de/Manual/latest/index.htm"},
            {"text": "GAP", "url": "http://gap-system.org/Manuals/doc/ref/chap0.html"},
            {"text": "NumPy", "url": "http://docs.scipy.org/doc/numpy/reference/"},
            {"text": "SciPy", "url": "http://docs.scipy.org/doc/scipy/reference/"},
            {"text": "SymPy", "url": "http://docs.sympy.org/latest/index.html"},
            {"text": "Matplotlib", "url": "http://matplotlib.org/contents.html"},
            {"text": "Markdown", "url": "http://help.github.com/articles/github-flavored-markdown"},
        ]
Example #5
0
    def help_links(self):
        r"""
        Help in the IPython Notebook
        
        OUTPUT:

        See the IPython documentation.

        EXAMPLES::

            sage: from sage.repl.ipython_kernel.kernel import SageKernel
            sage: sk = SageKernel.__new__(SageKernel)
            sage: sk.help_links
            [{'text': 'Sage Documentation',
              'url': '/kernelspecs/sage_.../doc/index.html'},
             ...]
        """
        from sage.repl.ipython_kernel.install import SageKernelSpec
        identifier = SageKernelSpec.identifier()
        kernel_url = lambda x: '/kernelspecs/{0}/{1}'.format(identifier, x)
        return [
            {
                'text': 'Sage Documentation',
                'url': kernel_url('doc/index.html')
            },
            {
                'text': 'Sage Tutorial',
                'url': kernel_url('doc/tutorial/index.html'),
            },
            {
                'text': 'Thematic Tutorials',
                'url': kernel_url('doc/thematic_tutorials/index.html'),
            },
            {
                'text': 'FAQs',
                'url': kernel_url('doc/faq/index.html'),
            },
            {
                'text': 'PREP Tutorials',
                'url': kernel_url('doc/prep/index.html'),
            },
            {
                'text': 'Sage Reference',
                'url': kernel_url('doc/reference/index.html'),
            },
            {
                'text': 'Developers Guide',
                'url': kernel_url('doc/developer/index.html'),
            },
            {
                'text': "Python",
                'url': "http://docs.python.org/%i.%i" % sys.version_info[:2],
            },
            {
                'text': "IPython",
                'url': "http://ipython.org/documentation.html",
            },
            {
                'text': 'Singular',
                'url': 'http://www.singular.uni-kl.de/Manual/latest/index.htm',
            },
            {
                'text': 'GAP',
                'url': 'http://gap-system.org/Manuals/doc/ref/chap0.html',
            },
            {
                'text': "NumPy",
                'url': "http://docs.scipy.org/doc/numpy/reference/",
            },
            {
                'text': "SciPy",
                'url': "http://docs.scipy.org/doc/scipy/reference/",
            },
            {
                'text': "SymPy",
                'url': 'http://docs.sympy.org/latest/index.html',
            },
            {
                'text': "Matplotlib",
                'url': "http://matplotlib.org/contents.html",
            },
            {
                'text': "Markdown",
                'url': "http://help.github.com/articles/github-flavored-markdown",
            },
        ]
Example #6
0
    def help_links(self):
        r"""
        Help in the Jupyter Notebook

        OUTPUT:

        See the Jupyter documentation.

        .. NOTE::

            Urls starting with "kernelspecs" are prepended by the
            browser with the appropriate path.

        EXAMPLES::

            sage: from sage.repl.ipython_kernel.kernel import SageKernel
            sage: sk = SageKernel.__new__(SageKernel)
            sage: sk.help_links
            [{'text': 'Sage Documentation',
              'url': 'kernelspecs/sagemath/doc/index.html'},
             ...]
        """
        from sage.repl.ipython_kernel.install import SageKernelSpec
        identifier = SageKernelSpec.identifier()
        kernel_url = lambda x: 'kernelspecs/{0}/{1}'.format(identifier, x)
        return [
            {
                'text': 'Sage Documentation',
                'url': kernel_url('doc/index.html'),
            },
            {
                'text': 'Sage Tutorial',
                'url': kernel_url('doc/tutorial/index.html'),
            },
            {
                'text': 'Thematic Tutorials',
                'url': kernel_url('doc/thematic_tutorials/index.html'),
            },
            {
                'text': 'FAQs',
                'url': kernel_url('doc/faq/index.html'),
            },
            {
                'text': 'PREP Tutorials',
                'url': kernel_url('doc/prep/index.html'),
            },
            {
                'text': 'Sage Reference',
                'url': kernel_url('doc/reference/index.html'),
            },
            {
                'text': "Developer's Guide",
                'url': kernel_url('doc/developer/index.html'),
            },
            {
                'text': "Python",
                'url': "http://docs.python.org/%i.%i" % sys.version_info[:2],
            },
            {
                'text': "IPython",
                'url': "http://ipython.org/documentation.html",
            },
            {
                'text': 'Singular',
                'url': 'http://www.singular.uni-kl.de/Manual/latest/index.htm',
            },
            {
                'text': 'GAP',
                'url': 'http://gap-system.org/Manuals/doc/ref/chap0.html',
            },
            {
                'text': "NumPy",
                'url': "http://docs.scipy.org/doc/numpy/reference/",
            },
            {
                'text': "SciPy",
                'url': "http://docs.scipy.org/doc/scipy/reference/",
            },
            {
                'text': "SymPy",
                'url': 'http://docs.sympy.org/latest/index.html',
            },
            {
                'text': "Matplotlib",
                'url': "https://matplotlib.org/contents.html",
            },
            {
                'text': "Markdown",
                'url': "http://help.github.com/articles/github-flavored-markdown",
            },
        ]
Example #7
0
 def install_kernel_spec(self):
     from sage.repl.ipython_kernel.install import SageKernelSpec
     SageKernelSpec.update()