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.

Hide metadata header in markdown

See original GitHub issue

Is it possible, or would it be possible to hide the metedata header added when reading and writing to markdown?

For example, this is the header on one markdown document:

---
jupyter:
  jupytext:
    text_representation:
      extension: .md
      format_name: markdown
      format_version: '1.2'
      jupytext_version: 1.4.2
  kernelspec:
    display_name: Python 3
    language: python
    name: python3
---

Instead, it would be great if this could be put in an inline comment so that it isn’t visible when the document is rendered outside of jupyter.

(P.s. thank you very much for your work on this, it is a really excellent plugin you’ve built here 😄)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
mwoutscommented, Jul 31, 2020

Oh, I see! It is always a challenge to document how to use these options… Since hide_notebook_metadata is a format option, you need to use --opt, i.e.:

jupytext --to=md --opt hide_notebook_metadata=true -o- test.ipynb

If you want this for all the notebooks in a given repository, you can also create a .jupytext.toml file with this content:

hide_notebook_metadata=true
3reactions
mwoutscommented, Jul 20, 2020

I think a better approach would be to have the default as “shown” and let jupytext users flag that they want it hidden, rather than the reverse.

Thanks @choldgraf , that is probably much wiser than what I described in my previous comment 😄 I’ll do this way, then.

Github already has a pretty nice representation of them and VS Code previews (which uses markdown-it) already hides them

I was aware of the table-like representation of GitHub for the YAML header, but I had missed the VS Code preview… very nice indeed. Thanks @chrisjsewell

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove header YAML with sed from a markdown file
I have a text in markdown that I want to pass to HTML with pandoc and delete the header. This is the command:...
Read more >
11.7 Hide code, text output, messages, or plots - Bookdown
11.7 Hide code, text output, messages, or plots. By default, knitr displays all possible output from a code chunk, including the source code,...
Read more >
Hide or remove content - Jupyter Book
To hide Markdown, use the {toggle} directive. To hide or remove code cells or their outputs, use notebook cell tags. We'll cover each...
Read more >
A Guide for Writing Metadata Description with Markdown Editor
This guide shows how you can use it. Table of Contents. Basic Markdown formatting; Headers; Emphasis; Lists; Links; Images; Code
Read more >
Per-Document Settings - Marked 2
Marked metadata keys¶. Hiding metadata for other processors¶. Note: If you're using a custom processor or posting you Markdown directly to a source...
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