Skip to content
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
9 changes: 5 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,19 @@ jobs:
echo ${mapbox_token} > csharp/.mapbox_token
make
if [ "${CIRCLE_BRANCH}" == "main" ]; then
cd build/html
cd build
git init
git config user.name plotlydocbot
git config user.email accounts@plot.ly
git add *
git add csharp/*.html
git add fsharp/*.html
git commit -m "build of https://github.com/plotly/plotly.net-docs/commit/${CIRCLE_SHA1}"
git push --force git@github.com:plotly/plotly.net-docs.git master:built
rm -rf .git
cd ../..
fi
tar -zcf build/html.tgz build/html
rm -rf build/html
tar -zcf build.tgz build
rm -rf build
- store_artifacts:
path: build
destination: build
Expand Down
79 changes: 0 additions & 79 deletions Makefile

This file was deleted.

79 changes: 79 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
export PLOTLY_RENDERER=notebook_connected

MD_DIR_FSharp ?= fsharp
UNCONV_DIR_FSharp ?= unconverted/fsharp
IPYNB_DIR_FSharp ?= build/fsharp/ipynb
HTML_DIR_FSharp ?= build/fsharp
FAIL_DIR_FSharp ?= build/fsharp/failures

MD_FILES_FSharp := $(shell ls $(MD_DIR_FSharp)/*.md)
UNCONV_FILES_FSharp := $(shell ls $(UNCONV_DIR_FSharp)/*.md)

IPYNB_FILES_FSharp := $(patsubst $(MD_DIR_FSharp)/%.md,$(IPYNB_DIR_FSharp)/%.ipynb,$(MD_FILES_FSharp))
HTML_FILES_FSharp := $(patsubst $(MD_DIR_FSharp)/%.md,$(HTML_DIR_FSharp)/2019-07-03-%.html,$(MD_FILES_FSharp))


all: $(HTML_FILES_FSharp)

.PRECIOUS: $(IPYNB_FILES_FSharp)

$(IPYNB_DIR_FSharp)/.mapbox_token: $(MD_DIR_FSharp)/.mapbox_token
@mkdir -p $(IPYNB_DIR_FSharp)
@echo "[symlink] .mapbox_token"
@cd $(IPYNB_DIR_FSharp) && ln -s ../../$<

$(IPYNB_FILES_FSharp): $(IPYNB_DIR_FSharp)/.mapbox_token

$(IPYNB_DIR_FSharp)/%.ipynb: $(MD_DIR_FSharp)/%.md
@mkdir -p $(IPYNB_DIR_FSharp)
@echo "[jupytext] $<"
@cat $< what_about_dash.md | jupytext --to notebook --quiet --output $@

$(HTML_DIR_FSharp)/2019-07-03-%.html: $(IPYNB_DIR_FSharp)/%.ipynb
@mkdir -p $(HTML_DIR_FSharp)
@mkdir -p $(FAIL_DIR_FSharp)
@echo "[nbconvert] $<"
@jupyter nbconvert $< --to html --template nb.tpl \
--ExecutePreprocessor.timeout=600\
--output-dir $(HTML_DIR_FSharp) --output 2019-07-03-$*.html \
--execute > $(FAIL_DIR_FSharp)/$* 2>&1 && rm -f $(FAIL_DIR_FSharp)/$*



MD_DIR_CSharp ?= csharp
UNCONV_DIR_CSharp ?= unconverted/csharp
IPYNB_DIR_CSharp ?= build/csharp/ipynb
HTML_DIR_CSharp ?= build/csharp
FAIL_DIR_CSharp ?= build/csharp/failures

MD_FILES_CSharp := $(shell ls $(MD_DIR_CSharp)/*.md)
UNCONV_FILES_CSharp := $(shell ls $(UNCONV_DIR_CSharp)/*.md)

IPYNB_FILES_CSharp := $(patsubst $(MD_DIR_CSharp)/%.md,$(IPYNB_DIR_CSharp)/%.ipynb,$(MD_FILES_CSharp))
HTML_FILES_CSharp := $(patsubst $(MD_DIR_CSharp)/%.md,$(HTML_DIR_CSharp)/2019-08-03-%.html,$(MD_FILES_CSharp))


all: $(HTML_FILES_CSharp)

.PRECIOUS: $(IPYNB_FILES_CSharp)

$(IPYNB_DIR_CSharp)/.mapbox_token: $(MD_DIR_CSharp)/.mapbox_token
@mkdir -p $(IPYNB_DIR_CSharp)
@echo "[symlink] .mapbox_token"
@cd $(IPYNB_DIR_CSharp) && ln -s ../../$<

$(IPYNB_FILES_CSharp): $(IPYNB_DIR_CSharp)/.mapbox_token

$(IPYNB_DIR_CSharp)/%.ipynb: $(MD_DIR_CSharp)/%.md
@mkdir -p $(IPYNB_DIR_CSharp)
@echo "[jupytext] $<"
@cat $< what_about_dash.md | jupytext --to notebook --quiet --output $@

$(HTML_DIR_CSharp)/2019-08-03-%.html: $(IPYNB_DIR_CSharp)/%.ipynb
@mkdir -p $(HTML_DIR_CSharp)
@mkdir -p $(FAIL_DIR_CSharp)
@echo "[nbconvert] $<"
@jupyter nbconvert $< --to html --template nb.tpl \
--ExecutePreprocessor.timeout=600\
--output-dir $(HTML_DIR_CSharp) --output 2019-08-03-$*.html \
--execute > $(FAIL_DIR_CSharp)/$* 2>&1 && rm -f $(FAIL_DIR_CSharp)/$*