Skip to content

Commit

Permalink
Merge branch 'update/demo-i18n'
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Oct 17, 2024
2 parents a590d97 + c22c7c0 commit 0343f15
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build:
commands:
- pip install uv
- uv sync --frozen
- uv run sphinx-build -b revealjs demo-ja $READTHEDOCS_OUTPUT/html
- uv run sphinx-build -b mini18n-revealjs demo $READTHEDOCS_OUTPUT/html

# Build documentation in the doc/ directory with Sphinx
# sphinx:
Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

includes:
docs: './docs'
demo-ja: './demo-ja'
demo: './demo'

vars:
# If you run bare environment or activated venv, set '' (blank string)
Expand Down
15 changes: 0 additions & 15 deletions demo-ja/index.rst

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion demo-ja/Taskfile.yaml → demo/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
vars:
# If you run bare environment or activated venv, set '' (blank string)
# RUN_PYTHON: ''
SPHINX_DEFAULT_BUILD: 'mini18n-dirhtml'
SPHINX_DEFAULT_BUILD: 'mini18n-dirrevealjs'
SPHINX_OPTIONS: ''
SPHINX_LANGUAGES:
- 'ja'
Expand Down
48 changes: 48 additions & 0 deletions demo/_locales/ja/LC_MESSAGES/index.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2024, Kazuya Takei
# This file is distributed under the same license as the
# atsphinx-revealjs-rtd package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: atsphinx-revealjs-rtd \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-18 03:32+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Kazuya Takei <[email protected]>\n"
"Language: ja\n"
"Language-Team: ja <[email protected]>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"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"

#: ../../index.rst:3
msgid "atsphinx-revealjs-rtd"
msgstr ""

#: ../../index.rst:5
msgid "sphinx-revealjs presentation managed on Read the Docs."
msgstr "Read the Docs 上で管理する sphinx-revealjs製プレゼンテーション"

#: ../../index.rst:8
msgid "Features"
msgstr "機能"

#: ../../index.rst:11
msgid "Toggle widget to switch version of document"
msgstr "バージョン切り替えウィジェットの表示切り替え"

#: ../../index.rst:13
msgid ""
"When you press ``D`` key, widget is toggled display put on bottom-right "
"of page."
msgstr ""
"``D`` を押すごとに、スライド右下に表示されているRead the Docsから生成されたウィジェットの表示を切り替えます。"

#: ../../index.rst:15
msgid "you can hide it to read presentation with concentrately"
msgstr "プレゼンに集中したいときに、非表示にすることが出来ます。"
3 changes: 3 additions & 0 deletions demo/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body * {
text-transform: none !important;
}
17 changes: 16 additions & 1 deletion demo-ja/conf.py → demo/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Config of demo."""

import os

from atsphinx.revealjs_rtd import __version__

project = "atsphinx-revealjs-rtd"
Expand All @@ -10,11 +12,17 @@
# -- General configuration
extensions = [
"rst_budoux.sphinx",
"atsphinx.mini18n",
"atsphinx.revealjs_rtd",
]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
language = "ja"
language = "en"

# -- Options for i18n
gettext_compact = False
locale_dirs = ["_locales"]
gettext_last_translator = os.environ.get("SPHINXINTL_TRANSLATOR", None)

# -- Options for Revealjs output
revealjs_html_theme = "revealjs-simple"
Expand All @@ -39,6 +47,7 @@
]
revealjs_css_files = [
"revealjs/plugin/highlight/zenburn.css",
"custom.css",
]
revealjs_notes_from_comments = True

Expand All @@ -51,3 +60,9 @@
overflow-wrap: anywhere;
}
"""
# atsphinx-mini18n
mini18n_default_language = "en"
mini18n_support_languages = ["en", "ja"]
mini18n_basepath = ""
if "READTHEDOCS_VERSION" in os.environ:
mini18n_basepath = f"/{os.environ['READTHEDOCS_VERSION']}/"
15 changes: 15 additions & 0 deletions demo/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
=====================
atsphinx-revealjs-rtd
=====================

sphinx-revealjs presentation managed on Read the Docs.

Features
========

Toggle widget to switch version of document
-------------------------------------------

When you press ``D`` key, widget is toggled display put on bottom-right of page.

you can hide it to read presentation with concentrately

0 comments on commit 0343f15

Please sign in to comment.