Skip to content

Commit 9bab07c

Browse files
Use postcss for sass, convert to angle brackets, update highlight.js (#668)
* Bump deps, remove sass, update highlight.js * Convert to angle brackets * Install postcss * Fix postcss setup * Fix some tests
1 parent 4816b0a commit 9bab07c

File tree

30 files changed

+1514
-1659
lines changed

30 files changed

+1514
-1659
lines changed

.prettierrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
module.exports = {
44
singleQuote: true,
5+
trailingComma: 'none',
56
overrides: [
67
{
78
files: '**/*.hbs',

addon/components/api/x-class/template.hbs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,37 @@
44
<div data-test-class-description>{{{class.description}}}</div>
55

66
{{#if (or (and class.exportType showImportPaths) hasToggles)}}
7-
{{#api/x-meta-panel as |panel|}}
7+
<Api::XMetaPanel as |panel|>
88
{{#if class.exportType}}
9-
{{#panel.header}}
9+
<panel.header>
1010
Import Path
11-
{{/panel.header}}
11+
</panel.header>
1212

13-
{{api/x-import-path item=class}}
13+
<Api::XImportPath @item={{class}} />
1414
{{/if}}
1515

1616
{{#if hasToggles}}
17-
{{#panel.header}}
17+
<panel.header>
1818
Show
19-
{{/panel.header}}
19+
</panel.header>
2020

2121
{{#if hasToggles}}
22-
{{api/x-toggles
23-
toggles=(hash
22+
<Api::XToggles @toggles={{hash
2423
inherited=(if class.hasInherited showInherited)
2524
protected=(if class.hasProtected showProtected)
2625
private=(if class.hasPrivate showPrivate)
2726
deprecated=(if class.hasDeprecated showDeprecated)
28-
)
29-
}}
27+
}} />
3028
{{/if}}
3129
{{/if}}
32-
{{/api/x-meta-panel}}
30+
</Api::XMetaPanel>
3331
{{/if}}
3432

3533
{{#if hasContents}}
36-
{{api/x-sections
37-
sections=(hash
34+
<Api::XSections @sections={{hash
3835
constructors=class.constructors
3936
fields=class.fields
4037
accessors=class.accessors
4138
methods=class.methods
42-
)
43-
}}
39+
}} />
4440
{{/if}}
Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,34 @@
1-
<h1 class="docs-h1" data-test-component-name>{{component.name}}</h1>
1+
<h1 class="docs-h1" data-test-component-name>{{@component.name}}</h1>
22

33
{{! wrapping in a div seems to work around https://github.com/ember-learn/ember-cli-addon-docs/issues/7 }}
4-
<div data-test-component-name>{{{component.description}}}</div>
4+
<div data-test-component-name>{{{@component.description}}}</div>
55

66
{{#if hasToggles}}
7-
{{#api/x-meta-panel as |panel|}}
8-
{{#panel.header}}
7+
<Api::XMetaPanel as |panel|>
8+
<panel.header>
99
Show
10-
{{/panel.header}}
10+
</panel.header>
1111

1212
{{#if hasToggles}}
13-
{{api/x-toggles
14-
toggles=(hash
13+
<Api::XToggles @toggles={{hash
1514
inherited=(if component.hasInherited showInherited)
1615
internal=(if component.hasInternal showInternal)
1716
protected=(if component.hasProtected showProtected)
1817
private=(if component.hasPrivate showPrivate)
1918
deprecated=(if component.hasDeprecated showDeprecated)
20-
)
21-
22-
onToggle=(action "updateFilter")
23-
}}
19+
}} @onToggle={{action "updateFilter"}} />
2420
{{/if}}
25-
{{/api/x-meta-panel}}
21+
</Api::XMetaPanel>
2622
{{/if}}
2723

2824

2925
{{#if hasContents}}
30-
{{api/x-sections
31-
sections=(hash
26+
<Api::XSections @sections={{hash
3227
constructors=constructors
3328
yields=yields
3429
arguments=arguments
3530
fields=fields
3631
accessors=accessors
3732
methods=methods
38-
)
39-
}}
33+
}} />
4034
{{/if}}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
{{api/x-sections
2-
sections=(hash
1+
<Api::XSections @sections={{hash
32
classes=module.classes
43
components=module.components
54
functions=module.functions
65
variables=module.variables
7-
)
8-
}}
6+
}} />

addon/components/api/x-section/template.hbs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
{{/if}}
1313

1414
{{#if (or item.isClass item.isComponent)}}
15-
{{#link-to "docs.api.item" (concat "modules/" item.id) class="hover:underline"}}
15+
<LinkTo @route="docs.api.item" @model={{concat "modules/" item.id}} class="hover:underline">
1616
<strong>{{item.name}}</strong>
17-
{{/link-to}}
17+
</LinkTo>
1818
{{else}}
1919
<a href="#{{item.name}}" class="heading-anchor">
2020
{{type-signature item}}
@@ -27,19 +27,19 @@
2727
</p>
2828

2929
{{#if (or (and item.exportType showImportPaths) shouldDisplayParams)}}
30-
{{#api/x-meta-panel as |panel|}}
30+
<Api::XMetaPanel as |panel|>
3131
{{#if item.exportType}}
32-
{{#panel.header}}
32+
<panel.header>
3333
Import Path
34-
{{/panel.header}}
34+
</panel.header>
3535

36-
{{api/x-import-path item=item}}
36+
<Api::XImportPath @item={{item}} />
3737
{{/if}}
3838

3939
{{#if shouldDisplayParams}}
40-
{{#panel.header}}
40+
<panel.header>
4141
Params
42-
{{/panel.header}}
42+
</panel.header>
4343

4444
<table class="docs-mb-6" data-test-item-params>
4545
<tbody>
@@ -53,6 +53,6 @@
5353
</tbody>
5454
</table>
5555
{{/if}}
56-
{{/api/x-meta-panel}}
56+
</Api::XMetaPanel>
5757
{{/if}}
5858
</div>

addon/components/docs-code-highlight/component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Component from '@ember/component';
22
import layout from './template';
3-
import hljs from 'highlight.js/lib/highlight';
3+
import hljs from 'highlight.js/lib/core';
44

55
// Installed languages
66
import javascript from 'highlight.js/lib/languages/javascript';

addon/components/docs-demo/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<div class="
3535
docs-demo__snippet-wrapper docs-bg-code-base docs-rounded-b
3636
">
37-
{{docs-snippet name=snippet.name unindent=true language=snippet.language}}
37+
<DocsSnippet @name={{snippet.name}} @unindent={{true}} @language={{snippet.language}} />
3838
</div>
3939
{{/if}}
4040
{{/each}}

addon/components/docs-header/link/template.hbs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,9 @@
2525

2626
{{else}}
2727

28-
{{#link-to route
29-
class=(concat
30-
"docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs
31-
docs-font-bold docs-no-underline "
32-
(if (not (eq route "index"))
33-
(if isActive
34-
"docs-text-brand"
35-
"docs-text-grey-darkest hover:docs-text-brand"
36-
)
37-
"docs-text-grey-darkest"
38-
)
39-
)
40-
data-test-id=data-test-id
41-
}}
28+
<LinkTo @route={{route}} class={{concat "docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs
29+
docs-font-bold docs-no-underline " (if (not (eq route "index")) (if isActive "docs-text-brand" "docs-text-grey-darkest hover:docs-text-brand") "docs-text-grey-darkest")}} data-test-id={{data-test-id}}>
4230
{{yield}}
43-
{{/link-to}}
31+
</LinkTo>
4432

4533
{{/if}}
Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
{{#if (and trimmedQuery search.isIdle)}}
2-
{{#modal-dialog
3-
tetherTarget="[data-search-box]"
4-
attachment="top left"
5-
clickOutsideToClose=true
6-
onClose=(action "clearSearch")
7-
targetAttachment="bottom left"
8-
constraints=(array (hash to="window" attachment="together" pin=true))}}
2+
<ModalDialog @tetherTarget="[data-search-box]" @attachment="top left" @clickOutsideToClose={{true}} @onClose={{action "clearSearch"}} @targetAttachment="bottom left" @constraints={{array (hash to="window" attachment="together" pin=true)}}>
93

104
<ul class="docs-w-76 docs-bg-white docs-shadow-md" data-test-search-result-list>
115
{{#each (take 5 searchResults) as |result index|}}
126
<li>
13-
{{docs-header/search-result
14-
result=result
15-
query=query
16-
selected=(eq index selectedIndex)
17-
onMouseEnter=(action "selectResult" index)
18-
onClick=(action "clearSearch")}}
7+
<DocsHeader::SearchResult @result={{result}} @query={{query}} @selected={{eq index selectedIndex}} @onMouseEnter={{action "selectResult" index}} @onClick={{action "clearSearch"}} />
198
</li>
209
{{else}}
2110
<li class="docs-block docs-py-1 docs-px-3 docs-text-grey-dark docs-no-underline">
@@ -24,5 +13,5 @@
2413
{{/each}}
2514
</ul>
2615

27-
{{/modal-dialog}}
16+
</ModalDialog>
2817
{{/if}}

addon/components/docs-header/template.hbs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
link=(component "docs-header/link")
2222
)}}
2323

24-
{{docs-header/search-box query=query on-input=(action (mut query))}}
24+
<DocsHeader::SearchBox @query={{query}} @on-input={{action (mut query)}} />
2525

26-
{{#docs-header/link on-click=(action (toggle "isShowingVersionSelector" this))}}
26+
<DocsHeader::Link @on-click={{action (toggle "isShowingVersionSelector" this)}}>
2727
<span data-test-id="current-version" data-version-selector class="docs-flex docs-items-center">
2828

2929
{{#if (eq currentVersion.key latestVersionName)}}
@@ -38,14 +38,14 @@
3838

3939
{{svg-jar "caret" height=12 width=12}}
4040
</span>
41-
{{/docs-header/link}}
41+
</DocsHeader::Link>
4242

4343
{{#if projectHref}}
44-
{{#docs-header/link href=projectHref}}
44+
<DocsHeader::Link @href={{projectHref}}>
4545
<span class="docs-flex">
4646
{{svg-jar "github" width=24 height=24}}
4747
</span>
48-
{{/docs-header/link}}
48+
</DocsHeader::Link>
4949
{{/if}}
5050

5151
{{!-- Something to take up space on mobile, so the scrolling nav isn't hugging the edge --}}
@@ -55,9 +55,9 @@
5555
</header>
5656

5757
{{#if query}}
58-
{{docs-header/search-results query=query on-visit=(action "didVisitPage")}}
58+
<DocsHeader::SearchResults @query={{query}} @on-visit={{action "didVisitPage"}} />
5959
{{/if}}
6060

6161
{{#if isShowingVersionSelector}}
62-
{{docs-header/version-selector on-close=(action (mut isShowingVersionSelector false))}}
62+
<DocsHeader::VersionSelector @on-close={{action (mut isShowingVersionSelector false)}} />
6363
{{/if}}

0 commit comments

Comments
 (0)