Fix building without parsers

[?]
Jan 13, 2021, 3:34 AM
KP6SZZ346AU4MCK2EZK3WHGGGNDMUGX7AG4CBYKVO4HZMUYRBU6AC

Dependencies

  • [2] Y55SCAUN Finish gemtext parsing implementation
  • [3] BOFUYB6I Add documentation and implement some feedback from Discord (https://discord.com/channels/273534239310479360/354038657075904544/796256815024701480)
  • [4] JBZGFYVO Add nom parsers for main types
  • [5] J4PKMKJX Add root doc comment, gemtext module
  • [6] K37J3USB Add WIP gemtext parsers
  • [*] 5II6T7YE Add gemini library

Change contents

  • replacement in gemini/src/lib.rs at line 70
    [3.3370][2.0:32]()
    pub use gemtext::parse_gemtext;
    [3.3370]
    [3.3370]
    #[cfg(feature = "parsers")]
    pub use gemtext::parse::document as parse_gemtext;
    #[cfg(feature = "parsers")]
  • edit in gemini/src/gemtext.rs at line 195
    [3.5806][3.5806:5930](),[3.5930][2.683:757](),[2.757][3.5991:6408](),[3.5991][3.5991:6408](),[3.6408][2.758:781](),[2.781][3.6427:6653](),[3.6427][3.6427:6653]()
    }
    }
    #[cfg(test)]
    mod test {
    use super::*;
    #[test]
    pub fn test_builder() {
    let doc = Builder::new()
    .preformatted(Some("logo"), "wooo\n/^^^^\\\n| |\n\\____/")
    .line()
    .h1("GAZE INTO THE SPHERE!")
    .line()
    .text("critics are raving")
    .quote("i love the sphere - bort")
    .quote("the sphere gives me purpose - frelvin")
    .line()
    .list(vec!["always", "trust", "the sphere"])
    .link("gemini://sphere.gaze", Some("gaze more here"));
    assert_eq!(
    doc.build(),
    r#"```logo
    wooo
    /^^^^\
    | |
    \____/
    ```
    # GAZE INTO THE SPHERE!
    critics are raving
    > i love the sphere - bort
    > the sphere gives me purpose - frelvin
    * always
    * trust
    * the sphere
    => gemini://sphere.gaze gaze more here
    "#
    )
  • edit in gemini/src/gemtext.rs at line 198
    [3.134]
    [3.134]
    /// Parser
  • replacement in gemini/src/gemtext.rs at line 200
    [3.162][3.162:174]()
    mod parse {
    [3.162]
    [3.174]
    pub mod parse {
  • replacement in gemini/src/gemtext.rs at line 314
    [2.3566][2.3566:3608]()
    pub use parse::document as parse_gemtext;
    [2.3566]
    #[cfg(test)]
    mod test {
    use super::*;
    #[test]
    pub fn test_builder() {
    let doc = Builder::new()
    .preformatted(Some("logo"), "wooo\n/^^^^\\\n| |\n\\____/")
    .line()
    .h1("GAZE INTO THE SPHERE!")
    .line()
    .text("critics are raving")
    .quote("i love the sphere - bort")
    .quote("the sphere gives me purpose - frelvin")
    .line()
    .list(vec!["always", "trust", "the sphere"])
    .link("gemini://sphere.gaze", Some("gaze more here"));
    assert_eq!(
    doc.build(),
    r#"```logo
    wooo
    /^^^^\
    | |
    \____/
    ```
    # GAZE INTO THE SPHERE!
    critics are raving
    > i love the sphere - bort
    > the sphere gives me purpose - frelvin
    * always
    * trust
    * the sphere
    => gemini://sphere.gaze gaze more here
    "#
    )
    }
    }