Skip to content

Added get_component_names and contains_component_definition.#993

Open
tobiastom wants to merge 1 commit into
Keats:masterfrom
tobiastom:feature/get_component_names
Open

Added get_component_names and contains_component_definition.#993
tobiastom wants to merge 1 commit into
Keats:masterfrom
tobiastom:feature/get_component_names

Conversation

@tobiastom

Copy link
Copy Markdown

I needed to get the names of all components that are registered. This pull request adds similar methods to the ones that exist for getting templates without exposing the components.

Hope this looks good to you.

Comment thread tera/src/tera.rs
}

/// Lookups a component by name, returning whether it's found or not
pub fn contains_component_definition(&self, component_name: &str) -> bool {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contains_component_definition -> contains_component.

Can you add an example as well? It can be almost copied from the one below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants