From 859a9e6f080d29575ae4107f2503523d4de7032c Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 6 Aug 2014 16:42:26 -0700 Subject: [PATCH] Fix Markdown syntax in doc comments --- from_bytes.rs | 40 +++++++++++++++------------------------- parser.rs | 8 ++++---- tokenizer.rs | 2 +- 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/from_bytes.rs b/from_bytes.rs index 0940366c..f6815f1f 100644 --- a/from_bytes.rs +++ b/from_bytes.rs @@ -14,22 +14,16 @@ use parser::{parse_stylesheet_rules, StylesheetParser}; /// Determine the character encoding of a CSS stylesheet and decode it. /// -/// This is based on the presence of a :abbr:`BOM (Byte Order Mark)`, -/// an `@charset` rule, -/// and encoding meta-information. +/// This is based on the presence of a BOM (Byte Order Mark), an `@charset` rule, and +/// encoding meta-information. /// -/// :param css_bytes: A byte string. -/// :param protocol_encoding: -/// The encoding label, if any, defined by HTTP or equivalent protocol. +/// * `css_bytes`: A byte string. +/// * `protocol_encoding`: The encoding label, if any, defined by HTTP or equivalent protocol. /// (e.g. via the `charset` parameter of the `Content-Type` header.) -/// :param environment_encoding: -/// An optional `Encoding` object -/// for the `environment encoding -/// `_, -/// if any. -/// :returns: -/// A 2-tuple of a decoded Unicode string -/// and the `Encoding` object that was used. +/// * `environment_encoding`: An optional `Encoding` object for the [environment encoding] +/// (http://www.w3.org/TR/css-syntax/#environment-encoding), if any. +/// +/// Returns a 2-tuple of a decoded Unicode string and the `Encoding` object that was used. pub fn decode_stylesheet_bytes(css: &[u8], protocol_encoding_label: Option<&str>, environment_encoding: Option) -> (String, EncodingRef) { @@ -78,18 +72,14 @@ fn decode_replace(input: &[u8], fallback_encoding: EncodingRef)-> (String, Encod /// Parse stylesheet from bytes. /// -/// :param css_bytes: A byte string. -/// :param protocol_encoding: -/// The encoding label, if any, defined by HTTP or equivalent protocol. +/// * `css_bytes`: A byte string. +/// * `protocol_encoding`: The encoding label, if any, defined by HTTP or equivalent protocol. /// (e.g. via the `charset` parameter of the `Content-Type` header.) -/// :param environment_encoding: -/// An optional `Encoding` object -/// for the `environment encoding -/// `_, -/// if any. -/// :returns: -/// A 2-tuple of a Iterator> -/// and the `Encoding` object that was used. +/// * `environment_encoding`: An optional `Encoding` object for the [environment encoding] +/// (http://www.w3.org/TR/css-syntax/#environment-encoding), if any. +/// +/// Returns a 2-tuple of a `Iterator>` +/// and the `Encoding` object that was used. pub fn parse_stylesheet_rules_from_bytes( css_bytes: &[u8], protocol_encoding_label: Option<&str>, environment_encoding: Option) diff --git a/parser.rs b/parser.rs index fa490c8a..3a602050 100644 --- a/parser.rs +++ b/parser.rs @@ -4,7 +4,7 @@ // http://dev.w3.org/csswg/css-syntax/#parsing -/// The input to these functions needs to implement Iterator<(ComponentValue, SourceLocation)>. +/// The input to these functions needs to implement `Iterator<(ComponentValue, SourceLocation)>`. /// The input is consumed to avoid doing a lot of copying. /// A conforming input can be obtained: /// @@ -25,7 +25,7 @@ pub struct RuleListParser{ iter: T } pub struct DeclarationListParser{ iter: T } /// Parse top-level of a CSS stylesheet. -/// Return a Iterator> +/// Return a `Iterator>` #[inline] pub fn parse_stylesheet_rules>(iter: T) -> StylesheetParser { StylesheetParser{ iter: iter } @@ -33,7 +33,7 @@ pub fn parse_stylesheet_rules>(iter: T) -> StylesheetParser /// Parse a non-top level list of rules eg. the content of an @media rule. -/// Return a Iterator> +/// Return a `Iterator>` #[inline] pub fn parse_rule_list>(iter: T) -> RuleListParser { RuleListParser{ iter: iter } @@ -42,7 +42,7 @@ pub fn parse_rule_list>(iter: T) -> RuleListParser { /// Parse a list of declarations and at-rules, /// like @page in CSS 2.1, all declaration lists in level 3 -/// Return a Iterator> +/// Return a `Iterator>` #[inline] pub fn parse_declaration_list>(iter: T) -> DeclarationListParser { DeclarationListParser{ iter: iter } diff --git a/tokenizer.rs b/tokenizer.rs index 7294e0eb..b1335bbb 100644 --- a/tokenizer.rs +++ b/tokenizer.rs @@ -10,7 +10,7 @@ use std::ascii::StrAsciiExt; use ast::*; -/// Returns a Iterator<(ComponentValue, SourceLocation)> +/// Returns a `Iterator<(ComponentValue, SourceLocation)>` pub fn tokenize(input: &str) -> Tokenizer { let input = preprocess(input); Tokenizer {