Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code snippet #201

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "semantic-ui-ember",
"dependencies": {
"highlightjs": "^9.4.0",
"semantic-ui": "2.2.11"
}
}
6 changes: 2 additions & 4 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module.exports = function(defaults) {
// Add options here
'ember-cli-babel': {
includePolyfill: false
}
},
snippetSearchPaths: ['tests/dummy/app']
});

/*
Expand All @@ -17,9 +18,6 @@ module.exports = function(defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

// Import Highlight.js
app.import(app.bowerDirectory + "/highlightjs/highlight.pack.min.js");

app.import(app.bowerDirectory + "/highlightjs/styles/github-gist.css");
app.import(app.bowerDirectory + "/highlightjs/styles/hybrid.css");
Copy link
Contributor

Choose a reason for hiding this comment

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

If highlightjs is gone are these necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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


Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"ember-cli-shims": "^1.0.2",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-code-snippet": "^1.9.0",
"ember-composable-helpers": "2.0.3",
"ember-disable-prototype-extensions": "^1.1.0",
"ember-export-application-global": "2.0.0",
Expand Down
6 changes: 6 additions & 0 deletions tests/dummy/app/components/ui-code-snippet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Ember from 'ember';

export default Ember.Component.extend({
classNames: ['annotation', 'transition'],
classNameBindings: ['showing:visible:hidden']
});
3 changes: 3 additions & 0 deletions tests/dummy/app/templates/components/ui-code-snippet.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="ui instructive bottom attached segment">
{{code-snippet name=name}}
</div>
25 changes: 6 additions & 19 deletions tests/dummy/app/templates/modules/sidebar.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


<div class="ui masthead vertical segment">
<div class="ui container">
<div class="introduction">
Expand Down Expand Up @@ -35,7 +37,8 @@
as |showing setCopyCode|}}

{{#ui-html showing=showing}}
<div class="ui button" {{action 'toggle' 'sub-sidebar'}}>
{{! BEGIN-SNIPPET sidebar.example }}
<div class="ui button" {{action "toggle" "sub-sidebar"}}>
Toggle
</div>
<div class="ui pushable segment component context">
Expand All @@ -50,26 +53,10 @@
</div>
</div>
</div>
{{! END-SNIPPET }}
{{/ui-html}}

{{#ui-annotation showing=showing setCopyCode=setCopyCode}}
<div class="ui button" onclick="\{{action 'toggle' 'sub-sidebar'}}">
Toggle
</div>
<div class="ui pushable segment component context">
\{{#ui-sidebar class="inverted menu left inline vertical" context=".component.context" id="sub-sidebar"}}
<a class="item">Item 1</a>
<a class="item">Item 2</a>
<a class="item">Item 3</a>
\{{/ui-sidebar}}
<div class="pusher">
<div class="ui basic segment" style="min-height: 300px;">
Sub Content Here
</div>
</div>
</div>
{{/ui-annotation}}

{{ui-code-snippet showing=showing name="sidebar.example.hbs"}}
{{/ui-example}}

</div>