Skip to content

Commit

Permalink
some cleanup/fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-i-m committed Feb 3, 2020
1 parent adc8cd9 commit 5e086c8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/tools/rustbook/src/main.rs
Expand Up @@ -8,9 +8,6 @@ use clap::{App, AppSettings, ArgMatches, SubCommand};
use mdbook::errors::Result as Result3;
use mdbook::MDBook;

#[cfg(feature = "linkcheck")]
use mdbook::renderer::RenderContext;

fn main() {
let d_message = "-d, --dest-dir=[dest-dir]
'The output directory for your book{n}(Defaults to ./book when omitted)'";
Expand Down Expand Up @@ -87,14 +84,12 @@ pub fn linkcheck(
use mdbook_linkcheck::Reason;

let book_dir = get_book_dir(args);
let src_dir = get_book_dir(args).join("src");
let src_dir = book_dir.join("src");
let book = MDBook::load(&book_dir).unwrap();
let linkck_cfg = mdbook_linkcheck::get_config(&book.config)?;
let mut files = codespan::Files::new();
let target_files = mdbook_linkcheck::load_files_into_memory(&book.book, &mut files);
let render_ctx = RenderContext::new(&book_dir, book.book, book.config, &book_dir);
let cache_file = render_ctx.destination.join("cache.json");
let cache = mdbook_linkcheck::Cache::load(std::fs::File::open(cache_file)?)?;
let cache = mdbook_linkcheck::Cache::default();

let (links, incomplete) = mdbook_linkcheck::extract_links(target_files, &files);

Expand Down

0 comments on commit 5e086c8

Please sign in to comment.