Why does Visual Studio Code jupyter notebook outline (the table of content) show every single markdown block and how can I change it? - visual-studio-code

Below is a screenshot of what I mean. I'd like it to show only the headers of the notebook, not each and every single markdown block. Is there a similar way to changing this, like in JupyterLab, where you can toggle different outline options?

Related

Markdown: todo list not Showing in Jupyter Notebook Cell in VSCode

On the github.docs I saw that it is possible to create markdown todo-lists as follows
- [ ] my first task
- [ ] my second task
When I am trying this in VSCode in a .ipynb Markdown cell, it doesn't render the todo-list. So it basically does not show rendered square but rather shows it just as I typed it in. So it does show it as this
but not as this
I am using the Jupyter extension for VSCode.
I think it has to do something with this extension. However, rendering a table for example works. Also including pictures and basically any other Markdown command I tried. Only the todo-list does not.
Can anyone help with this?
According to this GitHub issue, VSCode does not support markdown todo-lists out of the box. However, you can use the Markdown Checkbox extension, which renders todo-lists in .ipynb Markdown cells.
For reference, this is what the result looks like.

Vscode .net interactive notebooks hide code when exporting to HTML

How do I hide the code cell when exporting .net interactive notebooks in visual studio code?
For instance,
I'd like to export the output, which is the latex display part of the example above,
while excluding the actual code cell from being exported.
I found this question for Jupyter notebook but I can't seem to make it work for vscode.
My best option, for now, is to export the whole file to HTML and then manually exclude the elements that are not needed.

Markdown headings not appearing in outline box in VS Code

While editing a markdown document in VS Code, the outline box does not show me the outline of the markdown document; it's completely blank/empty. I've disabled all extensions with no change in behavior (and I only had one markdown-related extension anyway, markdownlint). I don't know that this has ever worked, but it certainly has not for the last several months.
OS: Mac OS 12.3
VS Code: 1.65.2
Out of the box, Markdown headings should show up in the outline view as text nodes:
If the outline view is configured not to show strings, Markdown headers won't appear.
Take a look at the Outline: Show Strings setting in your preferences and make sure it's enabled.
This setting is called outline.showStrings. If you wish to enable it only for Markdown files, you should be able to disable the feature globally and then add something like this to your settings.json:
"[markdown]": {
"outline.showStrings": true
},
It's probably easiest to start by running Preferences: Configure Language Specific Settings... in the command palette and then selecting Markdown.

vscode: Is it possible to show an image inside a text buffer?

e.g. I write a markdown document and include a line like [myimage](/mypath.jpg) to see the image in a big size above or below this line.
When I'm writing markdown I regularly have to look at an embedded file. At the moment I have to use a split layout and switch my attention between the text buffer and the preview. That's slowing me down and distracting.
What I mean is a full size preview that can fill the whole width of the buffer and is permanently shown. This is offered by the emacs markdown-mode (see this image with a command named "markdown-toggle-inline-images".). This is also available in sublime text e.g. via an add-on named sublime_zk. This is possible in atom with add-ons like preview-inline or inline markdown images.
This would allow to use VSCode like a WYSIWYG md-editor like typora but with all the benefits of using your daily edtior. This should also be interesting for programmers - at least on hackernews typora is regularly praised as the best markdown editor (see e.g. here)
I didn't see an addon for this. Something related was discussed about two years ago in issue 7689 - but this only concerns a mini preview in the gutter or if you move the mouse over a link. For this there is already the add-on Image preview.
This is not possible as of VS Code 1.29. The VS Code api does not provide a way to insert custom elements like images into the editor.
The two closest existing APIs:
The code lens api: CodeLensProvider. These allow you to insert additional clickable commands into an editor (such as displaying a reference count above a function) but these can only be text buttons
The hover api: HoverProvider. Hovers can contain images since they display markdown content. However they are only displayed when the user hovers over them

how to make a single slide with markdown and code in ipython notebook?

In this tutorial presentation they use this, but, apparently, they don't show you how to do it.
http://www.damian.oquanta.info/posts/make-your-slides-with-ipython.html
Thanks,
I am sorry, I completely misunderstood your question.
If you mean embedding code which you do not execute, then you can use simple markdown syntax (similar to StackOverflow for example). To include inline code, just but it between backticks:
For example `a[::2]` selects every second element of the list `a`.
If you want to include a code block, either indent the whole block by 4 spaces, or put the block between 3 backticks (the latter also supports syntax highlighting if you specify the language):
a = foo()
b = bar(a)
or
```python
a = foo()
b = foo(a)
```
For more, see this markdown tutorial.
If you want to include executable cells and markdown on the same slide, then you need to put your code and markdown into different cells, and for slide type select slide for the topmost cell, and - for the subsequent cells that you want to have on the same slide. - means "do not start a new slide for this cell".
Old answer (how to convert a notebook to a reveal.js presentation)
You can convert your ipython notebook to a Reveal.js presentation using nbconvert.
First you have to specify the structure of the presentation. For that click on View -> Cell Toolbar -> Slideshow. Then at the top of every cell you can select whether you want it to be a new slide (horizontal direction), a subslide (vertical direction), a fragment (appear on the same slide with a fade-in) and some others.
Once you are set, you can use the nbconvert utility to transform your notebook into a presentation. The basic usage is
jupyter nbconvert example.ipynb --to slides
Then you get a HTML which you can serve up later using some web server.
If you want to show off your slides right away, jupyter provides a shortcut: you can do
jupyter nbconvert example.ipynb --to slides --post serve
Using this jupyter starts a local server after the conversion and opens the presentation in your default browser.
Last, if you want to easily share your presentation online, you can upload the notebook to some online repository (for example to github as a gist), and you can use nbviewer to share it. It will have a box-like icon in the top right corner. If you press it, it will change from notebook mode to presentation mode (I don't understand the box analogy either).
For more info please consult the jupyter documentation.