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

[#492] feat(doc): Document website framework #512

Merged
merged 5 commits into from
Oct 17, 2023
Merged

[#492] feat(doc): Document website framework #512

merged 5 commits into from
Oct 17, 2023

Conversation

xunliu
Copy link
Member

@xunliu xunliu commented Oct 14, 2023

What changes were proposed in this pull request?

Add launch document website script into docs/launch-docs-website.sh

  • You can execute ./launch-docs-website.sh command to launch the docs website your locally, and you can open http://localhost:1313/ to visit.
  • If you add or modify any documents in the docs directory, you need execute ./launch-docs-website.sh update to update document website.

Why are the changes needed?

We are considering using hugo to generate the Graviton project document framework.

  • hugo is a popular tool for Documentation Sites, an Active community with better functionality.
  • gohugo is an Apache 2.0 license, After Gravtion to open source, no modifications are needed.

Fix: #492

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

N/A

@xunliu xunliu requested a review from jerryshao October 14, 2023 03:47
@github-actions
Copy link

github-actions bot commented Oct 14, 2023

Code Coverage Report

Overall Project 62.16% 🟢

There is no coverage information present for the Files changed

@xunliu xunliu requested a review from yuqi1129 October 14, 2023 07:29
@xunliu
Copy link
Member Author

xunliu commented Oct 14, 2023

hi @yuqi1129 @jerryshao , Please help me review this PR, Thanks!


OS=$(uname -s)
if [ "$OS" != "Darwin" ]; then
echo "Currently only support macOS. In the future we can support other OS."
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the means it can only build on Darwin or deploy on Darwin?

fi

if [ ! -d "${bin}/build/hugo" ]; then
tar -xzf "${bin}/build/${HUGO_PACKAGE_NAME}" -C "${bin}/build"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to remove the tar file after it's depressed?

docs/README.md Outdated

## Launch Graviton document website

Execute `./launch-docs-website.sh` scripts, It will create the Graviton document website in locally, It follows these steps:
Copy link
Contributor

Choose a reason for hiding this comment

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

website in locally ---> website locally, It will --> it will and the same for It follows

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

docs/README.md Outdated

## Add or modify a document

To add a new document to the Graviton website, follow these steps:
Copy link
Contributor

Choose a reason for hiding this comment

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

We should(need to) follow these steps:

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

docs/README.md Outdated

To add a new document to the Graviton website, follow these steps:

1. Create a new markdown file in the `docs` directory any directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

in the docs directory any directory, it may have syntax errors.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

docs/README.md Outdated
To add a new document to the Graviton website, follow these steps:

1. Create a new markdown file in the `docs` directory any directory.
2. In the markdown file, include the following header at the beginning, because `Hugo` use it create website link list.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can say:
For markdown files, we should include the following header at the beginning because...

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

if [[ "$1" == "update" ]]; then
copy_docs
else
launch_website
Copy link
Contributor

Choose a reason for hiding this comment

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

What will happen if we execute ./launch-docs-website.sh a_random_value?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

fi

if [ ! -f "${bin}/build/${HUGO_PACKAGE_NAME}" ]; then
wget -q -P "${bin}/build" ${HUGO_DOWNLOAD_URL}
Copy link
Contributor

Choose a reason for hiding this comment

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

wget is not install in macOs by default, you'd better using curl or others.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to curl -L command to download.


# Setting the Hugo theme
cd ${bin}/build/web
git clone https://github.com/datastratolabs/gohugo-theme-ananke.git themes/ananke
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this "datastratolabs", did you create a group to store this them file? I'm not sure what's the purpose of it, can you explain more?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. I have changed the width of the post page of this theme from 60% to 100%.
  2. Also I'm worried about this theme being deleted
  3. So I clone this repo to datastratolabs for safekeeping.

@jerryshao
Copy link
Contributor

@xunliu please take a review my changes.

@@ -71,11 +71,11 @@ function launch_website() {
fi

if [ ! -d "${bin}/build/hugo" ]; then
Copy link
Member Author

@xunliu xunliu Oct 17, 2023

Choose a reason for hiding this comment

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

I think, That's the way it should be.

  if [ ! -f "${bin}/build/hugo" ]; then
    if [ ! -f "${bin}/build/${HUGO_PACKAGE_NAME}" ]; then
      wget -q -P "${bin}/build" ${HUGO_DOWNLOAD_URL}
    fi
    tar -xzf "${bin}/build/${HUGO_PACKAGE_NAME}" -C "${bin}/build"
  fi

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a big deal, I think we can improve the script later on.

@xunliu
Copy link
Member Author

xunliu commented Oct 17, 2023

@jerryshao Thank you for helping me improve this PR.
LGTM

@jerryshao jerryshao merged commit 821a805 into apache:main Oct 17, 2023
2 checks passed
jerryshao added a commit that referenced this pull request Oct 26, 2023
### What changes were proposed in this pull request?

Add launch document website script into `docs/launch-docs-website.sh`
+ You can execute `./launch-docs-website.sh` command to launch the docs
website your locally, and you can open `http://localhost:1313/` to
visit.
+ If you add or modify any documents in the docs directory, you need
execute `./launch-docs-website.sh update` to update document website.

### Why are the changes needed?

We are considering using hugo to generate the Graviton project document
framework.
+ [hugo](https://github.com/gohugoio/hugo) is a popular tool for
Documentation Sites, an Active community with better functionality.
+ gohugo is an Apache 2.0 license, After Gravtion to open source, no
modifications are needed.

Fix: #492 

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

N/A

---------

Co-authored-by: Jerry Shao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Subtask] Document website framework
3 participants