Skip to content

Commit

Permalink
Auto merge of #3926 - Turbo87:cio-markdown, r=jtgeibel
Browse files Browse the repository at this point in the history
Extract `cio_markdown` subpackage

This allows us to isolate our markdown rendering code in a dedicated package, which could potentially have a positive effect on the compile times of the full project. It also means we can iterate on this part of the code independent from the other parts (see #3861 or #3297), and with a well-defined API interface.
  • Loading branch information
bors committed Sep 17, 2021
2 parents b948e62 + f9871c2 commit 2df42ae
Show file tree
Hide file tree
Showing 7 changed files with 593 additions and 566 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ jobs:

- name: Run tests (with coverage report)
if: matrix.rust == 'stable'
run: cargo tarpaulin --avoid-cfg-tarpaulin
run: cargo tarpaulin --avoid-cfg-tarpaulin --workspace

- name: Run tests
if: matrix.rust != 'stable'
run: cargo test
run: cargo test --workspace

- name: Prune unnecessary cache
run: script/ci/prune-cache.sh
Expand Down
14 changes: 11 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ rustdoc-args = [
]

[dependencies]
ammonia = "3.0.0"
anyhow = "1.0"
base64 = "0.13"
cargo-registry-s3 = { path = "src/s3", version = "0.2.0" }
chrono = { version = "0.4.0", features = ["serde"] }
cio_markdown = { path = "src/markdown" }
clap = "=3.0.0-beta.4"
comrak = { version = "0.10.1", default-features = false }

conduit = "0.9.0-alpha.5"
conduit-conditional-get = "0.9.0-alpha.3"
Expand All @@ -61,7 +60,6 @@ futures-util = "0.3"
git2 = "0.13.0"
handlebars = "4.1.3"
hex = "0.4"
htmlescape = "0.3.1"
http = "0.2"
hyper = { version = "0.14", features = ["client", "http1"] }
indexmap = { version = "1.0.2", features = ["serde-1"] }
Expand Down
2 changes: 1 addition & 1 deletion src/admin/render_readmes.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use crate::{
config, db,
models::Version,
render::readme_to_html,
schema::{crates, readme_renderings, versions},
uploaders::Uploader,
};
use std::{io::Read, path::Path, sync::Arc, thread};

use chrono::{TimeZone, Utc};
use cio_markdown::readme_to_html;
use clap::Clap;
use diesel::{dsl::any, prelude::*};
use flate2::read::GzDecoder;
Expand Down
18 changes: 18 additions & 0 deletions src/markdown/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]

name = "cio_markdown"
version = "0.0.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/crates.io"
description = "crates.io markdown renderer"
edition = "2018"
resolver = "2"

[lib]
path = "lib.rs"

[dependencies]
ammonia = "3.1.2"
comrak = { version = "0.10.1", default-features = false }
htmlescape = "0.3.1"
url = "2.2.2"
Loading

0 comments on commit 2df42ae

Please sign in to comment.