Skip to content

Add includeCharacters support to Node.js API #997

@kylejrp

Description

@kylejrp

Happy new year! 🎆 Hope you're doing well.

#779 (discussed in #775 / #773) introduced the include_characters option. Can this also be added to the NodeJS Index API? I only see these supported PagefindServiceConfig configuration options:

export interface PagefindServiceConfig {
/**
* The element Pagefind should treat as the root of the document, defaults to `html`.
* Usually you will want to use the data-pagefind-body attribute instead.
* @example ".my-html-outer"
*/
rootSelector?: string,
/**
* Custom selectors that Pagefind should ignore when indexing.
* Usually you will want to use the data-pagefind-ignore attribute instead.
* @example ["svg", ".my-code-blocks"]
*/
excludeSelectors?: string[],
/**
* Ignore any detected languages and index the whole site as a single language.
* Expects an ISO 639-1 code.
*/
forceLanguage?: string,
/**
* Print verbose logging while indexing the site. Does not impact the web-facing search.
* When running as a service, only impacts the logfile (if present).
*/
verbose?: boolean,
/**
* Path to a logfile to write to. Will replace the file on each run.
*/
logfile?: string,
/**
* Keep `index.html` at the end of search result paths.
* Defaults to false, stripping `index.html`.
*/
keepIndexUrl?: boolean,
/**
* When writing or outputting files, also write the Pagefind playground to /pagefind/playground/.
* Defaults to false, ensuring the playground isn't available on a live site.
*/
writePlayground?: boolean,
}

I'm using the Pagefind Node.js API on a personal project to index content containing programming code blocks and it would be nice if I could include these special characters from my code. 😄 I also tried setting a pagefind.yml file in the root of my project to see if it would pick it up from there, but it didn't seem to be effective.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions