Skip to content

Commit 3efae81

Browse files
committed
Update snippet names
1 parent 98efdbd commit 3efae81

File tree

24 files changed

+92
-96
lines changed

24 files changed

+92
-96
lines changed

addon/components/docs-demo/x-live-example/component.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export default Component.extend({
1111

1212
// Set initial template from snippet
1313
let name = this.get('name');
14-
15-
// We support either .hbs snippets or .md
16-
let rawTemplate = snippets[`${name}.hbs`] || snippets[`${name}.md`];
14+
let rawTemplate = snippets[name] || '';
1715

1816
this.set('rawTemplate', this._unindent(rawTemplate));
1917

tests/dummy/app/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Resolver from './resolver';
33
import loadInitializers from 'ember-load-initializers';
44
import config from './config/environment';
55

6-
// BEGIN-SNIPPET sample-snippet
6+
// BEGIN-SNIPPET sample-snippet.js
77
const App = Application.extend({
88
modulePrefix: config.modulePrefix,
99
podModulePrefix: config.podModulePrefix,

tests/dummy/app/pods/application/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{! BEGIN-SNIPPET docs-demo-application-template }}
1+
{{! BEGIN-SNIPPET docs-demo-application-template.hbs }}
22
{{outlet}}
33

44
{{docs-keyboard-shortcuts}}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
import Controller from '@ember/controller';
1+
import Controller from "@ember/controller";
22

33
export default Controller.extend({
4-
54
actions: {
6-
// BEGIN-SNIPPET docs-demo-multiple
75
toggleIsShowing() {
8-
this.toggleProperty('isShowing');
6+
this.toggleProperty("isShowing");
97
}
10-
// END-SNIPPET
118
}
12-
139
});

tests/dummy/app/pods/docs/components/docs-demo/demo1/template.hbs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
{{! BEGIN-SNIPPET docs-demo-basic-src }}
1+
{{! BEGIN-SNIPPET docs-demo-basic-src.hbs }}
22
{{#docs-demo as |demo|}}
3-
{{#demo.example name='docs-demo-basic'}}
4-
<p>I am a <strong>handlebars</strong> template!</p>
5-
<p>The value is: {{val}}</p>
6-
<div>
7-
{{input value=val}}
8-
</div>
3+
{{#demo.example name='docs-demo-basic.hbs'}}
4+
<p>I am a <strong>handlebars</strong> template!</p>
5+
<p>The value is: {{val}}</p>
6+
<div>
7+
{{input value=val}}
8+
</div>
99
{{/demo.example}}
1010

1111
{{demo.snippet 'docs-demo-basic.hbs'}}
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import Component from '@ember/component';
1+
import Component from "@ember/component";
22

33
export default Component.extend({
4-
54
actions: {
6-
// BEGIN-SNIPPET docs-demo-multiple
5+
// BEGIN-SNIPPET docs-demo-multiple.js
76
toggleIsShowing() {
8-
this.toggleProperty('isShowing');
7+
this.toggleProperty("isShowing");
98
}
109
// END-SNIPPET
1110
}
12-
1311
});

tests/dummy/app/pods/docs/components/docs-demo/demo2/template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{#docs-demo as |demo|}}
2-
{{#demo.example data-test-id='docs-demo-multiple'}}
3-
{{!-- BEGIN-SNIPPET docs-demo-multiple --}}
2+
{{#demo.example data-test-id='docs-demo-multiple.hbs'}}
3+
{{!-- BEGIN-SNIPPET docs-demo-multiple.hbs --}}
44
<button onclick={{action 'toggleIsShowing'}}>
55
Press me!
66
</button>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
{{!-- BEGIN-SNIPPET docs-demo-custom-src --}}
1+
{{!-- BEGIN-SNIPPET docs-demo-custom-src.hbs --}}
22
{{#docs-demo as |demo|}}
3-
{{#demo.example name='docs-demo-custom'}}
3+
{{#demo.example name='docs-demo-custom.md'}}
44
<pre>
55
# Markdown
66
- Has syntax highlighting, too
77
</pre>
88
{{/demo.example}}
99

1010
{{demo.snippet 'docs-demo-custom-src.hbs' label='Source'}}
11-
{{demo.snippet 'docs-demo-custom.hbs' label='My Custom Label' language='markdown'}}
11+
{{demo.snippet 'docs-demo-custom.md' label='My Custom Label' language='markdown'}}
1212
{{/docs-demo}}
1313
{{!-- END-SNIPPET --}}

tests/dummy/app/pods/docs/components/docs-demo/demo4/template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{{! BEGIN-SNIPPET live-example-src }}
1+
{{! BEGIN-SNIPPET live-example-src.hbs }}
22
{{#docs-demo as |demo|}}
3-
{{#demo.live-example name='live-example'}}
3+
{{#demo.live-example name='live-example.hbs'}}
44
<p>The air up here is {{foo}}</p>
55

66
{{input value=foo}}

tests/dummy/app/pods/docs/components/docs-hero/demo/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{#docs-demo as |demo|}}
2-
{{#demo.example name='docs-hero'}}
2+
{{#demo.example name='docs-hero.hbs'}}
33
{{docs-hero
44
logo='ember'
55
slim-heading='Super'

0 commit comments

Comments
 (0)