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

Provide some links to the notebooks in the docs pages #84

Merged
merged 2 commits into from
Sep 16, 2020
Merged
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
16 changes: 12 additions & 4 deletions website/build_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ $pythonCmd -m pip install jupyter nbconvert==5.6.1
# execute and render the notebooks to html
# downgrade html output because hugo doesn't like raw html
mkdir -p content/notebooks
# Restricted set of notebooks that are rendered for inclusion on the webpage:
notebooks='BayesianOptimization SmartCacheOptimization'
for nb in $notebooks; do
nb_path="$MLOS_ROOT/source/Mlos.Notebooks/$nb.ipynb"
Expand All @@ -50,6 +51,17 @@ for f in content/notebooks/*.md; do
sed -i "s/FILENAME/$base/g" "$f"
done

# Provide
cat > content/notebooks/_index.md <<HERE
# MLOS Sample Notebooks

HERE
for nb in $notebooks; do
cat >> content/notebooks/_index.md <<HERE
- [${nb}](./${nb}.md)
HERE
done

# Make some top level files available in the site.
cp ../LICENSE.txt content/
# Make all *.md files from the repo available in the content tree using the same layout.
Expand Down Expand Up @@ -96,10 +108,6 @@ for content_filepath in $(find content/ -type f -name '*.md'); do
parent_path="${parent_path}/"
fi

echo "content_filepath: $content_filepath"
echo "base_filepath: $base_filepath"
echo "parent_path: $parent_path"

# 1. replace a special fake anchor with a link to the main github repo site
# (this allows browsing back to the main published source from the website)
# 2. convert relative paths to be relative to the website root instead
Expand Down