@@ -5,15 +5,13 @@ use crate::engine::Engine;
5
5
use crate :: foundations:: { func, Context , LocatableSelector } ;
6
6
use crate :: introspection:: Location ;
7
7
8
- /// Determines the location of an element in the document.
8
+ /// 文書中の要素の位置を特定。
9
9
///
10
- /// Takes a selector that must match exactly one element and returns that
11
- /// element's [`location`]. This location can, in particular, be used to
12
- /// retrieve the physical [`page`]($location.page) number and
13
- /// [`position`]($location.position) (page, x, y) for that element.
10
+ /// 厳密に1つだけの要素にマッチしなければならないセレクターを受け取り、要素の[`location`]を返します。
11
+ /// このlocationを用いると、特に、物理的な[`page`]($location.page)番号やその要素の[`position`]($location.position)(ページ番号、x座標、y座標)を取得できます。
14
12
///
15
- /// # Examples
16
- /// Locating a specific element:
13
+ /// # 例
14
+ /// 特定の要素の位置を特定します。
17
15
/// ```example
18
16
/// #context [
19
17
/// Introduction is at: \
@@ -26,13 +24,12 @@ use crate::introspection::Location;
26
24
pub fn locate (
27
25
engine : & mut Engine ,
28
26
context : Tracked < Context > ,
29
- /// A selector that should match exactly one element. This element will be
30
- /// located.
27
+ /// 厳密に1つだけの要素にマッチしなければならないセレクター。
28
+ /// その要素の位置が決定されます。
31
29
///
32
- /// Especially useful in combination with
33
- /// - [`here`] to locate the current context,
34
- /// - a [`location`] retrieved from some queried element via the
35
- /// [`location()`]($content.location) method on content.
30
+ /// 以下との組み合わせが特に便利です。
31
+ /// - [`here`]と組み合わせた現在のコンテキストでの位置の特定
32
+ /// - 何らかのクエリで得られた要素からコンテンツの[`location()`]($content.location)メソッドを用いて取得した[`location`]
36
33
selector : LocatableSelector ,
37
34
) -> HintedStrResult < Location > {
38
35
selector. resolve_unique ( engine. introspector , context)
0 commit comments