Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Apr 1, 2020
1 parent e848ae7 commit 18288f6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
18 changes: 14 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,20 @@ To install `myst-nb`, do the following:
]
```

```{note}
If you'd like to use MyST to parse markdown files as well, then you can enable it by
adding `myst_parser` to your list of extensions as well.
```
By default, MyST-NB will parse both markdown (`.md`) and notebooks (`.ipynb`).
You can also change which files are parsed by MyST-NB using
the [source_suffix](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-source_suffix)
option in your `conf.py`, e.g.:

```python
extensions = ["myst_nb"]
source_suffix = {
'.rst': 'restructuredtext',
'.ipynb': 'myst-nb',
'.myst': 'myst-nb',
}
```

* Write Jupyter Notebooks with your built documentation, and remember to include them
in your `toctree`, and that's it!

Expand Down
5 changes: 4 additions & 1 deletion myst_nb/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def is_myst_notebook(line_iter):
break
yaml_lines.append(line.rstrip() + "\n")

front_matter = yaml.safe_load("".join(yaml_lines))
try:
front_matter = yaml.safe_load("".join(yaml_lines))
except Exception:
return False
if (
front_matter.get("jupytext", {})
.get("text_representation", {})
Expand Down

0 comments on commit 18288f6

Please sign in to comment.