question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I noticed that when I pair a notebook with a sagemath kernel with a markdown file, code blocks are not converted to code cells. Here is a minimal example:

---
jupyter:
  jupytext:
    formats: ipynb,md
    text_representation:
      extension: .md
      format_name: markdown
      format_version: '1.2'
      jupytext_version: 1.9.1
  kernelspec:
    display_name: SageMath 9.2
    language: sage
    name: sagemath
---

```sage
print("Hello world")
```

After converting with jupytext --to ipynb exmplae.md the code block ends up in a markdown cell. With a python kernel and a python code block the conversion works as expected, resulting in a code cell.

The documentation states that

Code snippets are turned into code cells in Jupyter as soon as they have an explicit language, when that language is supported in Jupyter.

But sage is supported by Jupyter. Maybe what is meant here is that the language must be supported by Jupytext? Since sage is not listed under supported languages. I would be grateful for a clarification.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
frclcommented, Feb 5, 2021

Works fine. Thank you very much! This is a huge improvement for me.

1reaction
frclcommented, Feb 4, 2021

Well, sage is just a thin wrapper around python with some snytaxtic sugar added with a preparser and lots of libraries. In general sage code will not execute when called directly with python, so the ambiguous extension .py may cause some confusion. It is relatively simple to convert the sage script to a python script, but converting back may be problematic.

The language_info is in fact equivalent in all my sage notebooks, except for version numbers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contact Technical Support | Sage US
Looking for scheduled maintenance or outage information for online products? Check the Sage Status site. Support Central. Learn. Solve. Inquire.
Read more >
SAGE | Support
Uh-oh, still not finding the answers you're looking for? No worries! Create a support ticket for quick, personal assistance from a SAGE support...
Read more >
Technical Support | SAGE Publications Inc
For SAGE textbook-related support including online instructor resources, please visit https://sagepub.softwareassist.com or call (800) 818-7243 ext. 7080 during ...
Read more >
Sage Customer Portal: Home
Welcome to the Sage Customer Portal ... maintain your credit card information; create and manage support cases; connect to the knowledgebase and community....
Read more >
Official Sage Central Patient Support | Sage Therapeutics, Inc ...
Learn more about Sage Central Patient Support - Find patient support programs and resources for your Sage Therapeutics, Inc. medication.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found