Skip to content

Commit eca819a

Browse files
docs: Fix and improve Markdown usage (#355)
1 parent 41d8b0a commit eca819a

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

fluent-bundle/src/bundle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ impl<R> Default for FluentBundle<R, IntlLangMemoizer> {
556556
}
557557

558558
impl<R> FluentBundle<R, IntlLangMemoizer> {
559-
/// Constructs a FluentBundle. The first element in `locales` should be the
559+
/// Constructs a `FluentBundle`. The first element in `locales` should be the
560560
/// language this bundle represents, and will be used to determine the
561561
/// correct plural rules for this bundle. You can optionally provide extra
562562
/// languages in the list; they will be used as fallback date and time

fluent-bundle/src/memoizer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ use crate::types::FluentType;
22
use intl_memoizer::Memoizable;
33
use unic_langid::LanguageIdentifier;
44

5-
/// This trait contains thread-safe methods which extend [intl_memoizer::IntlLangMemoizer].
5+
/// This trait contains thread-safe methods which extend [`intl_memoizer::IntlLangMemoizer`].
66
/// It is used as the generic bound in this crate when a memoizer is needed.
77
pub trait MemoizerKind: 'static {
88
fn new(lang: LanguageIdentifier) -> Self
99
where
1010
Self: Sized;
1111

12-
/// A threadsafe variant of `with_try_get` from [intl_memoizer::IntlLangMemoizer].
12+
/// A threadsafe variant of `with_try_get` from [`intl_memoizer::IntlLangMemoizer`].
1313
/// The generics enforce that `Self` and its arguments are actually threadsafe.
1414
///
1515
/// `I` - The [Memoizable](intl_memoizer::Memoizable) internationalization formatter.

fluent-bundle/src/resolver/scope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'bundle, 'ast, 'args, 'errors, R, M> Scope<'bundle, 'ast, 'args, 'errors, R
5050
}
5151

5252
/// This method allows us to lazily add Pattern on the stack, only if the
53-
/// Pattern::resolve has been called on an empty stack.
53+
/// `Pattern::resolve` has been called on an empty stack.
5454
///
5555
/// This is the case when pattern is called from Bundle and it allows us to fast-path
5656
/// simple resolutions, and only use the stack for placeables.

fluent-bundle/src/types/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ pub trait FluentType: fmt::Debug + AnyEq + 'static {
3434
/// Create a clone of the underlying type.
3535
fn duplicate(&self) -> Box<dyn FluentType + Send>;
3636

37-
/// Convert the custom type into a string value, for instance a custom DateTime
37+
/// Convert the custom type into a string value, for instance a custom `DateTime`
3838
/// type could return "Oct. 27, 2022".
3939
fn as_string(&self, intls: &intl_memoizer::IntlLangMemoizer) -> Cow<'static, str>;
4040

41-
/// Convert the custom type into a string value, for instance a custom DateTime
41+
/// Convert the custom type into a string value, for instance a custom `DateTime`
4242
/// type could return "Oct. 27, 2022". This operation is provided the threadsafe
43-
/// [IntlLangMemoizer](intl_memoizer::concurrent::IntlLangMemoizer).
43+
/// [`IntlLangMemoizer`](intl_memoizer::concurrent::IntlLangMemoizer).
4444
fn as_string_threadsafe(
4545
&self,
4646
intls: &intl_memoizer::concurrent::IntlLangMemoizer,

fluent-fallback/examples/simple-fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ fn collatz(n: isize) -> isize {
165165
}
166166
}
167167

168-
/// Bundle iterator used by BundleGeneratorSync implementation for Locales.
168+
/// Bundle iterator used by `BundleGeneratorSync` implementation for `Locales`.
169169
struct BundleIter {
170170
res_path_scheme: String,
171171
locales: <Vec<LanguageIdentifier> as IntoIterator>::IntoIter,

fluent-resmgr/src/resource_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn read_file(path: &str) -> Result<String, io::Error> {
1515
fs::read_to_string(path)
1616
}
1717

18-
/// [ResourceManager] provides a standalone solution for managing localization resources which
18+
/// [`ResourceManager`] provides a standalone solution for managing localization resources which
1919
/// can be used by `fluent-fallback` or other higher level bindings.
2020
pub struct ResourceManager {
2121
resources: FrozenMap<String, Box<FluentResource>>,

fluent-syntax/src/ast/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ pub struct Pattern<S> {
393393
pub elements: Vec<PatternElement<S>>,
394394
}
395395

396-
/// PatternElement is an element of a [`Pattern`].
396+
/// `PatternElement` is an element of a [`Pattern`].
397397
///
398398
/// Each [`PatternElement`] node represents
399399
/// either a simple textual value, or a combination of text literals

fluent-syntax/tests/serializer_fixtures.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use fluent_syntax::serializer::{serialize, serialize_with_options, Options};
99

1010
/// List of files that currently do not roundtrip correctly.
1111
///
12-
/// - `multiline_values.ftl`: https://github.com/projectfluent/fluent-rs/issues/286
13-
/// - `crlf.ftl`: Parsing `foo =\r\n bar\r\n baz\r\n` results in a TextElement "bar" and a TextElement "\n",
14-
/// whereas parsing `foo =\n bar\n baz\n` results in a single TextElement "bar\n". That means resources with
12+
/// - `multiline_values.ftl`: <https://github.com/projectfluent/fluent-rs/issues/286>
13+
/// - `crlf.ftl`: Parsing `foo =\r\n bar\r\n baz\r\n` results in a `TextElement` "bar" and a `TextElement` "\n",
14+
/// whereas parsing `foo =\n bar\n baz\n` results in a single `TextElement` "bar\n". That means resources with
1515
/// text separated by CRLF do not roundtrip correctly.
1616
const IGNORE_LIST: [&str; 2] = ["crlf.ftl", "multiline_values.ftl"];
1717

fluent/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
7878
pub use fluent_bundle::*;
7979

80-
/// A helper macro to simplify creation of FluentArgs.
80+
/// A helper macro to simplify creation of `FluentArgs`.
8181
///
8282
/// # Example
8383
///

intl-memoizer/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! expensive (in terms of performance and memory) to construct a formatter, but then
33
//! relatively cheap to run the format operation.
44
//!
5-
//! The [IntlMemoizer] is the main struct that creates a per-locale [IntlLangMemoizer].
5+
//! The [`IntlMemoizer`] is the main struct that creates a per-locale [`IntlLangMemoizer`].
66
77
use std::cell::RefCell;
88
use std::collections::hash_map::Entry;
@@ -31,7 +31,7 @@ pub trait Memoizable {
3131

3232
/// The [`IntlLangMemoizer`] can memoize multiple constructed internationalization
3333
/// formatters, and their configuration for a single locale. For instance, given "en-US",
34-
/// a memorizer could retain 3 DateTimeFormat instances, and a PluralRules.
34+
/// a memorizer could retain 3 `DateTimeFormat` instances, and a `PluralRules`.
3535
///
3636
/// For memoizing with multiple locales, see [`IntlMemoizer`].
3737
///
@@ -190,8 +190,8 @@ impl IntlLangMemoizer {
190190
}
191191

192192
/// `with_try_get` means `with` an internationalization formatter, `try` and `get` a result.
193-
/// The (potentially expensive) constructor for the formatter (such as PluralRules or
194-
/// DateTimeFormat) will be memoized and only constructed once for a given
193+
/// The (potentially expensive) constructor for the formatter (such as `PluralRules` or
194+
/// `DateTimeFormat`) will be memoized and only constructed once for a given
195195
/// `construct_args`. After that the format operation can be run multiple times
196196
/// inexpensively.
197197
///

0 commit comments

Comments
 (0)