MCPcopy Create free account
hub / github.com/PerroEngine/Perro / doc_keywords

Function doc_keywords

perro_website/build.rs:420–452  ·  view source on GitHub ↗
(
    slug: &str,
    title: &str,
    area: &str,
    summary: &str,
    headings: &[HeadingOut],
)

Source from the content-addressed store, hash-verified

418 }
419 Ok(())
420}
421
422fn push_doc(collection: &str, path: &Path, slug: String, out: &mut Vec<DocOut>) -> io::Result<()> {
423 push_doc_with_link_slug(collection, path, slug.clone(), slug, out)
424}
425
426fn push_doc_with_link_slug(
427 collection: &str,
428 path: &Path,
429 slug: String,
430 link_slug: String,
431 out: &mut Vec<DocOut>,
432) -> io::Result<()> {
433 let raw_markdown = fs::read_to_string(path)?;
434 let markdown = rewrite_markdown_links(collection, &link_slug, &raw_markdown);
435 let title = first_title(&markdown).unwrap_or_else(|| title_from_slug(&slug));
436 let area = if collection == "book" {
437 "book".to_string()
438 } else {
439 slug.split('/').next().unwrap_or("docs").to_string()
440 };
441 let is_history = is_history_page(collection, &slug);
442 let nav_group = nav_group(collection, &slug, is_history).to_string();
443 let route_path = route_path(collection, &slug);
444 let summary = first_para(&markdown);
445 let headings = headings(&markdown);
446 let html = markdown_html(&markdown);
447 let keywords = doc_keywords(&slug, &title, &area, &summary, &headings);
448 let search_text = search_text(&slug, &title, &summary, &headings, &markdown);
449 out.push(DocOut {
450 collection: collection.to_string(),
451 slug,
452 route_path,
453 title,
454 area,
455 nav_group,

Callers 1

push_docFunction · 0.85

Calls 7

dedupe_joinFunction · 0.85
extendMethod · 0.80
cloneMethod · 0.80
is_emptyMethod · 0.45
iterMethod · 0.45
containsMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected