Skip to content

Commit f635012

Browse files
committed
Merge remote-tracking branch 'upstream/master' into merge2main
# Conflicts: # _config.yml
2 parents 418dce2 + 8e73670 commit f635012

38 files changed

+79
-22086
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@
66
path = pysqlflow
77
url = https://github.com/sql-machine-learning/pysqlflow
88
branch = develop
9+
[submodule "gohive"]
10+
path = gohive
11+
url = https://github.com/sql-machine-learning/gohive
12+
branch = develop

README.md

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
## sqlflow.org
1+
## SQLFlow.org
22

3-
This repo holds the content of the Web site http://sql-machine-learning.github.io, of which, https://sqlflow.org is an alias.
3+
This repository holds the content of [SQLFlow.org](https://sql-machine-learning.github.io/). We rely on the [Github Pages](https://pages.github.com/) to convert Markdown files in this repo into HTML files. Github pages calls the converter [Jekyll](https://jekyllrb.com/docs/) , which churns through layout and other decorations. In addition, we use Jekyll to call [Just-the-Doc](https://pmarsceill.github.io/just-the-docs/) to generate the corresponding documents.
44

5-
We rely on the [Github Pages](https://pages.github.com/) service to convert Markdown files in this repo into HTML files. Github Pages calls the converter [Jekyll](https://jekyllrb.com/docs/) , which churns through layout and other decorations. Besides, we configure Jekyll to call [Just-the-Doc](https://pmarsceill.github.io/just-the-docs/) for document generation.
6-
7-
## How to Contribute
8-
9-
When we make any change to this repo, we can run Jekyll locally to create a Web site for a quick preview of our change. If everything looks good, we can git-push our change to our fork repository, say, https://github.com/somebody/sql-machine-learning, and create a pull request. Reviewers could browse to https://somebody.github.io/sql-machine-learning.github.io/ for a preview.
10-
11-
## Walkthrough the Repository
5+
## Repo Walkthrough
126

137
We see the following files and directories at the root of this repository:
148

@@ -19,31 +13,37 @@ We see the following files and directories at the root of this repository:
1913
- `doc_index` holds template files of categories of documents generated by Jekyll and Just-the-Doc.
2014
- `gohive`, `gomaxcompute`, `pysqlflow`, `sqlflow` are git-submodules to other repositories in the same organization. Jekyll and Just-the-Doc convert Markdown files in these git-submodules and listed in `/_config.yml` into the documentation. Also, `index.html` files in these subdirectories redirect URLs like https://sqlflow.org/gohive to https://github.com/sql-machine-learning/gohive
2115

16+
## Instructions for serving a local SQLFlow website
2217

23-
## Build and Serve Locally
18+
To run SQLFlow website we need to install Jekyll and its dependencies. However, there are different versions of Jekyll, making it hard to reproduce runtime errors. Therefore, we recommend using dockerized Jekyll, which includes a specifici version (3.8) of Jekyll and the dependencies in the image. Note for Mac users, please install [Docker for Desktop](https://hub.docker.com/editions/community/docker-ce-desktop-mac); other tools like Docker Toolbox cannot expose Jekyll port in the local host.
2419

25-
To build the Web site locally, we may choose to install Jekyll. However, poeple might install different versions of Jekyll and dependencies, and it could be difficult to reproduce Web site build errors. So, we recommend running official Docker images of Jekyll, which includes a specified version of Jekyll and all its dependencies. The following command runs Jekyll 3.8 locally to build and serve the Web site.
20+
**Step One**: Clone SQLFlow repo to your local machine. For potential contributors, please fork the repo and then make a clone.
2621

2722
```bash
2823
git clone https://github.com/sql-machine-learning/sql-machine-learning.github.io
24+
```
25+
26+
**Step Two**: Update markdown files. Most of the document markdown files and redirect `index.html` files can be found in the adjacent repos like SQLFlow, GoHive, PySQLFlow. To include them into the website, we create git submodules like `/sqlflow` then point them to the right repo. If you are going through the instruction for the first time, please use below command to include the markdown files before running Jekyll serve. Whenever there are updates to markdown file in other repo, please run the command again without --init to update the content. Otherwise, the updated content won't show up.
27+
28+
```bash
29+
git submodule update --init --recursive --remote
30+
```
31+
32+
**Step Three**: Fire up docker run under the repo root. Note the command will pull the image from the remote automatically. Also, make sure to replace `b90ffea2` with your personal access token. It takes a few seconds to generate the token by following [this document](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line). Now you can access SQLFlow.org from http://localhost:4000 with exact the same content.
33+
34+
```bash
2935
cd sql-machine-learning.github.io
3036
docker run --rm -it \
31-
-v $PWD:/srv/kyll \
37+
-v $PWD:/srv/jekyll \
3238
-e JEKYLL_GITHUB_TOKEN=b90ffea2 \
3339
-p 4000:4000 \
3440
jekyll/jekyll:3.8 \
35-
jekyll serve
41+
jekyll serve --incremental
3642
```
3743

38-
Please make sure to replace `b90ffea2` by your Github personal access token. It takes you a few seconds to create one by following [this document](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line).
44+
## Jekyll Pages, Documents, and Redirects
3945

40-
For macOS users, please install [Docker for Desktop](https://hub.docker.com/editions/community/docker-ce-desktop-mac); other implementations like Docker Toolbox cannot expose Jekyll port to your macOS host.
41-
42-
Now, browse to http://localhost:4000 for the Web site.
43-
44-
## Pages, Documents, and Redirects
45-
46-
The generated Web site serves the following kinds of content.
46+
The generated website serves the four kinds of contents below:
4747

4848
1. Jekyll [Pages](https://jekyllrb.com/docs/pages/).
4949

@@ -67,39 +67,33 @@ The generated Web site serves the following kinds of content.
6767

6868
Jekyll allows document authors to specify the layout template by adding a [front matter](https://jekyllrb.com/docs/front-matter/) in their document Markdown files. However, most document authors are developers who don't know anything about the front matter and follow the plain Markdown syntax. So, in `/_config.yml` we write the following snippet
6969

70-
```yaml
71-
# in _config.yml, using defaults to set default value of md files
72-
defaults:
73-
- scope:
74-
path: "sqlflow"
75-
values:
76-
layout: "doc"
77-
nav_exclude: true # hide all files from nav
78-
grand_parent: Document
79-
```
70+
```yaml
71+
# in _config.yml, using defaults to set default value of md files
72+
defaults:
73+
- scope:
74+
path: "sqlflow"
75+
values:
76+
layout: "doc"
77+
nav_exclude: true # hide all files from nav
78+
grand_parent: Document
79+
```
8080

81-
where `layout: doc"` specifies the default layout template file to be `/_layouts/doc.md`.
81+
where `layout: doc"` specifies the default layout template file to be `/_layouts/doc.md`.
8282

83-
Another essential role of `/_config.yml` is to pick some Markdown files as document page source files.
83+
Another essential role of `/_config.yml` is to pick some Markdown files as document page source files.
8484

8585

8686
1. The Navigation Bar
8787

8888
In `_data/navigation.yml`, we define the navigation bar on the homepage. Currently, there are three links there. If we want more than three, we would need to edit the style of `_layout/index.html`.
8989

9090

91-
## Git-submodules
92-
93-
Most of the document Markdown files and redirect `index.html` files are in repositories like https://github.com/sql-machine-learning/sqlflow. To interleave them into this Web site, we create git-submodules like `/sqlflow` pointing to the repository. After editing files in these repositories, please remember to update the git-submodules to point to the most recent version.
94-
95-
```bash
96-
git submodule update --init --recursive --remote
97-
```
91+
## How to Contribute
9892

93+
When we make change to this repo, we can run Jekyll locally to create a Web site for a quick preview of our change. If everything looks good, we can git-push our change to our fork repository, say, https://github.com/somebody/sql-machine-learning, and create a pull request. Reviewers could go to https://somebody.github.io/sql-machine-learning.github.io/ for a preview. (To enable the preview of your fork, you need to change the settings of your fork as described [here](https://github.com/sql-machine-learning/sql-machine-learning.github.io/issues/46)).
9994

100-
## Troubleshooting
95+
## Trouble Shooting
10196

10297
- Jekyll liquid syntax error
10398

10499
Jekyll allows Markdown file authors to use the liquid braces `{{}}` to specify the front matter. To avoid ambiguity, when we write double curly braces in our Markdown files, we must wrap them up into `{% raw %}` and `{% endraw %}` or we can try just don't use double curly braces.
105-

_config.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,18 @@ exclude: ['*.sql', '*.go', '.gitignore', '*.sh', '*.proto', '*.y']
1717
# baseurl: "/sql-machine-learning.github.io/"
1818

1919
defaults:
20-
- scope:
21-
path: "pysqlflow"
22-
values:
23-
layout: doc
24-
parent: Pysqlflow
2520
- scope:
2621
path: "sqlflow"
2722
values:
2823
layout: "doc"
2924
nav_exclude: true
25+
grand_parent: SQLFlow
3026
prefix: '/sqlflow/'
31-
grand_parent: Documents
3227
- scope:
3328
path: "sqlflow/doc/installation.md"
3429
values:
3530
nav_exclude: false
36-
parent: Documents
31+
parent: SQLFlow
3732
nav_order: 1
3833
- scope:
3934
path: "sqlflow/doc/syntax.md"
@@ -85,6 +80,21 @@ defaults:
8580
values:
8681
nav_exclude: false
8782
parent: Contribute
83+
- scope:
84+
path: "pysqlflow/doc/desigin/client_design_doc.md"
85+
values:
86+
nav_exclude: false
87+
parent: PySQLFlow
88+
- scope:
89+
path: "pysqlflow/doc/desigin/magic_design_doc.md"
90+
values:
91+
nav_exclude: false
92+
parent: PySQLFlow
93+
- scope:
94+
path: "gohive"
95+
values:
96+
layout: doc
97+
parent: GoHive
8898

8999

90100
footer:

_data/navigation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ main:
22
- title: "Installation"
33
url: sqlflow/doc/installation
44
- title: "Documents"
5-
url: doc_index/doc
5+
url: doc_index/sqlflow
66
- title: "GitHub"
77
url: https://github.com/sql-machine-learning

carousel.css

Lines changed: 0 additions & 91 deletions
This file was deleted.

dist/carousel.css

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)