Skip to content

Commit

Permalink
docs: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 30, 2021
1 parent f7b7859 commit fdc6fc0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion 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 @@ -29,6 +29,7 @@ csv = "1.1"

walkdir = "2"

# time convert
chrono = "0.4"

# Termnial ui
Expand Down Expand Up @@ -66,9 +67,6 @@ syntect = { version = "4.2", default-features = false, features = ["default-fanc

zip = "0.5"

[features]
webserver = []

[workspace]
members = [
'quake_core',
Expand Down
1 change: 1 addition & 0 deletions examples/entries-define.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ entries:
actions: ~
- type: papers
display: ""
custom_path: "../../papers"
processors:
file_engines: ['pdf', 'mobi', 'epub']
properties:
Expand Down
2 changes: 1 addition & 1 deletion libs/quake_processor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "quake_pdf"
name = "quake_processor"
version = "0.1.0"
edition = "2021"

Expand Down
6 changes: 3 additions & 3 deletions libs/quake_processor/src/pdf_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::Path;

use pdf_extract::extract_text;

pub fn pdf_file_to_content(file: &Path) -> Result<String, Box<dyn Error>> {
pub fn pdf_to_content(file: &Path) -> Result<String, Box<dyn Error>> {
let path = path::Path::new(&file);
let string = extract_text(path)?;
Ok(string)
Expand All @@ -14,12 +14,12 @@ pub fn pdf_file_to_content(file: &Path) -> Result<String, Box<dyn Error>> {
mod tests {
use std::path::PathBuf;

use crate::pdf_processor::pdf_file_to_content;
use crate::pdf_processor::pdf_to_content;

#[test]
fn it_works() {
let file = PathBuf::from("_fixtures").join("Test_PDF.pdf");
match pdf_file_to_content(&file) {
match pdf_to_content(&file) {
Err(err) => {
println!("{:?}", err);
panic!();
Expand Down
3 changes: 3 additions & 0 deletions quake_core/src/entry/entry_define.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ pub struct EntryDefine {
#[serde(rename = "type")]
pub entry_type: String,
pub display: String,
/// custom path for entries
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_path: Option<String>,
pub properties: Vec<IndexMap<String, String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub actions: Option<Vec<String>>,
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ async fn init_projects(config: Init) -> Result<(), Box<dyn Error>> {
Ok(())
}

fn unzip_all(reader: Cursor<Vec<u8>>, plugins_path: &Path) -> Result<(), Box<dyn Error>> {
fn unzip_all(reader: Cursor<Vec<u8>>, workspace: &Path) -> Result<(), Box<dyn Error>> {
let mut archive = zip::ZipArchive::new(reader)?;

for i in 0..archive.len() {
let mut file = archive.by_index(i)?;
let out_path = match file.enclosed_name() {
Some(path) => plugins_path.join(path),
Some(path) => workspace.join(path),
None => continue,
};

Expand Down

0 comments on commit fdc6fc0

Please sign in to comment.