Skip to content
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

docs: APIドキュメントの{Character,Style}Meta周りの記述を統一 #996

Merged
Merged
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
18 changes: 10 additions & 8 deletions crates/voicevox_core/src/metas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ pub fn merge<'a>(metas: impl IntoIterator<Item = &'a CharacterMeta>) -> Vec<Char

/// スタイルID。
///
/// VOICEVOXにおける、ある[**キャラクター**]のある[**スタイル**(_style_)]を指す。
/// VOICEVOXにおける、ある[<i>キャラクター</i>]のある[<i>スタイル</i>]を指す。
///
/// [**キャラクター**]: CharacterMeta
/// [**スタイル**(_style_)]: StyleMeta
/// [<i>キャラクター</i>]: CharacterMeta
/// [<i>スタイル</i>]: StyleMeta
#[derive(
PartialEq,
Eq,
Expand All @@ -66,9 +66,9 @@ impl Display for StyleId {
}
}

/// [**キャラクター**]のバージョン。
/// [<i>キャラクター</i>]のバージョン。
///
/// [**キャラクター**]: CharacterMeta
/// [<i>キャラクター</i>]: CharacterMeta
#[derive(PartialEq, Eq, Clone, Ord, PartialOrd, Deserialize, Serialize, new, Debug)]
pub struct CharacterVersion(pub String);

Expand All @@ -81,7 +81,7 @@ impl Display for CharacterVersion {
/// 音声モデルのメタ情報。
pub type VoiceModelMeta = Vec<CharacterMeta>;

/// キャラクターのメタ情報
/// <i>キャラクター</i>のメタ情報
#[derive(Deserialize, Serialize, Clone)]
#[non_exhaustive]
pub struct CharacterMeta {
Expand Down Expand Up @@ -141,7 +141,7 @@ impl CharacterMeta {
}
}

/// **スタイル**(_style_)のメタ情報。
/// <i>スタイル</i>のメタ情報。
#[derive(Deserialize, Serialize, Clone)]
#[non_exhaustive]
pub struct StyleMeta {
Expand All @@ -158,7 +158,9 @@ pub struct StyleMeta {
pub order: Option<u32>,
}

/// **スタイル**(_style_)に対応するモデルの種類。
/// [<i>スタイル</i>]に対応するモデルの種類。
///
/// [<i>スタイル</i>]: StyleMeta
#[derive(
Default,
Clone,
Expand Down
2 changes: 1 addition & 1 deletion crates/voicevox_core_c_api/include/voicevox_core.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/voicevox_core_c_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ pub type VoicevoxVoiceModelId<'a> = &'a [u8; 16];

/// スタイルID。
///
/// VOICEVOXにおける、ある<b>キャラクター</b>のある<b>スタイル</b>(_style_)を指す。
/// VOICEVOXにおける、ある<i>キャラクター</i>のある<i>スタイル</i>を指す。
///
/// \orig-impl{VoicevoxStyleId}
pub type VoicevoxStyleId = u32;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import jakarta.annotation.Nullable;

/**
* キャラクターのメタ情報
* <i>キャラクター</i>のメタ情報
*
* <p>現在この型はGSONに対応しているが、将来的には <a href="https://github.com/VOICEVOX/voicevox_core/issues/984"
* target="_blank">Jacksonに切り替わる予定</a> 。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import jakarta.annotation.Nullable;

/**
* スタイル(style)のメタ情報。
* <i>スタイル</i>のメタ情報。
*
* <p>現在この型はGSONに対応しているが、将来的には <a href="https://github.com/VOICEVOX/voicevox_core/issues/984"
* target="_blank">Jacksonに切り替わる予定</a> 。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.google.gson.JsonSerializer;
import java.lang.reflect.Type;

/** スタイル(style)に対応するモデルの種類。 */
/** {@link StyleMeta <i>スタイル</i>}に対応するモデルの種類。 */
public class StyleType {
/** 音声合成クエリの作成と音声合成が可能。 */
public static final StyleType TALK = new StyleType("talk");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,24 @@
"""
スタイルID。

VOICEVOXにおける、ある |styleid-character|_ のある |styleid-style|_ を指す。

.. |styleid-character| replace:: *キャラクター*
.. _styleid-character: #voicevox_core.CharacterMeta
.. |styleid-style| replace:: *スタイル*
.. _styleid-style: #voicevox_core.StyleMeta

Parameters
----------
x : int
"""

CharacterVersion = NewType("CharacterVersion", str)
"""
**キャラクター**のバージョン。
|characterversion-character|_ のバージョン。

.. |characterversion-character| replace:: *キャラクター*
.. _characterversion-character: #voicevox_core.CharacterMeta

Parameters
----------
Expand All @@ -41,7 +51,10 @@
)
"""

**スタイル** (_style_)に対応するモデルの種類。
|styletype-style|_ に対応するモデルの種類。

.. |styletype-style| replace:: *スタイル*
.. _styletype-style: #voicevox_core.StyleMeta

===================== ==================================================
値 説明
Expand Down Expand Up @@ -90,7 +103,7 @@ def _(style_type: StyleType):
@pydantic.dataclasses.dataclass
class StyleMeta:
"""
**スタイル** (_style_)のメタ情報。
*スタイル* のメタ情報。

現在は |pydantic-dataclasses-dataclass-stylemeta|_ ではあるが、将来的には
|de-pydantic-stylemeta|_ 。
Expand Down Expand Up @@ -121,7 +134,7 @@ class StyleMeta:
@pydantic.dataclasses.dataclass
class CharacterMeta:
"""
**キャラクター**のメタ情報。
*キャラクター* のメタ情報。

現在は |pydantic-dataclasses-dataclass-charactermeta|_ ではあるが、将来的には
|de-pydantic-charactermeta|_ 。
Expand Down