chaokunyang commented on code in PR #1648:
URL: https://github.com/apache/incubator-fury/pull/1648#discussion_r1616163934


##########
tools/gen_fury_builder_doc.py:
##########
@@ -0,0 +1,225 @@
+# 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 os
+import re
+import dataclasses
+import subprocess
+import tempfile
+import shutil
+
+PROJECT_ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 
"../")
+
+FURY_BUILDER_PATH = os.path.join(
+    PROJECT_ROOT_DIR,
+    "java/fury-core/src/main/java/org/apache/fury/config/FuryBuilder.java",
+)
+JAVA_DOC_PATH = os.path.join(PROJECT_ROOT_DIR, 
"docs/guide/java_serialization_guide.md")
+
+DOC_GEN_BEGIN = "<!-- Auto generate region begin -->"
+DOC_GEN_END = "<!-- Auto generate region end -->"
+
+FIELD_LINE_PATTERN = re.compile(
+    r"^(public\s+|protected\s+|private\s+|)(\w+|\w+<.+>)\s+\w+$"
+)
+FILE_REPLACE_PATTERN = re.compile(
+    rf"^{DOC_GEN_BEGIN}.*{DOC_GEN_END}$", flags=re.MULTILINE | re.S
+)
+
+
+@dataclasses.dataclass
+class FieldInfo:
+    field_scope: str
+    field_name: str
+    field_type: str
+    field_default_val: str
+    field_comment: str
+
+
+def _parse_fields(fields_content):
+    fields_info = []
+    for field in fields_content:
+        """
+        Field format:
+        <ul class="blockList">
+            <li class="blockList">
+                <h4>language</h4>
+                <pre><a href="Language.html" title="enum in 
org.apache.fury.config">Language</a> language</pre>
+                <div class="block">Whether cross-language serialize the 
object. If you used fury for java only, please set
+                    language to <a 
href="Language.html#JAVA"><code>Language.JAVA</code></a>, which will have much 
better performance.
+                </div>
+                <dl>
+                    <dt><span class="simpleTagLabel">defaultValue</span></dt>
+                    <dd>Language.JAVA</dd>
+                </dl>
+            </li>
+        </ul>
+        """
+        tag_labels = 
field.xpath('li/dl/dt/span[@class="simpleTagLabel"]/text()')

Review Comment:
   This seems coupled with javadoc structure. WIll javadoc generated html 
change between JDK vendor and different JDK versions?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@fury.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@fury.apache.org
For additional commands, e-mail: commits-h...@fury.apache.org

Reply via email to