Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ruamel.yaml instead of yaml to read the yaml config file #117

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ nbdev_mkdocs: $(SRC) $(PACKAGE_DATA) settings.ini Makefile

.PHONY: mypy
mypy: nbdev_mkdocs
mypy nbdev_mkdocs --ignore-missing-imports --install-types --non-interactive
mypy nbdev_mkdocs --ignore-missing-imports

.PHONY: sast
sast: .sast_bandit .sast_semgrep
Expand Down
2 changes: 1 addition & 1 deletion nbdev_mkdocs/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.3"
__version__ = "0.0.4rc0"
12 changes: 4 additions & 8 deletions nbdev_mkdocs/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

# %% ../nbs/Mkdocs.ipynb 1
from typing import *

import os
import re
import collections
Expand All @@ -22,18 +21,15 @@
import sys
import multiprocessing
import datetime
import yaml

import typer
import nbdev
from typer.testing import CliRunner

from configupdater import ConfigUpdater, Section
from configupdater.option import Option

from configparser import ConfigParser
from fastcore.script import call_parse

import nbdev
from ruamel.yaml import YAML
from nbdev.serve import proc_nbs
from nbdev.process import NBProcessor
from nbdev.frontmatter import FrontmatterProc
Expand Down Expand Up @@ -518,8 +514,8 @@ def _get_sidebar_from_config(file_path: Path) -> List[Union[str, Any]]:
raise typer.Exit(code=1)

try:
with open(file_path) as f:
config = yaml.safe_load(f)
yaml = YAML()
config = yaml.load(file_path)
sidebar = config["website"]["sidebar"]["contents"]
except KeyError as e:
typer.secho(
Expand Down
Loading