This is an automated email from the ASF dual-hosted git repository. xuanwo pushed a commit to branch polish-website in repository https://gitbox.apache.org/repos/asf/opendal.git
commit 3f0e9f3f927e0ff27a34e0ce8059fbdee0fe2c2e Author: Xuanwo <[email protected]> AuthorDate: Mon Mar 10 17:43:08 2025 +0800 website(refactor): Use project readme in website directly Signed-off-by: Xuanwo <[email protected]> --- bindings/c/README.md | 2 +- core/README.md | 4 +- website/components/GitHubReadme.js | 105 +++++++++++++ website/docs/01-overview.md | 10 ++ website/docs/{vision.md => 02-vision.md} | 1 - website/docs/10-core.mdx | 11 ++ website/docs/20-bindings/_category_.yml | 6 + website/docs/20-bindings/c.mdx | 10 ++ website/docs/20-bindings/cpp.mdx | 10 ++ website/docs/20-bindings/d.mdx | 10 ++ website/docs/20-bindings/dart.mdx | 10 ++ website/docs/20-bindings/dotnet.mdx | 10 ++ website/docs/20-bindings/go.mdx | 10 ++ website/docs/20-bindings/haskell.mdx | 10 ++ website/docs/20-bindings/java.mdx | 10 ++ website/docs/20-bindings/lua.mdx | 10 ++ website/docs/20-bindings/nodejs.mdx | 10 ++ website/docs/20-bindings/ocaml.mdx | 10 ++ website/docs/20-bindings/php.mdx | 10 ++ website/docs/20-bindings/python.mdx | 10 ++ website/docs/20-bindings/ruby.mdx | 10 ++ website/docs/20-bindings/swift.mdx | 10 ++ website/docs/20-bindings/zig.mdx | 10 ++ website/docs/30-integrations/_category_.yml | 6 + website/docs/30-integrations/cloud_filter.mdx | 10 ++ website/docs/30-integrations/dav_server.mdx | 10 ++ website/docs/30-integrations/fuse3.mdx | 10 ++ website/docs/30-integrations/object_store.mdx | 10 ++ website/docs/30-integrations/parquet.mdx | 10 ++ website/docs/30-integrations/spring.mdx | 10 ++ website/docs/30-integrations/unftp_sbe.mdx | 10 ++ website/docs/30-integrations/virtiofs.mdx | 10 ++ website/docs/40-apps/_category_.yml | 6 + website/docs/40-apps/oay.mdx | 10 ++ website/docs/40-apps/ofs.mdx | 10 ++ website/docs/40-apps/oli.mdx | 10 ++ website/docs/binding-java.md | 8 - website/docs/binding-nodejs.md | 8 - website/docs/binding-python.md | 8 - website/docs/dav-server.md | 8 - website/docs/object-store.md | 8 - website/docs/overview.md | 17 --- website/docs/quickstart.md | 203 -------------------------- website/docs/rust-core.md | 18 --- 44 files changed, 417 insertions(+), 282 deletions(-) diff --git a/bindings/c/README.md b/bindings/c/README.md index db7d37366..561d53e89 100644 --- a/bindings/c/README.md +++ b/bindings/c/README.md @@ -131,7 +131,7 @@ make doc ## Used by -Check out the [users](users.md) list for more details on who is using OpenDAL. +Check out the [users](./users.md) list for more details on who is using OpenDAL. ## License and Trademarks diff --git a/core/README.md b/core/README.md index 4d3b1ab3d..b75972806 100644 --- a/core/README.md +++ b/core/README.md @@ -212,11 +212,11 @@ async fn main() -> Result<()> { ## Contributing -Check out the [CONTRIBUTING](CONTRIBUTING.md) guide for more details on getting started with contributing to this project. +Check out the [CONTRIBUTING](./CONTRIBUTING.md) guide for more details on getting started with contributing to this project. ## Used by -Check out the [users](users.md) list for more details on who is using OpenDAL. +Check out the [users](./users.md) list for more details on who is using OpenDAL. ## Branding diff --git a/website/components/GitHubReadme.js b/website/components/GitHubReadme.js new file mode 100644 index 000000000..89d559128 --- /dev/null +++ b/website/components/GitHubReadme.js @@ -0,0 +1,105 @@ +/* + * 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. + */ + +import React from "react"; + +/** + * GitHub README Component: parse all `./xxx` into `GITHUB_URL/xxx` + */ +export default function GitHubReadme({ + children, + owner = "apache", + repo = "opendal", + branch = "main", + basePath = "", + components = {}, +}) { + const createGitHubUrl = (path) => { + const cleanPath = path.replace(/^\.\//, ""); + return `https://github.com/${owner}/${repo}/blob/${branch}/${basePath}${cleanPath}`; + }; + + const CustomLink = (props) => { + const { href, ...restProps } = props; + + if (href && href.startsWith("./")) { + return <a {...restProps} href={createGitHubUrl(href)} />; + } + + return <a {...props} />; + }; + + const CustomParagraph = (props) => { + const { children } = props; + + if (typeof children === "string") { + const pattern = /\[(.*?)\]:\s*(\.\/[^\s]+)/g; + + if (pattern.test(children)) { + const processedText = children.replace( + pattern, + (match, label, path) => { + return `[${label}]: ${createGitHubUrl(path)}`; + }, + ); + + return <p>{processedText}</p>; + } + } + + return <p {...props} />; + }; + + const mergedComponents = { + ...components, + a: CustomLink, + p: CustomParagraph, + }; + + const processRawMarkdown = (content) => { + if (typeof content !== "string") return content; + + let processed = content.replace( + /\[(.*?)\]\((\.\/[^)]+)\)/g, + (match, text, path) => `[${text}](${createGitHubUrl(path)})`, + ); + + processed = processed.replace( + /\[(.*?)\]:\s*(\.\/[^\s]+)/g, + (match, label, path) => `[${label}]: ${createGitHubUrl(path)}`, + ); + + return processed; + }; + + if (typeof children === "string") { + return processRawMarkdown(children); + } + + if (React.isValidElement(children)) { + return React.cloneElement(children, { + components: { + ...(children.props.components || {}), + ...mergedComponents, + }, + }); + } + + return children; +} diff --git a/website/docs/01-overview.md b/website/docs/01-overview.md new file mode 100644 index 000000000..2cdd55833 --- /dev/null +++ b/website/docs/01-overview.md @@ -0,0 +1,10 @@ +--- +sidebar_label: Overview +slug: / +--- + +# Welcome to Apache OpenDALâ„¢ + +OpenDAL represents **Open** **D**ata **A**ccess **L**ayer. Our vision is [**One Layer, All Storage.**](./02-vision.md) + + diff --git a/website/docs/vision.md b/website/docs/02-vision.md similarity index 99% rename from website/docs/vision.md rename to website/docs/02-vision.md index 089e9483c..5b79ad1cc 100644 --- a/website/docs/vision.md +++ b/website/docs/02-vision.md @@ -1,7 +1,6 @@ --- title: Vision sidebar_label: Vision -sidebar_position: 2 --- ## Charter diff --git a/website/docs/10-core.mdx b/website/docs/10-core.mdx new file mode 100644 index 000000000..5c2d7dad8 --- /dev/null +++ b/website/docs/10-core.mdx @@ -0,0 +1,11 @@ +--- +title: Core +sidebar_position: 4 +--- + +import GitHubReadme from '../components/GitHubReadme'; +import Content from '../../core/README.md'; + +<GitHubReadme basePath="core/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/_category_.yml b/website/docs/20-bindings/_category_.yml new file mode 100644 index 000000000..ba2cf824f --- /dev/null +++ b/website/docs/20-bindings/_category_.yml @@ -0,0 +1,6 @@ +label: "Bindings" +collapsible: true +collapsed: false +link: + type: generated-index + title: Bindings Overview diff --git a/website/docs/20-bindings/c.mdx b/website/docs/20-bindings/c.mdx new file mode 100644 index 000000000..29c67f44b --- /dev/null +++ b/website/docs/20-bindings/c.mdx @@ -0,0 +1,10 @@ +--- +title: C +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/c/README.md'; + +<GitHubReadme basePath="bindings/c/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/cpp.mdx b/website/docs/20-bindings/cpp.mdx new file mode 100644 index 000000000..3f60287e2 --- /dev/null +++ b/website/docs/20-bindings/cpp.mdx @@ -0,0 +1,10 @@ +--- +title: Cpp +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/cpp/README.md'; + +<GitHubReadme basePath="bindings/cpp/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/d.mdx b/website/docs/20-bindings/d.mdx new file mode 100644 index 000000000..27a7fda36 --- /dev/null +++ b/website/docs/20-bindings/d.mdx @@ -0,0 +1,10 @@ +--- +title: D +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/d/README.md'; + +<GitHubReadme basePath="bindings/d/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/dart.mdx b/website/docs/20-bindings/dart.mdx new file mode 100644 index 000000000..21d745cfc --- /dev/null +++ b/website/docs/20-bindings/dart.mdx @@ -0,0 +1,10 @@ +--- +title: Dart +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/dart/README.md'; + +<GitHubReadme basePath="bindings/dart/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/dotnet.mdx b/website/docs/20-bindings/dotnet.mdx new file mode 100644 index 000000000..c2054ce21 --- /dev/null +++ b/website/docs/20-bindings/dotnet.mdx @@ -0,0 +1,10 @@ +--- +title: Dotnet +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/dotnet/README.md'; + +<GitHubReadme basePath="bindings/dotnet/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/go.mdx b/website/docs/20-bindings/go.mdx new file mode 100644 index 000000000..7fcf59508 --- /dev/null +++ b/website/docs/20-bindings/go.mdx @@ -0,0 +1,10 @@ +--- +title: Go +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/go/README.md'; + +<GitHubReadme basePath="bindings/go/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/haskell.mdx b/website/docs/20-bindings/haskell.mdx new file mode 100644 index 000000000..d6aeee26b --- /dev/null +++ b/website/docs/20-bindings/haskell.mdx @@ -0,0 +1,10 @@ +--- +title: Haskell +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/haskell/README.md'; + +<GitHubReadme basePath="bindings/haskell/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/java.mdx b/website/docs/20-bindings/java.mdx new file mode 100644 index 000000000..fd9415b93 --- /dev/null +++ b/website/docs/20-bindings/java.mdx @@ -0,0 +1,10 @@ +--- +title: Java +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/java/README.md'; + +<GitHubReadme basePath="bindings/java/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/lua.mdx b/website/docs/20-bindings/lua.mdx new file mode 100644 index 000000000..b8eb0e287 --- /dev/null +++ b/website/docs/20-bindings/lua.mdx @@ -0,0 +1,10 @@ +--- +title: Lua +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/lua/README.md'; + +<GitHubReadme basePath="bindings/lua/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/nodejs.mdx b/website/docs/20-bindings/nodejs.mdx new file mode 100644 index 000000000..c55128fb5 --- /dev/null +++ b/website/docs/20-bindings/nodejs.mdx @@ -0,0 +1,10 @@ +--- +title: Node.js +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/nodejs/README.md'; + +<GitHubReadme basePath="bindings/nodejs/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/ocaml.mdx b/website/docs/20-bindings/ocaml.mdx new file mode 100644 index 000000000..97263aafd --- /dev/null +++ b/website/docs/20-bindings/ocaml.mdx @@ -0,0 +1,10 @@ +--- +title: Ocaml +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/ocaml/README.md'; + +<GitHubReadme basePath="bindings/ocaml/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/php.mdx b/website/docs/20-bindings/php.mdx new file mode 100644 index 000000000..f4f46e904 --- /dev/null +++ b/website/docs/20-bindings/php.mdx @@ -0,0 +1,10 @@ +--- +title: PHP +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/php/README.md'; + +<GitHubReadme basePath="bindings/php/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/python.mdx b/website/docs/20-bindings/python.mdx new file mode 100644 index 000000000..a81da0e9d --- /dev/null +++ b/website/docs/20-bindings/python.mdx @@ -0,0 +1,10 @@ +--- +title: Python +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/python/README.md'; + +<GitHubReadme basePath="bindings/python/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/ruby.mdx b/website/docs/20-bindings/ruby.mdx new file mode 100644 index 000000000..64ccc80c0 --- /dev/null +++ b/website/docs/20-bindings/ruby.mdx @@ -0,0 +1,10 @@ +--- +title: Ruby +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/ruby/README.md'; + +<GitHubReadme basePath="bindings/ruby/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/swift.mdx b/website/docs/20-bindings/swift.mdx new file mode 100644 index 000000000..d18b52005 --- /dev/null +++ b/website/docs/20-bindings/swift.mdx @@ -0,0 +1,10 @@ +--- +title: Swift +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/swift/README.md'; + +<GitHubReadme basePath="bindings/swift/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/20-bindings/zig.mdx b/website/docs/20-bindings/zig.mdx new file mode 100644 index 000000000..e26a7fbb6 --- /dev/null +++ b/website/docs/20-bindings/zig.mdx @@ -0,0 +1,10 @@ +--- +title: Zig +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bindings/zig/README.md'; + +<GitHubReadme basePath="bindings/zig/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/30-integrations/_category_.yml b/website/docs/30-integrations/_category_.yml new file mode 100644 index 000000000..0418e1943 --- /dev/null +++ b/website/docs/30-integrations/_category_.yml @@ -0,0 +1,6 @@ +label: "Integrations" +collapsible: true +collapsed: false +link: + type: generated-index + title: Integrations Overview diff --git a/website/docs/30-integrations/cloud_filter.mdx b/website/docs/30-integrations/cloud_filter.mdx new file mode 100644 index 000000000..549ad41ee --- /dev/null +++ b/website/docs/30-integrations/cloud_filter.mdx @@ -0,0 +1,10 @@ +--- +title: Cloud Filter +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../integrations/cloud_filter/README.md'; + +<GitHubReadme basePath="integrations/cloud_filter/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/30-integrations/dav_server.mdx b/website/docs/30-integrations/dav_server.mdx new file mode 100644 index 000000000..d3f17ee0b --- /dev/null +++ b/website/docs/30-integrations/dav_server.mdx @@ -0,0 +1,10 @@ +--- +title: Dav Server +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../integrations/dav-server/README.md'; + +<GitHubReadme basePath="integrations/dav-server/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/30-integrations/fuse3.mdx b/website/docs/30-integrations/fuse3.mdx new file mode 100644 index 000000000..e07e2a19c --- /dev/null +++ b/website/docs/30-integrations/fuse3.mdx @@ -0,0 +1,10 @@ +--- +title: Fuse3 +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../integrations/fuse3/README.md'; + +<GitHubReadme basePath="integrations/fuse3/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/30-integrations/object_store.mdx b/website/docs/30-integrations/object_store.mdx new file mode 100644 index 000000000..aab800dea --- /dev/null +++ b/website/docs/30-integrations/object_store.mdx @@ -0,0 +1,10 @@ +--- +title: Object Store +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../integrations/object_store/README.md'; + +<GitHubReadme basePath="integrations/object_store/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/30-integrations/parquet.mdx b/website/docs/30-integrations/parquet.mdx new file mode 100644 index 000000000..734d165cc --- /dev/null +++ b/website/docs/30-integrations/parquet.mdx @@ -0,0 +1,10 @@ +--- +title: Parquet +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../integrations/parquet/README.md'; + +<GitHubReadme basePath="integrations/parquet/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/30-integrations/spring.mdx b/website/docs/30-integrations/spring.mdx new file mode 100644 index 000000000..f86314206 --- /dev/null +++ b/website/docs/30-integrations/spring.mdx @@ -0,0 +1,10 @@ +--- +title: Spring +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../integrations/spring/README.md'; + +<GitHubReadme basePath="integrations/spring/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/30-integrations/unftp_sbe.mdx b/website/docs/30-integrations/unftp_sbe.mdx new file mode 100644 index 000000000..acc0d3e94 --- /dev/null +++ b/website/docs/30-integrations/unftp_sbe.mdx @@ -0,0 +1,10 @@ +--- +title: Unftp Sbe +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../integrations/unftp-sbe/README.md'; + +<GitHubReadme basePath="integrations/unftp-sbe/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/30-integrations/virtiofs.mdx b/website/docs/30-integrations/virtiofs.mdx new file mode 100644 index 000000000..e7ecd117b --- /dev/null +++ b/website/docs/30-integrations/virtiofs.mdx @@ -0,0 +1,10 @@ +--- +title: Virtiofs +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../integrations/virtiofs/README.md'; + +<GitHubReadme basePath="integrations/virtiofs/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/40-apps/_category_.yml b/website/docs/40-apps/_category_.yml new file mode 100644 index 000000000..e4eced656 --- /dev/null +++ b/website/docs/40-apps/_category_.yml @@ -0,0 +1,6 @@ +label: "Applications" +collapsible: true +collapsed: false +link: + type: generated-index + title: Applications Overview diff --git a/website/docs/40-apps/oay.mdx b/website/docs/40-apps/oay.mdx new file mode 100644 index 000000000..109b06ae9 --- /dev/null +++ b/website/docs/40-apps/oay.mdx @@ -0,0 +1,10 @@ +--- +title: Oay +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bin/oay/README.md'; + +<GitHubReadme basePath="bin/oay/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/40-apps/ofs.mdx b/website/docs/40-apps/ofs.mdx new file mode 100644 index 000000000..99e92fa83 --- /dev/null +++ b/website/docs/40-apps/ofs.mdx @@ -0,0 +1,10 @@ +--- +title: Ofs +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bin/ofs/README.md'; + +<GitHubReadme basePath="bin/ofs/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/40-apps/oli.mdx b/website/docs/40-apps/oli.mdx new file mode 100644 index 000000000..b3fe3fb69 --- /dev/null +++ b/website/docs/40-apps/oli.mdx @@ -0,0 +1,10 @@ +--- +title: Oli +--- + +import GitHubReadme from '@site/components/GitHubReadme'; +import Content from '../../../bin/oli/README.md'; + +<GitHubReadme basePath="bin/oli/"> + <Content components={{ h1: 'h2' }} /> +</GitHubReadme> diff --git a/website/docs/binding-java.md b/website/docs/binding-java.md deleted file mode 100644 index b97b5117c..000000000 --- a/website/docs/binding-java.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Java API -sidebar_position: 5 ---- - -Read the nightly version of Java API docs at [here](pathname:///docs/java/). - -Read the latest stable version instead at https://javadoc.io/doc/org.apache.opendal/opendal/latest/index.html. diff --git a/website/docs/binding-nodejs.md b/website/docs/binding-nodejs.md deleted file mode 100644 index 003ccd4d6..000000000 --- a/website/docs/binding-nodejs.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Node.js API -sidebar_position: 7 ---- - -Read the nightly version of Node.js API docs at [here](pathname:///docs/nodejs/). - -Read the README of the latest stable version instead at https://www.npmjs.com/package/opendal. diff --git a/website/docs/binding-python.md b/website/docs/binding-python.md deleted file mode 100644 index f664265f2..000000000 --- a/website/docs/binding-python.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Python API -sidebar_position: 6 ---- - -Read the nightly version of Python API docs at [here](pathname:///docs/python/). - -Read the README of the latest stable version instead at https://pypi.org/project/opendal/. diff --git a/website/docs/dav-server.md b/website/docs/dav-server.md deleted file mode 100644 index ad9a0ea31..000000000 --- a/website/docs/dav-server.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: WebDAV Integration -sidebar_position: 9 ---- - -Read the nightly version of the API docs at [here](pathname:///docs/dav-server-opendalfs/dav_server_opendalfs). - -Read the latest stable version instead at https://docs.rs/dav-server-opendalfs/latest/dav_server_opendalfs/index.html. diff --git a/website/docs/object-store.md b/website/docs/object-store.md deleted file mode 100644 index 11caac25f..000000000 --- a/website/docs/object-store.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: object_store Integration -sidebar_position: 8 ---- - -Read the nightly version of the API docs at [here](pathname:///docs/object-store-opendal/object_store_opendal). - -Read the latest stable version instead at https://docs.rs/object_store_opendal/latest/object_store_opendal/index.html. diff --git a/website/docs/overview.md b/website/docs/overview.md deleted file mode 100644 index d83c6b99f..000000000 --- a/website/docs/overview.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -sidebar_label: Overview -sidebar_position: 1 -slug: / ---- - -# Welcome to Apache OpenDALâ„¢ - -OpenDAL represents **Open** **D**ata **A**ccess **L**ayer. Our vision is [**One Layer, All Storage.**](./vision.md) - -## What does OpenDAL do? - - - -## Getting started - -See the page for quick start with multiple languages: [Quickstart](quickstart.md). diff --git a/website/docs/quickstart.md b/website/docs/quickstart.md deleted file mode 100644 index 7a0193787..000000000 --- a/website/docs/quickstart.md +++ /dev/null @@ -1,203 +0,0 @@ ---- -title: Quickstart -sidebar_position: 3 ---- - -Apache OpenDALâ„¢ can be easily integrated into different software with its Rust core and multilingual bindings. - -## Rust core - -OpenDAL's core is implemented in Rust programming language. The most convenient way to use OpenDAL in your Rust program add the OpenDAL Cargo crate as a dependency. - -### Install - -Run the following Cargo command in your project directory: - -```shell -cargo add opendal -``` - -Or add the following line to your Cargo.toml: - -```shell -opendal = "0.46.0" -``` - -### Demo - -Try it out: - -```rust -use opendal::Result; -use opendal::layers::LoggingLayer; -use opendal::services; -use opendal::Operator; - -#[tokio::main] -async fn main() -> Result<()> { - // Pick a builder and configure it. - let mut builder = services::S3::default(); - builder.bucket("test"); - - // Init an operator - let op = Operator::new(builder)? - // Init with logging layer enabled. - .layer(LoggingLayer::default()) - .finish(); - - // Write data - op.write("hello.txt", "Hello, World!").await?; - - // Read data - let bs = op.read("hello.txt").await?; - - // Fetch metadata - let meta = op.stat("hello.txt").await?; - let mode = meta.mode(); - let length = meta.content_length(); - - // Delete - op.delete("hello.txt").await?; - - Ok(()) -} -``` - -## Java binding - -OpenDAL's Java binding is released to Maven central as [`org.apache.opendal:opendal-java:${version}`](https://central.sonatype.com/artifact/org.apache.opendal/opendal-java). - -### Install - -#### Maven - -Generally, you can first add the `os-maven-plugin` for automatically detect the classifier based on your platform: - -```xml -<build> -<extensions> - <extension> - <groupId>kr.motd.maven</groupId> - <artifactId>os-maven-plugin</artifactId> - <version>1.7.0</version> - </extension> -</extensions> -</build> -``` - -Then add the dependency to opendal-java as following: - -```xml -<dependencies> -<dependency> - <groupId>org.apache.opendal</groupId> - <artifactId>opendal-java</artifactId> - <version>${opendal.version}</version> -</dependency> -<dependency> - <groupId>org.apache.opendal</groupId> - <artifactId>opendal-java</artifactId> - <version>${opendal.version}</version> - <classifier>${os.detected.classifier}</classifier> -</dependency> -</dependencies> -``` - -#### Gradle - -For Gradle, you can first add the `com.google.osdetector` for automatically detect the classifier based on your platform: - -```groovy -plugins { - id "com.google.osdetector" version "1.7.3" -} -``` - -Then add the dependency to opendal-java as following: - -```groovy -dependencies { - implementation "org.apache.opendal:opendal-java:$opendal.version" - implementation "org.apache.opendal:opendal-java:$opendal.version:$osdetector.classifier" -} -``` - -#### Classified library - -For details on specifying a classified library, -read the [dedicated explanation](https://github.com/apache/opendal/tree/main/bindings/java). - -### Demo - -Try it out: - -```java -// Configure service -final Map<String, String> conf = new HashMap<>(); -conf.put("root", "/tmp"); -// Construct operator -final Operator op = Operator.of("fs", conf); -// Write data -op.write("hello.txt", "Hello, World!").join(); -// Read data -final byte[] bs = op.read("hello.txt").join(); -// Delete -op.delete("hello.txt").join(); -``` - -## Python binding - -OpenDAL's Python binding is released to PyPI repository as [`opendal`](https://pypi.org/project/opendal/). - -### Install - -Run the following command to install `opendal`: - -```shell -pip install opendal -``` - -### Demo - -Try it out: - -```python -import opendal -import asyncio - -async def main(): - op = opendal.AsyncOperator("fs", root="/tmp") - await op.write("test.txt", b"Hello World") - print(await op.read("test.txt")) - -asyncio.run(main()) -``` - -## Node.js binding - -OpenDAL's Node.js binding is released to NPM registry as [`opendal`](https://www.npmjs.com/package/opendal). - -### Install - -Run the following command to install `opendal`: - -```shell -npm install opendal -``` - -### Demo - -Try it out: - -```javascript -import { Operator } from "opendal"; - -async function main() { - const op = new Operator("fs", { root: "/tmp" }); - await op.write("test", "Hello, World!"); - const bs = await op.read("test"); - console.log(new TextDecoder().decode(bs)); - const meta = await op.stat("test"); - console.log(`contentLength: ${meta.contentLength}`); -} -``` diff --git a/website/docs/rust-core.md b/website/docs/rust-core.md deleted file mode 100644 index 8a7719fd7..000000000 --- a/website/docs/rust-core.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: Rust Core -sidebar_position: 4 ---- - -Read the nightly version of Rust API docs at [here](pathname:///docs/rust/opendal/). - -Read the latest stable version instead at https://docs.rs/opendal/latest/opendal/index.html. - -Below are selected docs you should read: - -| Topic | Link | -| -------- | --------------------------------------------------------------- | -| Usage | https://docs.rs/opendal/latest/opendal/index.html | -| Concepts | https://docs.rs/opendal/latest/opendal/docs/concepts/index.html | -| Services | https://docs.rs/opendal/latest/opendal/services/index.html | -| Layers | https://docs.rs/opendal/latest/opendal/layers/index.html | -| Upgrade | https://docs.rs/opendal/latest/opendal/docs/upgrade/index.html |
