This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git
The following commit(s) were added to refs/heads/main by this push:
new 613d1d279 docs: sync rust and python document to fory-site (#2734)
613d1d279 is described below
commit 613d1d2798912dd64fefcf310161da20aa2654e9
Author: Shawn Yang <[email protected]>
AuthorDate: Fri Oct 10 01:17:26 2025 +0800
docs: sync rust and python document to fory-site (#2734)
## Why?
<!-- Describe the purpose of this PR. -->
## What does this PR do?
sync rust and python document to fory-site
## Related issues
<!--
Is there any related issue? If this PR closes them you say say
fix/closes:
- #xxxx0
- #xxxx1
- Fixes #xxxx2
-->
## Does this PR introduce any user-facing change?
<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fory/issues/new/choose) describing the
need to do so and update the document if necessary.
Delete section if not applicable.
-->
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
Delete section if not applicable.
-->
---
.github/scripts/add_doc_headers.sh | 101 ++++++++++++++++++++++++++++++++
.github/workflows/sync.yml | 4 ++
docs/guide/DEVELOPMENT.md | 2 +-
docs/guide/python_guide.md | 1 +
docs/guide/row_format_guide.md | 2 +-
docs/guide/rust_guide.md | 1 +
docs/guide/scala_guide.md | 2 +-
docs/guide/xlang_serialization_guide.md | 2 +-
docs/guide/xlang_type_mapping.md | 2 +-
9 files changed, 112 insertions(+), 5 deletions(-)
diff --git a/.github/scripts/add_doc_headers.sh
b/.github/scripts/add_doc_headers.sh
new file mode 100755
index 000000000..588591ae0
--- /dev/null
+++ b/.github/scripts/add_doc_headers.sh
@@ -0,0 +1,101 @@
+#!/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
+
+# Function to add frontmatter header to a guide file
+add_header() {
+ local SOURCE_FILE=$1
+ local DEST_FILE=$2
+ local HEADER_CONTENT=$3
+
+ echo "Processing $SOURCE_FILE -> $DEST_FILE"
+
+ # Resolve symlink if it is one
+ if [ -L "$DEST_FILE" ]; then
+ SOURCE_FILE=$(readlink -f "$DEST_FILE" 2>/dev/null || readlink
"$DEST_FILE")
+ echo "Resolved symlink to: $SOURCE_FILE"
+ fi
+
+ if [ -f "$SOURCE_FILE" ]; then
+ # Create file with header and source content
+ echo "$HEADER_CONTENT" > "$DEST_FILE"
+ cat "$SOURCE_FILE" >> "$DEST_FILE"
+ echo "Successfully created $DEST_FILE with header"
+ else
+ echo "Warning: $SOURCE_FILE not found"
+ fi
+}
+
+# Python guide header
+PYTHON_HEADER=$(cat << 'EOF'
+---
+title: Python Serialization
+sidebar_position: 1
+id: python_serialization
+license: |
+ 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.
+---
+
+EOF
+)
+
+# Rust guide header
+RUST_HEADER=$(cat << 'EOF'
+---
+title: Rust Serialization
+sidebar_position: 2
+id: rust_serialization
+license: |
+ 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.
+---
+
+EOF
+)
+
+# Process Python guide
+add_header "python/README.md" "docs/guide/python_guide.md" "$PYTHON_HEADER"
+
+# Process Rust guide
+add_header "rust/README.md" "docs/guide/rust_guide.md" "$RUST_HEADER"
\ No newline at end of file
diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml
index a920ef65d..4fd69d59e 100644
--- a/.github/workflows/sync.yml
+++ b/.github/workflows/sync.yml
@@ -28,6 +28,10 @@ jobs:
if: github.repository == 'apache/fory'
steps:
- uses: actions/checkout@v5
+
+ - name: Add headers to guide files
+ run: bash .github/scripts/add_doc_headers.sh
+
- name: Sync files
uses:
betahuhn/repo-file-sync-action@8b92be3375cf1d1b0cd579af488a9255572e4619
with:
diff --git a/docs/guide/DEVELOPMENT.md b/docs/guide/DEVELOPMENT.md
index b3ac9d360..3b7105c85 100644
--- a/docs/guide/DEVELOPMENT.md
+++ b/docs/guide/DEVELOPMENT.md
@@ -1,6 +1,6 @@
---
title: Development
-sidebar_position: 7
+sidebar_position: 8
id: development
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/docs/guide/python_guide.md b/docs/guide/python_guide.md
new file mode 120000
index 000000000..30c630240
--- /dev/null
+++ b/docs/guide/python_guide.md
@@ -0,0 +1 @@
+../../python/README.md
\ No newline at end of file
diff --git a/docs/guide/row_format_guide.md b/docs/guide/row_format_guide.md
index 099f03820..a2526c1fe 100644
--- a/docs/guide/row_format_guide.md
+++ b/docs/guide/row_format_guide.md
@@ -1,6 +1,6 @@
---
title: Row Format Guide
-sidebar_position: 1
+sidebar_position: 5
id: row_format_guide
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/docs/guide/rust_guide.md b/docs/guide/rust_guide.md
new file mode 120000
index 000000000..bb3aaef22
--- /dev/null
+++ b/docs/guide/rust_guide.md
@@ -0,0 +1 @@
+../../rust/README.md
\ No newline at end of file
diff --git a/docs/guide/scala_guide.md b/docs/guide/scala_guide.md
index 11524f519..ab517eb3e 100644
--- a/docs/guide/scala_guide.md
+++ b/docs/guide/scala_guide.md
@@ -1,6 +1,6 @@
---
title: Scala Serialization Guide
-sidebar_position: 4
+sidebar_position: 3
id: scala_guide
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/docs/guide/xlang_serialization_guide.md
b/docs/guide/xlang_serialization_guide.md
index a03490988..331440b0f 100644
--- a/docs/guide/xlang_serialization_guide.md
+++ b/docs/guide/xlang_serialization_guide.md
@@ -1,6 +1,6 @@
---
title: Xlang Serialization Guide
-sidebar_position: 2
+sidebar_position: 4
id: xlang_object_graph_guide
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/docs/guide/xlang_type_mapping.md b/docs/guide/xlang_type_mapping.md
index 754c5ed7f..a4d9637f8 100644
--- a/docs/guide/xlang_type_mapping.md
+++ b/docs/guide/xlang_type_mapping.md
@@ -1,6 +1,6 @@
---
title: Type Mapping of Xlang Serialization
-sidebar_position: 3
+sidebar_position: 7
id: xlang_type_mapping
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]