GithubHelp home page GithubHelp logo

readme-sync's People

Contributors

zheland avatar

Watchers

 avatar

readme-sync's Issues

Write Output

It can be useful to write the expected output to a file instead of using assert_sync to only check for differences.
I wasn't able to find a way to do this.

Transform Links

I wasn't able to get readme-sync to do any transformation of links. Here is a minimal example.

Cargo.toml:

[package]
name = "test-readme-sync"
version = "0.0.0"
edition = "2021"
publish = false
documentation = "https://docs.rs/test-readme-sync"
repository = "https://github.com/daxpedda/test-readme-sync"

[dev-dependencies]
readme-sync = "0.2"

lib.rs:

//! Test
//! [`Test`]
//! [`Test`](crate::Test)
//! [Test]
//!
//! [Test]: crate::Test

pub struct Test;

#[test]
fn readme_sync_test() {
    use readme_sync::{assert_sync, CMarkDocs, CMarkReadme, Config, Package};

    let package = Package::from_path(env!("CARGO_MANIFEST_DIR").into()).unwrap();
    let config = Config::from_package_docs_rs_features(&package);
    let readme = CMarkReadme::from_package(&package).unwrap();
    let docs = CMarkDocs::from_package_and_config(&package, &config).unwrap();

    let readme = readme
        .remove_badges_paragraph()
        .remove_documentation_section()
        .remove_codeblock_tag("no_sync")
        .disallow_absolute_repository_blob_links()
        .unwrap()
        .use_absolute_repository_blob_urls()
        .unwrap();

    let docs = docs
        .increment_heading_levels()
        .add_package_title()
        .remove_codeblock_rust_test_tags()
        .use_default_codeblock_rust_tag()
        .remove_hidden_rust_code()
        .disallow_absolute_package_docs_links()
        .unwrap()
        .use_absolute_package_docs_urls()
        .unwrap();

    assert_sync(&readme, &docs);
}

README.md:

# test-readme-sync

Test
[`Test`]
[`Test`](crate::Test)
[Test]

[Test]: crate::Test

I expected the test to fail, because of use_absolute_package_docs_urls, but it succeeds instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.