Skip to content
Merged

chore #115

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@
sphinx-apidoc -f -o ./docs/source/adf_core_python ./src/adf_core_python
sphinx-build -M html ./docs/source ./docs/build -a
```

## Generate localized documentation (Japanese)

```bash
sphinx-apidoc -f -o ./docs/source/adf_core_python ./src/adf_core_python
sphinx-build -M html ./docs/source ./docs/build -D language=ja -a
```
24 changes: 4 additions & 20 deletions docs/build.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import os
import subprocess
import yaml

# a single build step, which keeps conf.py and versions.yaml at the main branch
# in generall we use environment variables to pass values to conf.py, see below
# and runs the build as we did locally
def build_doc(version, language, tag):
os.environ["current_version"] = version
def build_doc(language):
os.environ["current_language"] = language
subprocess.run("git checkout " + tag, shell=True)
subprocess.run("git checkout main -- conf.py", shell=True)
subprocess.run("git checkout main -- versions.yaml", shell=True)
subprocess.run("doxygen Doxyfile", shell=True)
os.environ['SPHINXOPTS'] = "-D language='{}'".format(language)
subprocess.run("make html", shell=True)
Expand All @@ -26,18 +21,7 @@ def move_dir(src, dst):
os.environ["pages_root"] = "https://adf-python.github.io/adf-core-python/"

# manually the main branch build in the current supported languages
build_doc("latest", "en", "main")
build_doc("en")
move_dir("./build/html/", "./pages/en")
build_doc("latest", "ja", "main")
move_dir("./build/html/", "./pages/ja/")

# reading the yaml file
with open("versions.yaml", "r") as yaml_file:
docs = yaml.safe_load(yaml_file)

# and looping over all values to call our build with version, language and its tag
# for version, details in docs.items():
# tag = details.get('tag', '')
# for language in details.get('languages', []):
# build_doc(version, language, version)
# move_dir("./build/html/", "./pages/"+version+'/'+language+'/')
build_doc("ja")
move_dir("./build/html/", "./pages/ja")
34 changes: 3 additions & 31 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import os
import sys
import yaml

sys.path.insert(0, os.path.abspath("../../"))

Expand All @@ -15,7 +14,7 @@
project = "adf-core-python"
copyright = "2024, Haruki Uehara, Yuki Shimada"
author = "Haruki Uehara, Yuki Shimada"
release = "0.1.0"
release = "0.2.2"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down Expand Up @@ -54,39 +53,12 @@

# if not there, we dont call this
if build_all_docs is not None:
# we get the current language and version
current_language = os.environ.get("current_language")
current_version = os.environ.get("current_version")

# we set the html_context wit current language and version
# and empty languages and versions for now
html_context = {
'current_language' : current_language,
'languages' : [],
'current_version' : current_version,
'versions' : [],
}


# and we append all versions and langauges accordingly
# we treat t he main branch as latest
if (current_version == 'latest'):
html_context['languages'].append(['en', pages_root])
html_context['languages'].append(['ja', pages_root+'/ja'])

if (current_language == 'en'):
html_context['versions'].append(['latest', pages_root])
if (current_language == 'ja'):
html_context['versions'].append(['latest', pages_root+'/ja'])

# and loop over all other versions from our yaml file
# to set versions and languages
with open("../versions.yaml", "r") as yaml_file:
docs = yaml.safe_load(yaml_file)

if (current_version != 'latest'):
for language in docs[current_version].get('languages', []):
html_context['languages'].append([language, pages_root+'/'+current_version+'/'+language])

for version, details in docs.items():
html_context['versions'].append([version, pages_root+'/'+version+'/'+current_language])
html_context['languages'].append(['en', pages_root])
html_context['languages'].append(['ja', pages_root+'/ja'])
2,059 changes: 2,052 additions & 7 deletions docs/source/locale/en/LC_MESSAGES/adf_core_python.po

Large diffs are not rendered by default.

155 changes: 115 additions & 40 deletions docs/source/locale/en/LC_MESSAGES/hands-on.po

Large diffs are not rendered by default.

62 changes: 39 additions & 23 deletions docs/source/locale/en/LC_MESSAGES/index.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: adf-core-python \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-19 13:59+0900\n"
"POT-Creation-Date: 2025-11-22 21:57+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
Expand All @@ -18,25 +18,29 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.16.0\n"
"Generated-By: Babel 2.17.0\n"

#: ../../source/index.rst:35
#: ../../source/index.rst:40
msgid "インストール"
msgstr "Installation"

#: ../../source/index.rst:42
#: ../../source/index.rst:47
msgid "クイックスタート"
msgstr "Quick Start"

#: ../../source/index.rst:48
#: ../../source/index.rst:53
msgid "チュートリアル"
msgstr "Tutorial"

#: ../../source/index.rst:58
#: ../../source/index.rst:63
msgid "ハンズオン"
msgstr "Hands-On"

#: ../../source/index.rst:65
#: ../../source/index.rst:70
msgid "開発ガイド"
msgstr "Development Guide"

#: ../../source/index.rst:76
msgid "APIドキュメント"
msgstr "API Documentation"

Expand All @@ -50,49 +54,61 @@ msgstr "This package is currently under development. Breaking changes may occur.

#: ../../source/index.rst:15
msgid "パッケージとしてまだ公開していないため、pip でインストールすることはできません。"
msgstr "Since it has not been released as a package yet, it cannot be installed via pip."
msgstr ""
"Since it has not been released as a package yet, it cannot be installed "
"via pip."

#: ../../source/index.rst:19
msgid "以下の言語のドキュメントは機械翻訳を使用しています。翻訳の正確性については保証できません。 英語"
msgstr "The following language documents use machine translation. The accuracy of the translation cannot be guaranteed. English"
msgstr ""
"The following language documents use machine translation. The accuracy of"
" the translation cannot be guaranteed. English"

#: ../../source/index.rst:19
#: ../../source/index.rst:24
msgid "概要"
msgstr "Overview"

#: ../../source/index.rst:20
#: ../../source/index.rst:25
msgid ""
"adf-core-pythonは、RoboCup Rescue "
"Simulation(RRS)におけるエージェント開発を支援するためのライブラリ及びフレームワークです。 adf-core-"
"pythonを使用することで、エージェントの開発を効率化し、再利用性を向上させることができます。"
msgstr ""
"adf-core-python is a library and framework to support agent development in RoboCup Rescue "
"Simulation (RRS). By using adf-core-python, you can streamline agent development and improve reusability."
"adf-core-python is a library and framework to support agent development "
"in RoboCup Rescue Simulation (RRS). By using adf-core-python, you can "
"streamline agent development and improve reusability."

#: ../../source/index.rst:24
#: ../../source/index.rst:29
msgid "特徴"
msgstr "Features"

#: ../../source/index.rst:25
#: ../../source/index.rst:30
msgid "adf-core-pythonには以下のような特徴があります。"
msgstr "adf-core-python has the following features:"

#: ../../source/index.rst:27
#: ../../source/index.rst:32
msgid "**モジュール単位での開発**: モジュール単位でエージェント開発を行い、モジュールの入れ替えが容易です。"
msgstr "**Module-based development**: Develop agents on a module basis, making it easy to replace modules."
msgstr ""
"**Module-based development**: Develop agents on a module basis, making it"
" easy to replace modules."

#: ../../source/index.rst:28
#: ../../source/index.rst:33
msgid "**モジュールの再利用**: 他のエージェントで使用されているモジュールを再利用することができます。"
msgstr "**Module reuse**: Reuse modules used by other agents."

#: ../../source/index.rst:29
#: ../../source/index.rst:34
msgid "**エージェントの開発に集中**: シミュレーションサーバーとの通信やログ出力などの共通処理をライブラリが提供します。"
msgstr "**Focus on agent development**: The library provides common processing such as communication with the simulation server and log output."
msgstr ""
"**Focus on agent development**: The library provides common processing "
"such as communication with the simulation server and log output."

#: ../../source/index.rst:32
#: ../../source/index.rst:37
msgid "はじめに"
msgstr "Getting Started"

#: ../../source/index.rst:33
#: ../../source/index.rst:38
msgid "adf-core-pythonを始めるには、インストールに従い、このドキュメントに記載されているチュートリアルやハンズオンを参照してください。"
msgstr "To get started with adf-core-python, follow the installation and refer to the tutorials and hands-on in this document."
msgstr ""
"To get started with adf-core-python, follow the installation and refer to"
" the tutorials and hands-on in this document."

Loading
Loading