Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Updated Docusaurus config to fix Javadocs CSS bug (#3546)
Browse files Browse the repository at this point in the history
* Updated Docusaurus config to ignore Javadocs CSS

* Refactored and updated gitignore rules

* Website build script cleanup
  • Loading branch information
nicknezis committed Jun 25, 2020
1 parent 9377b10 commit 8057559
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 34 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,7 @@ atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml

# generated for the website
website/node_modules/
website/public/

website2/website/public
website2/website/static/api
website2/website/venv/
generated-site/

# Visual Studio Code
.vscode
Expand Down
6 changes: 5 additions & 1 deletion website2/.gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
.DS_Store

node_modules
website/node_modules

lib/core/metadata.js
lib/core/MetadataBlog.js

website/public/
website/static/api/
website/venv/
website/translated_docs
website/build/
website/yarn.lock
website/node_modules
website/i18n/*
website/scripts/bazelrc
10 changes: 7 additions & 3 deletions website2/website/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.PHONY : start javadocs python-docs buildsite publish clean

start:
yarn start

Expand All @@ -7,10 +9,12 @@ javadocs:
python-docs:
@scripts/python-doc-gen.sh 0.0.0

buildsite:
@scripts/javadocs.sh
@scripts/python-doc-gen.sh 0.0.0
buildsite: javadocs python-docs
@scripts/build-site.sh

publish:
@scripts/publish_site.sh

clean:
rm -rf static/api/*
rm -rf build/*
11 changes: 2 additions & 9 deletions website2/website/scripts/build-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,7 @@ npm run-script build

node ./scripts/replace.js

rm -rf ${ROOT_DIR}/generated-site/content
mkdir -p ${ROOT_DIR}/generated-site/content/api/java
mkdir -p ${ROOT_DIR}/generated-site/content/api/python
## copy generated site
rm -rf ${ROOT_DIR}/generated-site/content/*
mkdir -p ${ROOT_DIR}/generated-site/content/
cp -R build/incubator-heron/* ${ROOT_DIR}/generated-site/content
## copy java docs
cp -R ${ROOT_DIR}/website2/website/public/api/java/* ${ROOT_DIR}/generated-site/content/api/java/
## copy pydocs
cp -R ${ROOT_DIR}/website2/website/static/api/python/* ${ROOT_DIR}/generated-site/content/api/python/
## remove bazelrc for dockerfile
rm ${ROOT_DIR}/website2/website/scripts/bazelrc
16 changes: 1 addition & 15 deletions website2/website/scripts/javadocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ JAVADOC=javadoc
FLAGS="-quiet -Xdoclint:none"

HERON_ROOT_DIR=$(git rev-parse --show-toplevel)
# for display on GitHub website
JAVADOC_OUTPUT_DIR=$HERON_ROOT_DIR/website2/website/public/api/java
# for display on local Hugo server
JAVADOC_OUTPUT_LOCAL_DIR=$HERON_ROOT_DIR/website2/website/static/api
JAVADOC_OUTPUT_DIR=$HERON_ROOT_DIR/website2/website/static/api/java
GEN_PROTO_DIR=$HERON_ROOT_DIR/bazel-bin/heron/proto/_javac

# The path of the customized landing page for the Javadocs
Expand Down Expand Up @@ -66,16 +63,5 @@ $JAVADOC $FLAGS \
-overview $OVERVIEW_HTML_FILE \
-d $JAVADOC_OUTPUT_DIR $GEN_FILES $HERON_SRC_FILES $BACKTYPE_SRC_FILES $APACHE_SRC_FILES || true

# Generated Java API doc needs to be copied to $JAVADOC_OUTPUT_LOCAL_DIR
# for the following two reasons:
# 1. When one is developing website locally, They should
# be able to click into API doc link and view API doc to
# check if the correct API link is given.
# 2. ``wget`` needs to verify if links to Java API doc are valid when we are
# serving the website locally. This means that Hugo should be able to display
# Java API doc properly.

cp -r $JAVADOC_OUTPUT_DIR $JAVADOC_OUTPUT_LOCAL_DIR
echo "Javadocs generated at $JAVADOC_OUTPUT_DIR"
echo "Javadocs copied to: $JAVADOC_OUTPUT_LOCAL_DIR"
exit 0
11 changes: 11 additions & 0 deletions website2/website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ const siteConfig = {
theme: 'default',
},

// Ignores CSS files found in the static folder.
// Any CSS files not listed here will be added to the Docusaurus main.css
separateCss: [
`${baseUrl}static/css/custom.css`,
`${baseUrl}static/api/java/jquery/jquery-ui.css`,
`${baseUrl}static/api/java/jquery/jquery-ui.min.css`,
`${baseUrl}static/api/java/jquery/jquery-ui.structure.min.css`,
`${baseUrl}static/api/java/jquery/jquery-ui.structure.css`,
`${baseUrl}static/api/java/stylesheet.css`,
],

// Add custom scripts here that would be placed in <script> tags.
scripts: [
'https://buttons.github.io/buttons.js',
Expand Down

0 comments on commit 8057559

Please sign in to comment.