Skip to content

Commit

Permalink
chore: cleanup marko run code
Browse files Browse the repository at this point in the history
  • Loading branch information
agliga committed Aug 23, 2024
1 parent 3f466c2 commit 9e8cc9d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 75 deletions.
15 changes: 1 addition & 14 deletions src/components/flag-list.marko
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,4 @@
<span>${flag.name}</span>
</li>
</for>
</ul>

<!--
{% for flag in include.flag.list %}
<li class="demo-flag-box">
<b>{{flag.code}}</b>
<svg class="{{ include.flag.prefix }} {{ include.flag.prefix }}--{{ flag.code }}{{ include.flag.postfix }}"
height="48" width="64"">
{% include symbol.html name=flag.code file=" flags" prefix=include.flag.prefix
postfix=include.flag.postfix %} </svg>
<span>{{ flag.name }}</span>
</li>
{% endfor %}
</ul> -->
</ul>
2 changes: 1 addition & 1 deletion src/components/highlight-code/index.marko
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import * as prettierPluginHtml from "prettier/plugins/html";
import * as prettierPluginYaml from "prettier/plugins/yaml";
import * as prettierPluginCss from "prettier/plugins/postcss";
import Prism from "prismjs";
import "prismjs/components/prism-json";
import "prismjs/components/prism-javascript";
import 'prismjs/components/prism-json';
import "prismjs/components/prism-css";
static const languages = {
js: Prism.languages.javascript,
Expand Down
20 changes: 1 addition & 19 deletions src/components/icon-deprecated-list.marko
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,4 @@
</svg>
</li>
</for>
</ul>


<!-- <ul class="demo-icon-boxes demo-icon-boxes--deprecated">
{% for iconItem in include.icon.deprecated %}
{% if include.icon.largeDocs contains iconItem.name %}
{% assign containerClass = "demo-icon-box demo-icon-box--large" %}
{% else %}
{% assign containerClass = "demo-icon-box" %}
{% endif %}
<li class="{{ containerClass }}">
<span>{{ iconItem.name }}</span>
<svg aria-hidden="true" class="icon icon--{{ iconItem.size }}">
{% include symbol.html name=iconItem.name file="icons" prefix="icon" %}
</svg>
</li>
{% endfor %}
</ul> -->
</ul>
9 changes: 9 additions & 0 deletions src/components/module-list.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import path from 'path';

<for|mod| in=input.modules>
$ const moduleName = path.basename(mod, '.marko');
$ const name = moduleName.replace(/-([a-z])/g, function (g) { return ` ${g[1].toUpperCase()}`; });
$ const properName = name.charAt(0).toUpperCase() + name.slice(1);
<li><a class="nav-link" href=`#${moduleName}`>${properName}</a></li>
</for>

8 changes: 4 additions & 4 deletions src/modules/lightbox-dialog.marko
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
</button>
</div>
<div class="lightbox-dialog__main">
{% for number in (1...100) %}
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
{% endfor %}
<for|item| of=Array.from(Array(100))>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</for>
<p><a href="https://www.ebay.com">www.ebay.com</a></p>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/modules/menu-button.marko
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@
<div class="menu-button__menu">
<div class="menu-button__items" role="menu">

{% for number in (1...50) %}
<div class="menu-button__item" role="menuitem">
<span>Menu item {{number}}</span>
</div>
{% endfor %}
<for|item,i| of=Array.from(Array(50))>
<div class="menu-button__item" role="menuitem">
<span>Menu item ${i}</span>
</div>
</for>
</div>
</div>
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/tokens.marko
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ const colors = ["avocado", "marigold", "blue", "coral", "orange", "dijon", "pi
<ul class="demo-color-primitive">
<for |color| of=colors>
<for |i| of=[...Array(7).keys()]>
<li class="demo-color-{{ colourName }}-{{ i }}00">color-${color}-${i+1}00</li>
<li class=`demo-color-${color}-${i}00`>color-${color}-${i+1}00</li>
</for>
</for>
<li class="demo-color-neutral-900">color-neutral-900</li>
Expand Down
35 changes: 5 additions & 30 deletions src/routes/_index/+layout.marko
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
<!-- <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A basic Marko app.">
<link rel="stylesheet" href="./custom-styles.css">
<title>${$global.meta.pageTitle || "Marko"}</title>
</head>
<body>
<${input.renderBody}/>
</body>
</html> -->

// import './main.js'
<!-- $ if (typeof window !== 'undefined') { console.log(Prism), Prism.highlightAll() }; -->
import {modules} from '../modules.marko';
import path from 'path';

<!doctype html>
<html lang="en">
Expand All @@ -34,9 +16,9 @@ import path from 'path';
<div class="app-bar">
<h1 class="app-bar__title">${$global.meta.pageTitle}</h1>
<ul class="app-bar__links">
<li><a href="{{ site.url }}/archive/index.html">v${$global.meta.version}</a></li>
<li><a href="/archive/index.html">v${$global.meta.version}</a></li>
<li><a href="https://github.com/eBay/skin">GitHub</a></li>
<li><a href="{{ site.url }}/storybook">Storybook</a></li>
<li><a href="/storybook">Storybook</a></li>
</ul>
</div>
</div>
Expand All @@ -46,14 +28,14 @@ import path from 'path';
<span class="details__label">Modules</span>
<span class="details__icon" hidden>
<svg class="icon icon--16" aria-hidden="true">
<!-- {% include symbol.html name="chevron-down-12" %} -->
<icon-symbol name="chevron-down-12"/>
</svg>
</span>
<span class="modules-expander__tip">Use the links below &amp; the back button to navigate</span>
</summary>

<ul class="modules-expander__list">
<!-- {% include module-list.html %} -->
<module-list modules=modules/>
</ul>
</details>
</header>
Expand All @@ -73,21 +55,14 @@ import path from 'path';

<h2>Modules</h2>
<ul>
<for|module| in=modules>
$ const moduleName = path.basename(module, '.marko');
$ const name = moduleName.replace(/-([a-z])/g, function (g) { return ` ${g[1].toUpperCase()}`; });
$ const properName = name.charAt(0).toUpperCase() + name.slice(1);
<li><a class="nav-link" href=`#${moduleName}`>${properName}</a></li>
</for>
<!-- {% include module-list.html %} -->
<module-list modules=modules/>
</ul>
</nav>
<main>
<${input.renderBody}/>
</main>
<footer>
<hr />
<!-- <p>Copyright &copy; {{ 'now' | date: "%Y" }} eBay, Inc. All rights reserved.</p> -->
</footer>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/static/sass/breakpoints.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
}

@media screen and (min-width: $_screen-size-MD) {
@media screen and (min-width: $_screen-size-SM) {
.site-nav {
height: 100vh;
margin-bottom: var(--spacing-800);
Expand Down

0 comments on commit 9e8cc9d

Please sign in to comment.