Skip to content

Commit

Permalink
docs(docsrs): scrape examples and fix links (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
timonv authored Jul 16, 2024
1 parent 143c7c9 commit d393181
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.0.0"
publish = false
edition = "2021"

[dev-dependencies]
[dependencies]
tokio = { version = "1.0", features = ["full"] }
swiftide = { path = "../swiftide/", features = [
"all",
Expand All @@ -16,29 +16,36 @@ serde_json = "1.0"
spider = "1.98"

[[example]]
doc-scrape-examples = true
name = "index-codebase"
path = "index_codebase.rs"

[[example]]
doc-scrape-examples = true
name = "fastembed"
path = "fastembed.rs"

[[example]]
doc-scrape-examples = true
name = "index-redis"
path = "index_into_redis.rs"

[[example]]
doc-scrape-examples = true
name = "index-markdown-metadata"
path = "index_markdown_lots_of_metadata.rs"

[[example]]
doc-scrape-examples = true
name = "scraping-index"
path = "scraping_index_to_markdown.rs"

[[example]]
doc-scrape-examples = true
name = "aws-bedrock"
path = "aws_bedrock.rs"

[[example]]
doc-scrape-examples = true
name = "store-multiple-vectors"
path = "store_multiple_vectors.rs"
1 change: 1 addition & 0 deletions swiftide/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,4 @@ multiple_crate_versions = "allow"

[package.metadata.docs.rs]
all-features = true
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
4 changes: 2 additions & 2 deletions swiftide/src/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ impl<'tmpl> PromptTemplate {
PromptTemplate::CompiledTemplate(name.into())
}

/// Extends the prompt repository with a custom [`terra::Tera`] instance.
/// Extends the prompt repository with a custom [`tera::Tera`] instance.
///
/// If you have your own prompt templates or want to add other functionality, you can extend
/// the repository with your own [`terra::Tera`] instance.
/// the repository with your own [`tera::Tera`] instance.
///
/// WARN: Do not use this inside a pipeline or any form of load, as it will lock the repository
///
Expand Down
2 changes: 1 addition & 1 deletion swiftide/src/transformers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! [`crate::integrations`] to be configured.
//!
//! Transformers that prompt have a default prompt configured. Prompts can be customized
//! and tailored, supporting Jinja style templating based on [`terra`]. See [`crate::prompt::Prompt`] and [`crate::prompt::PromptTemplate`]
//! and tailored, supporting Jinja style templating based on [`tera`]. See [`crate::prompt::Prompt`] and [`crate::prompt::PromptTemplate`]
#[cfg(feature = "tree-sitter")]
pub mod chunk_code;
Expand Down

0 comments on commit d393181

Please sign in to comment.