Skip to content

Commit b03c3f6

Browse files
committed
Merge pull request #56 from mbrubeck/rustdoc
Fix Markdown syntax in doc comments
2 parents 64c3ee2 + 859a9e6 commit b03c3f6

File tree

3 files changed

+20
-30
lines changed

3 files changed

+20
-30
lines changed

from_bytes.rs

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,16 @@ use parser::{parse_stylesheet_rules, StylesheetParser};
1414

1515
/// Determine the character encoding of a CSS stylesheet and decode it.
1616
///
17-
/// This is based on the presence of a :abbr:`BOM (Byte Order Mark)`,
18-
/// an `@charset` rule,
19-
/// and encoding meta-information.
17+
/// This is based on the presence of a BOM (Byte Order Mark), an `@charset` rule, and
18+
/// encoding meta-information.
2019
///
21-
/// :param css_bytes: A byte string.
22-
/// :param protocol_encoding:
23-
/// The encoding label, if any, defined by HTTP or equivalent protocol.
20+
/// * `css_bytes`: A byte string.
21+
/// * `protocol_encoding`: The encoding label, if any, defined by HTTP or equivalent protocol.
2422
/// (e.g. via the `charset` parameter of the `Content-Type` header.)
25-
/// :param environment_encoding:
26-
/// An optional `Encoding` object
27-
/// for the `environment encoding
28-
/// <http://www.w3.org/TR/css-syntax/#environment-encoding>`_,
29-
/// if any.
30-
/// :returns:
31-
/// A 2-tuple of a decoded Unicode string
32-
/// and the `Encoding` object that was used.
23+
/// * `environment_encoding`: An optional `Encoding` object for the [environment encoding]
24+
/// (http://www.w3.org/TR/css-syntax/#environment-encoding), if any.
25+
///
26+
/// Returns a 2-tuple of a decoded Unicode string and the `Encoding` object that was used.
3327
pub fn decode_stylesheet_bytes(css: &[u8], protocol_encoding_label: Option<&str>,
3428
environment_encoding: Option<EncodingRef>)
3529
-> (String, EncodingRef) {
@@ -78,18 +72,14 @@ fn decode_replace(input: &[u8], fallback_encoding: EncodingRef)-> (String, Encod
7872

7973
/// Parse stylesheet from bytes.
8074
///
81-
/// :param css_bytes: A byte string.
82-
/// :param protocol_encoding:
83-
/// The encoding label, if any, defined by HTTP or equivalent protocol.
75+
/// * `css_bytes`: A byte string.
76+
/// * `protocol_encoding`: The encoding label, if any, defined by HTTP or equivalent protocol.
8477
/// (e.g. via the `charset` parameter of the `Content-Type` header.)
85-
/// :param environment_encoding:
86-
/// An optional `Encoding` object
87-
/// for the `environment encoding
88-
/// <http://www.w3.org/TR/css-syntax/#environment-encoding>`_,
89-
/// if any.
90-
/// :returns:
91-
/// A 2-tuple of a Iterator<Result<Rule, SyntaxError>>
92-
/// and the `Encoding` object that was used.
78+
/// * `environment_encoding`: An optional `Encoding` object for the [environment encoding]
79+
/// (http://www.w3.org/TR/css-syntax/#environment-encoding), if any.
80+
///
81+
/// Returns a 2-tuple of a `Iterator<Result<Rule, SyntaxError>>`
82+
/// and the `Encoding` object that was used.
9383
pub fn parse_stylesheet_rules_from_bytes(
9484
css_bytes: &[u8], protocol_encoding_label: Option<&str>,
9585
environment_encoding: Option<EncodingRef>)

parser.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// http://dev.w3.org/csswg/css-syntax/#parsing
66

7-
/// The input to these functions needs to implement Iterator<(ComponentValue, SourceLocation)>.
7+
/// The input to these functions needs to implement `Iterator<(ComponentValue, SourceLocation)>`.
88
/// The input is consumed to avoid doing a lot of copying.
99
/// A conforming input can be obtained:
1010
///
@@ -25,15 +25,15 @@ pub struct RuleListParser<T>{ iter: T }
2525
pub struct DeclarationListParser<T>{ iter: T }
2626

2727
/// Parse top-level of a CSS stylesheet.
28-
/// Return a Iterator<Result<Rule, SyntaxError>>
28+
/// Return a `Iterator<Result<Rule, SyntaxError>>`
2929
#[inline]
3030
pub fn parse_stylesheet_rules<T: Iterator<Node>>(iter: T) -> StylesheetParser<T> {
3131
StylesheetParser{ iter: iter }
3232
}
3333

3434

3535
/// Parse a non-top level list of rules eg. the content of an @media rule.
36-
/// Return a Iterator<Result<Rule, SyntaxError>>
36+
/// Return a `Iterator<Result<Rule, SyntaxError>>`
3737
#[inline]
3838
pub fn parse_rule_list<T: Iterator<Node>>(iter: T) -> RuleListParser<T> {
3939
RuleListParser{ iter: iter }
@@ -42,7 +42,7 @@ pub fn parse_rule_list<T: Iterator<Node>>(iter: T) -> RuleListParser<T> {
4242

4343
/// Parse a list of declarations and at-rules,
4444
/// like @page in CSS 2.1, all declaration lists in level 3
45-
/// Return a Iterator<Result<DeclarationListItem, SyntaxError>>
45+
/// Return a `Iterator<Result<DeclarationListItem, SyntaxError>>`
4646
#[inline]
4747
pub fn parse_declaration_list<T: Iterator<Node>>(iter: T) -> DeclarationListParser<T> {
4848
DeclarationListParser{ iter: iter }

tokenizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::ascii::StrAsciiExt;
1010
use ast::*;
1111

1212

13-
/// Returns a Iterator<(ComponentValue, SourceLocation)>
13+
/// Returns a `Iterator<(ComponentValue, SourceLocation)>`
1414
pub fn tokenize(input: &str) -> Tokenizer {
1515
let input = preprocess(input);
1616
Tokenizer {

0 commit comments

Comments
 (0)