Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Fix and test building documentation is possible without running all notebooks #420

Open
wants to merge 2 commits into
base: v0.x
Choose a base branch
from
Open
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
13 changes: 11 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,26 @@ stage("Unit Test") {
ws('workspace/gluon-nlp-docs') {
checkout scm
if (env.BRANCH_NAME.startsWith("PR-")) {
sh("ci/step_documentation.sh false")
sh("ci/step_documentation.sh false false")
bucket = 'gluon-nlp-staging'
path = env.BRANCH_NAME+'/'+env.BUILD_NUMBER
} else {
sh("ci/step_documentation.sh true")
sh("ci/step_documentation.sh false true")
bucket = 'gluon-nlp'
path = env.BRANCH_NAME
}
sh("ci/upload_doc.sh ${bucket} ${path}")
}
}
},
// Make sure documentation can be built without building notebooks
'Documentation (dev setup)': {
node {
ws('workspace/gluon-nlp-docs') {
checkout scm
sh("ci/step_documentation.sh true false")
}
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ lint:
make pylint
make restruc

dev_docs:
make -C docs html

docs: release
make -C docs doctest html SPHINXOPTS=-W
for f in $(shell find docs/examples -type f -name '*.md' -print) ; do \
Expand Down
16 changes: 10 additions & 6 deletions ci/step_documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ source ci/prepare_clean_env.sh doc
ci/install_dep.sh
export CUDA_VISIBLE_DEVICES=$EXECUTOR_NUMBER
make clean_doc
make docs

enforce_linkcheck=$1
if [[ $enforce_linkcheck == true ]]; then
make -C docs linkcheck SPHINXOPTS=-W
dev=$1
if [[ $dev == true ]]; then
make dev_docs
else
make -C docs linkcheck
make docs
enforce_linkcheck=$2
if [[ $enforce_linkcheck == true ]]; then
make -C docs linkcheck SPHINXOPTS=-W
else
make -C docs linkcheck
fi;
fi;
set +ex
2 changes: 1 addition & 1 deletion docs/examples/machine_translation/transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ print(sample_tgt_seq)
```

If you'd like to train your own transformer models, you may find the training scripts in our
[model zoo](../../model_zoo/machine_translation/index.rst).
[model zoo](../../../scripts/machine_translation/index.rst).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change we run into readthedocs/recommonmark#93

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is not valid for the CI build with publication /var/lib/jenkins/workspace/gluon-nlp-docs/docs/examples/machine_translation/transformer.ipynb.rst:link outside of source directory: '../scripts/machine_translation/index.rst'


## References

Expand Down