Skip to main content

resolve_entry_point

Function resolve_entry_point 

Source
pub fn resolve_entry_point<'a, I>(
    paths: I,
    manifest: Option<&Manifest>,
) -> Result<String>
where I: IntoIterator<Item = &'a str>,
Expand description

The archive’s primary Markdown file, by the ordered algorithm in Section 5.5.

  1. A manifest entryPoint is used if it’s a valid entry point path that matches a file. Otherwise this fails with ErrorCode::EntryPointInvalid or ErrorCode::EntryPointMissing; it never falls back silently.
  2. index.md at the archive root.
  3. The single root-level Markdown file, setting support files aside; or, if every root-level Markdown file is a support file and there’s exactly one, that file.
  4. Otherwise ErrorCode::EntryPointUnresolved.

paths are the archive’s entry names; directory entries (ending in /) are ignored. Returns the path as stored.