-
Notifications
You must be signed in to change notification settings - Fork 221
Fix/docs nav #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fix/docs nav #624
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b587817
Fixing javadoc generation scripts
karllessard 5a9a308
Add docs nav and landing page
karllessard e50a22e
Update JavaCPP notice
karllessard 185cdf2
Renamed tools to legacy
karllessard f9d2b06
Delete old docs scripts
karllessard b500c3d
Add mention for legacy doc tools
karllessard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,3 +64,6 @@ gradleBuild | |
| # Deployment Files | ||
| settings.xml | ||
| pom.xml.asc | ||
|
|
||
| # Docs | ||
| docs/docs/apidocs/ | ||
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| hide: | ||
| - navigation | ||
| - toc | ||
| - title | ||
| --- | ||
| # | ||
| <iframe src="https://tensorflow.github.io/java/javadoc/v1.2.0/index.html" style="width:100%; height:800px; border:none;"></iframe> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| :root > * { | ||
| /*--md-primary-fg-color: #EE782F;*/ | ||
| /*--md-primary-fg-color--light: #455960;*/ | ||
| /*--md-primary-fg-color--dark: #90030C;*/ | ||
| } | ||
|
|
||
| .md-typeset h1, .md-typeset h2 { | ||
| font-weight: 800; | ||
| letter-spacing: -.01em; | ||
| } | ||
|
|
||
| .md-sidebar--primary { | ||
| display: none; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| site_name: '' | ||
| site_url: https://tensorflow.org | ||
| repo_url: https://github.com/tensorflow/java | ||
| site_description: Documentation of TensorFlow Java API and tools. | ||
| copyright: "© TensorFlow Authors 2025" | ||
|
|
||
| theme: | ||
| name: material | ||
| logo: assets/tensorflow.svg | ||
| features: | ||
| - navigation.indexes | ||
| - navigation.instant | ||
| - navigation.sections | ||
| - navigation.tabs | ||
| - navigation.tabs.sticky | ||
| - toc.follow | ||
| palette: | ||
| # Palette toggle for automatic mode | ||
| - media: "(prefers-color-scheme)" | ||
| toggle: | ||
| icon: material/brightness-auto | ||
| name: Switch to light mode | ||
| # Palette toggle for light mode | ||
| - media: "(prefers-color-scheme: light)" | ||
| scheme: default | ||
| primary: white | ||
| accent: orange | ||
| toggle: | ||
| icon: material/brightness-7 | ||
| name: Switch to dark mode | ||
| # Palette toggle for dark mode | ||
| - media: "(prefers-color-scheme: dark)" | ||
| scheme: slate | ||
| primary: black | ||
| accent: orange | ||
| toggle: | ||
| icon: material/brightness-4 | ||
| name: Switch to system preference | ||
|
|
||
| extra_css: | ||
| - stylesheets/extra.css | ||
|
|
||
| nav: | ||
| - Home: | ||
| - index.md | ||
| - Install: | ||
| - install.md | ||
| - References: | ||
| - apidocs/index.html | ||
|
|
||
| #markdown_extensions: | ||
| # - admonition | ||
| # - pymdownx.snippets | ||
| # - pymdownx.superfences | ||
| # - pymdownx.details | ||
| # - pymdownx.superfences | ||
| # - attr_list | ||
| # - md_in_html | ||
| # - toc | ||
| # - pymdownx.tabbed: | ||
| # alternate_style: true | ||
|
|
||
| #plugins: | ||
| # - search | ||
| # - glightbox | ||
| # - include-markdown | ||
| # - include_dir_to_nav | ||
| # - mkdocs-jupyter: | ||
| # execute: false | ||
| # include_source: true | ||
| # - mkdocstrings: | ||
| # default_handler: python | ||
| # handlers: | ||
| # python: | ||
| # load_external_modules: false | ||
| # options: | ||
| # docstring_options: | ||
| # ignore_init_summary: true | ||
| # docstring_style: google | ||
| # members_order: source | ||
| # merge_init_into_class: true | ||
| # parameter_headings: true | ||
| # separate_signature: true | ||
| # show_if_no_docstring: true | ||
| # show_root_full_path: true | ||
| # show_root_heading: false | ||
| # show_source: true | ||
| # show_symbol_type_heading: true | ||
| # show_symbol_type_toc: true | ||
| # signature_crossrefs: true | ||
| # | ||
| #extra: | ||
| # generator: false | ||
| # social: | ||
| # - icon: fontawesome/brands/slack | ||
| # link: https://expediagroup.enterprise.slack.com/archives/C08RD5SBRLH | ||
| # name: "#ask-genai-platform" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| # Lint as: python3 | ||
| # Copyright 2020 The TensorFlow Authors. All Rights Reserved. | ||
| # | ||
| # Licensed 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. | ||
| # ============================================================================== | ||
| """Generate TensorFlow Java reference docs for TensorFlow.org.""" | ||
| from __future__ import absolute_import | ||
| from __future__ import division | ||
| from __future__ import print_function | ||
|
|
||
| import pathlib | ||
| import shutil | ||
| import tempfile | ||
| import io | ||
| import requests | ||
| import zipfile | ||
| from git import Repo | ||
|
|
||
| from absl import app | ||
| from absl import flags | ||
|
|
||
| from tensorflow_docs.api_generator import gen_java | ||
|
|
||
| FLAGS = flags.FLAGS | ||
|
|
||
| NDARRAY_VERSION = 'v1.0.0' | ||
| JAVACPP_VERSION = '1.5.11' | ||
| PROTOBUF_VERSION = 'v3.21.9' | ||
|
|
||
| # __file__ is the path to this file | ||
| TOOLS_DIR = pathlib.Path(__file__).resolve().parent | ||
| DOCS_DIR = TOOLS_DIR.parent | ||
| REPO_ROOT = DOCS_DIR.parent | ||
| DOC_OUTPUT_DIR = DOCS_DIR.joinpath("output") | ||
|
|
||
| SECTION_LABELS = { | ||
| 'org.tensorflow': 'Core', | ||
| 'org.tensorflow.ndarray': 'NdArray', | ||
| 'org.tensorflow.framework': 'Framework', | ||
| } | ||
|
|
||
| # These flags are required by infrastructure, not all of them are used. | ||
| flags.DEFINE_string('output_dir', f"{DOC_OUTPUT_DIR}", | ||
| ("Use this branch as the root version and don't" | ||
| ' create in version directory')) | ||
|
|
||
| flags.DEFINE_string('site_path', 'api_docs/', | ||
| 'Path prefix in the _toc.yaml') | ||
|
|
||
| flags.DEFINE_string('code_url_prefix', None, | ||
| '[UNUSED] The url prefix for links to code.') | ||
|
|
||
| flags.DEFINE_bool( | ||
| 'search_hints', True, | ||
| '[UNUSED] Include metadata search hints in the generated files') | ||
|
|
||
|
|
||
| def checkout_repo(repo_url: str, target_dir_name: str, version: str): | ||
| local_repo_path = f"{REPO_ROOT}/{target_dir_name}" | ||
| if not pathlib.Path(local_repo_path).exists(): | ||
| local_repo = Repo.clone_from(repo_url, local_repo_path) | ||
| else: | ||
| local_repo = Repo(local_repo_path) | ||
| local_repo.remotes['origin'].fetch() | ||
| local_repo.git.checkout(version) | ||
|
|
||
|
|
||
| def overlay(from_root, to_root): | ||
| for from_path in pathlib.Path(from_root).rglob('*'): | ||
| relpath = from_path.relative_to(from_root) | ||
| to_path = to_root/relpath | ||
| if from_path.is_file(): | ||
| assert not to_path.exists() | ||
| shutil.copyfile(from_path, to_path) | ||
| else: | ||
| to_path.mkdir(exist_ok=True) | ||
|
|
||
|
|
||
| def main(unused_argv): | ||
| checkout_repo('https://github.com/tensorflow/java-ndarray', 'ndarray', NDARRAY_VERSION) | ||
| checkout_repo('https://github.com/bytedeco/javacpp', 'javacpp', JAVACPP_VERSION) | ||
| response = requests.get('https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.21.9/protobuf-java-3.21.9-sources.jar') | ||
| with zipfile.ZipFile(io.BytesIO(response.content)) as z: | ||
| z.extractall(f"{REPO_ROOT}/protobuf") | ||
| response = requests.get('https://repo1.maven.org/maven2/org/osgi/osgi.annotation/8.1.0/osgi.annotation-8.1.0-sources.jar') | ||
| with zipfile.ZipFile(io.BytesIO(response.content)) as z: | ||
| z.extractall(f"{REPO_ROOT}/osgi") | ||
|
|
||
| merged_source = pathlib.Path(tempfile.mkdtemp()) | ||
| (merged_source / 'java/org').mkdir(parents=True) | ||
| shutil.copytree(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/', merged_source/'java/org/tensorflow') | ||
| overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow', merged_source/'java/org/tensorflow') | ||
| overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow', merged_source/'java/org/tensorflow') | ||
| overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/', merged_source/'java/org/tensorflow/') | ||
| overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/', merged_source/'java/org/tensorflow/') | ||
| shutil.copytree(REPO_ROOT/'tensorflow-framework/src/main/java/org/tensorflow/framework', merged_source/'java/org/tensorflow/framework') | ||
| shutil.copytree(REPO_ROOT/'ndarray/ndarray/src/main/java/org/tensorflow/ndarray', merged_source/'java/org/tensorflow/ndarray') | ||
| shutil.copytree(REPO_ROOT/'javacpp/src/main/java/org/bytedeco', merged_source/'java/org/bytedeco') | ||
| shutil.copytree(REPO_ROOT/'protobuf/com/', merged_source/'java/com') | ||
| shutil.copytree(REPO_ROOT/'osgi/org/osgi', merged_source/'java/org/osgi') | ||
|
|
||
| gen_java.gen_java_docs( | ||
| package='org.tensorflow', | ||
| source_path=merged_source / 'java', | ||
| output_dir=pathlib.Path(FLAGS.output_dir), | ||
| site_path=pathlib.Path(FLAGS.site_path), | ||
| section_labels=SECTION_LABELS, | ||
| # Uncomment for local testing: | ||
| script_path=pathlib.Path(TOOLS_DIR, 'run-javadoc-for-tf-local.sh'), | ||
| ) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| flags.mark_flags_as_required(['output_dir']) | ||
| app.run(main) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's just called
LiteRTnow, they dropped theTensorFlow.