Skip to content

Allow caller to specify language when rendering code-snippet from handlebars template #38

@samselikoff

Description

@samselikoff

I have a HBS template and I want to show a diff, which I would normally use ```diff for (github fences). Here's my template:

{{#docs-snippet name="your-snippet-name"}}
  model() {
-   return this.get('store').findAll('post');
+   return this.get('storefront').findAll('post');
  }

  model() {
-   return this.get('store').findRecord('post', 1);
+   return this.get('storefront').findRecord('post', 1);
  }
{{/docs-snippet}}

This works but I want to be able to say, "this snippet is actually a diff snippet (or a ruby snippet, etc.)". Perhaps a lang="diff" option to the {{docs-snippet}} component.

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