Skip to content

upgrade px to idiom #91

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

Merged
merged 9 commits into from
Jul 13, 2019
Merged
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
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
command: |
. venv/bin/activate
rm -f build/failures/*
echo ${mapbox_token} > .mapbox_token
mkdir -p build/ipynb
cd build/ipynb && ln -s ../../.mapbox_token && cd ../..
make -kj8 || make -kj8
if [ "${CIRCLE_BRANCH}" == "master" ]; then
cd build/html
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.ipynb
.ipynb_checkpoints
build
.mapbox_token
12 changes: 1 addition & 11 deletions eject.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,8 @@
if os.path.isfile(ipynb_path):
metadata, content = frontmatter.parse(open(html_path).read())
if "permalink" in metadata:
md_path = re.sub("python/(.*)/", "notebooks/\g<1>.md", metadata["permalink"])
if not os.path.isfile(md_path): continue
nb_fm = frontmatter.load(md_path)
print(md_path)
if "v4upgrade" in nb_fm["jupyter"]["plotly"]:
metadata["v4upgrade"] = True
nb_fm["jupyter"]["plotly"] = metadata
frontmatter.dump(nb_fm, md_path)

continue
try:
md_path = re.sub("python/(.*)/", "eject/\g<1>.md", metadata["permalink"])
md_path = re.sub("matplotlib/(.*)/", "eject/\g<1>.md", metadata["permalink"])
jt.writef(jt.readf(ipynb_path), md_path, fmt=".md")
nb_fm = frontmatter.load(md_path)
nb_fm["jupyter"]["plotly"] = metadata
Expand Down
Loading