From 1ae4463fc901312a24bfd76bd6d2c7371f68e3d7 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Mon, 15 Aug 2022 16:20:22 -0600 Subject: [PATCH 1/2] Replace relative URLs with absolute URLs when publishing the contributors guide --- docs/.gitignore | 1 + docs/README.md | 24 +++++++++++++++++++----- docs/build.sh | 9 +++++++++ docs/source/contributor-guide/index.md | 4 ++-- 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100755 docs/build.sh diff --git a/docs/.gitignore b/docs/.gitignore index baf488338166..e1ba8440c124 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -16,4 +16,5 @@ # under the License. build +temp venv/ diff --git a/docs/README.md b/docs/README.md index d41d08c18207..cde904857f15 100644 --- a/docs/README.md +++ b/docs/README.md @@ -17,7 +17,11 @@ under the License. --> -# DataFusion docs +# DataFusion Documentation + +This folder contains the source content of the [User Guide](./source/user-guide) +and [Contributor Guide](./source/contributor-guide). These are both published to +https://arrow.apache.org/datafusion/ as part of the release process. ## Dependencies @@ -27,19 +31,29 @@ inside a Python virtualenv. - Python - `pip install -r requirements.txt` -## Build +## Build & Preview + +Run the provided script to build the HTML pages. + +```bash +./build.sh +``` + +The HTML will be generated into a `build` directory. + +Preview the site on Linux by running this command. ```bash -make html +firefox build/html/index.html ``` -## Release +## Release Process The documentation is served through the [arrow-site](https://github.com/apache/arrow-site/) repo. To release a new version of the docs, follow these steps: -1. Run `make html` inside `docs` folder to generate the docs website inside the `build/html` folder. +1. Run `./build.sh` inside `docs` folder to generate the docs website inside the `build/html` folder. 2. Clone the arrow-site repo 3. Checkout to the `asf-site` branch (NOT `master`) 4. Copy build artifacts into `arrow-site` repo's `datafusion` folder with a command such as diff --git a/docs/build.sh b/docs/build.sh new file mode 100755 index 000000000000..a6d8d747f2a9 --- /dev/null +++ b/docs/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e +rm -rf build 2> /dev/null +rm -rf temp 2> /dev/null +mkdir temp +cp -rf source/* temp/ +# replace relative URLs with absolute URLs +sed -i 's/\.\.\/\.\.\/\.\.\//https:\/\/github.com\/apache\/arrow-datafusion\/blob\/master\//g' temp/contributor-guide/index.md +make SOURCEDIR=`pwd`/temp html diff --git a/docs/source/contributor-guide/index.md b/docs/source/contributor-guide/index.md index c3c175496dff..748bc599f4a0 100644 --- a/docs/source/contributor-guide/index.md +++ b/docs/source/contributor-guide/index.md @@ -154,7 +154,7 @@ Criterion integrates with Cargo's built-in [benchmark support](https://doc.rust- cargo bench --bench BENCHMARK_NAME ``` -A full list of benchmarks can be found [here](./datafusion/benches). +A full list of benchmarks can be found [here](../../../datafusion/benches). _[cargo-criterion](https://github.com/bheisler/cargo-criterion) may also be used for more advanced reporting._ @@ -187,7 +187,7 @@ Below is a checklist of what you need to do to add a new scalar function to Data - [here](../../../datafusion/physical-expr/src/math_expressions.rs) for math functions - [here](../../../datafusion/physical-expr/src/datetime_expressions.rs) for datetime functions - create a new module [here](../../../datafusion/physical-expr/src) for other functions -- In [core/src/physical_plan](datafusion/core/src/physical_plan/functions.rs), add: +- In [core/src/physical_plan](../../../datafusion/core/src/physical_plan/functions.rs), add: - a new variant to `BuiltinScalarFunction` - a new entry to `FromStr` with the name of the function as called by SQL - a new line in `return_type` with the expected return type of the function, given an incoming type From fdc3430620a44d17df36785a651a4591aef91b0e Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Mon, 15 Aug 2022 16:23:16 -0600 Subject: [PATCH 2/2] add license --- docs/build.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/build.sh b/docs/build.sh index a6d8d747f2a9..1af99c3dc9cd 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -1,4 +1,23 @@ #!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + set -e rm -rf build 2> /dev/null rm -rf temp 2> /dev/null