-
Notifications
You must be signed in to change notification settings - Fork 113
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
Generate docs for the oak_abi
crate
#1042
Conversation
@daviddrysdale Could you please have a look? I am not very good at bash scripts. |
Updates `check_docs` and `build_gh_pages` scripts to also check and generate docs for `oak_abi`, now that it is a separate crate.
scripts/build_gh_pages
Outdated
@@ -12,7 +12,7 @@ readonly SCRIPTS_DIR="$(dirname "$0")" | |||
# shellcheck source=scripts/common | |||
source "$SCRIPTS_DIR/common" | |||
|
|||
readonly TARGET_DIR="${1:-}" | |||
readonly TARGET_DIR="$(cd "${1:-}" && pwd)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what this is doing? Why does it need to cd
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had used that to get the absolute path to TARGET_DIR
. Changed it to realpath
.
scripts/build_gh_pages
Outdated
|
||
# Remove non-doc artifacts from the target dir. | ||
rm --recursive --force "${TARGET_DIR}/debug" | ||
paths=("." "oak_abi" "oak_utils") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these readonly
too? Could you add some comments? I guess they are meant to be kept in sync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Done.
Yes, they should be in sync. I could not find a nice way to do this.
scripts/build_gh_pages
Outdated
|
||
# Remove non-deterministic files. | ||
rm "${TARGET_DIR}/.rustc_info.json" | ||
for i in {0..2}; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is meant to iterate over the entries above, so perhaps make it clearer, e.g. ${#paths[@]}
instead of hardcoding 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks.
scripts/build_gh_pages
Outdated
for i in {0..2}; do | ||
cd "${CURRENT_DIR}" | ||
target="${TARGET_DIR}/${names[$i]}" | ||
mkdir -p target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir --parent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
scripts/build_gh_pages
Outdated
for i in {0..2}; do | ||
cd "${CURRENT_DIR}" | ||
target="${TARGET_DIR}/${names[$i]}" | ||
mkdir -p target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is target
meant to be taken literally here? or did you mean $target
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think any of us are very good at bash scripts, hence #396 :-)
</body> | ||
</html> | ||
END | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens to the top-level /index.html
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we now have separate crates, I thought a top-level /index.html
would not be needed (in crate.io
these would be independent crates).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a top-level /index.html
so that visiting https://project-oak.github.io/oak/ goes somewhere helpful. At the moment I think this will hit a left-over redirect file that redirects to /doc/oak/index.html
which won't exist after this PR.
So we could either pick one of the sub-directories to auto-redirect to, or have a page that gives a choice of manual links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a top-level index, perhaps we don't need the other index files. Should I remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say keep them, so that accidentally landing at (say) https://project-oak.github.io/oak/oak_abi doesn't 404 (assuming that's what would happen otherwise). But either way is fine by me.
scripts/build_gh_pages
Outdated
<p><a href="./doc/oak/index.html">Oak SDK main page</a></p> | ||
</body> | ||
</html> | ||
# Absolut path to the target directory, to make sure that docs are generated into the correct directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Absolut/Absolute/. Unless we've driven you to drink :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😀
</body> | ||
</html> | ||
END | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a top-level /index.html
so that visiting https://project-oak.github.io/oak/ goes somewhere helpful. At the moment I think this will hit a left-over redirect file that redirects to /doc/oak/index.html
which won't exist after this PR.
So we could either pick one of the sub-directories to auto-redirect to, or have a page that gives a choice of manual links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR does not remove the docs for oak_glue
because it is still a member of the workspace. But I have tested, and removing oak_glue
from the members list in Cargo.toml
does remove the docs (I did not make that change here, since it is done in #1036). I noticed that the tests and the examples work fine without oak_glue
. Is the plan to remove it entirely?
This PR does not remove the unnecessary documentation for examples either. That is fixed in #1045.
scripts/build_gh_pages
Outdated
<p><a href="./doc/oak/index.html">Oak SDK main page</a></p> | ||
</body> | ||
</html> | ||
# Absolut path to the target directory, to make sure that docs are generated into the correct directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😀
</body> | ||
</html> | ||
END | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a top-level index, perhaps we don't need the other index files. Should I remove them?
</body> | ||
</html> | ||
END | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say keep them, so that accidentally landing at (say) https://project-oak.github.io/oak/oak_abi doesn't 404 (assuming that's what would happen otherwise). But either way is fine by me.
Reproducibility Index:
Reproducibility Index diff: |
Updates
check_docs
andbuild_gh_docs
scripts to also check and generate docsfor
oak_abi
, now that it is a separate crate.Creates the following hierarchy under the given
TARGET_DIR
:Ref #1037
Checklist
cover any TODOs and/or unfinished work.
construction.