-
Notifications
You must be signed in to change notification settings - Fork 13
/docs/reference/introspection/locate
の翻訳
#319
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,15 +5,13 @@ use crate::engine::Engine; | |||||
use crate::foundations::{func, Context, LocatableSelector}; | ||||||
use crate::introspection::Location; | ||||||
|
||||||
/// Determines the location of an element in the document. | ||||||
/// 文書中の要素の位置を特定。 | ||||||
/// | ||||||
/// Takes a selector that must match exactly one element and returns that | ||||||
/// element's [`location`]. This location can, in particular, be used to | ||||||
/// retrieve the physical [`page`]($location.page) number and | ||||||
/// [`position`]($location.position) (page, x, y) for that element. | ||||||
/// 厳密に1つだけの要素にマッチしなければならないセレクターを受け取り、要素の[`location`]を返します。 | ||||||
/// このlocationを用いると、特に、物理的な[`page`]($location.page)番号やその要素の[`position`]($location.position)(ページ番号、x座標、y座標)を取得できます。 | ||||||
ultimatile marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
/// | ||||||
/// # Examples | ||||||
/// Locating a specific element: | ||||||
/// # 例 | ||||||
/// 特定の要素の位置を特定します。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
/// ```example | ||||||
/// #context [ | ||||||
/// Introduction is at: \ | ||||||
|
@@ -26,13 +24,12 @@ use crate::introspection::Location; | |||||
pub fn locate( | ||||||
engine: &mut Engine, | ||||||
context: Tracked<Context>, | ||||||
/// A selector that should match exactly one element. This element will be | ||||||
/// located. | ||||||
/// 厳密に1つだけの要素にマッチしなければならないセレクター。 | ||||||
/// その要素の位置が決定されます。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここは引数ではなく戻り値を指していると思いました。
Suggested change
|
||||||
/// | ||||||
/// Especially useful in combination with | ||||||
/// - [`here`] to locate the current context, | ||||||
/// - a [`location`] retrieved from some queried element via the | ||||||
/// [`location()`]($content.location) method on content. | ||||||
/// 以下との組み合わせが特に便利です。 | ||||||
/// - [`here`]と組み合わせた現在のコンテキストでの位置の特定 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hereはロケーションであったと思います。
Suggested change
|
||||||
/// - 何らかのクエリで得られた要素からコンテンツの[`location()`]($content.location)メソッドを用いて取得した[`location`] | ||||||
selector: LocatableSelector, | ||||||
) -> HintedStrResult<Location> { | ||||||
selector.resolve_unique(engine.introspector, context) | ||||||
|
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.