-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add styles for tutorial info, add helpers * add tutorial page layout
- Loading branch information
1 parent
9769b9e
commit e8415db
Showing
10 changed files
with
113 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ | |
@import "footer.css"; | ||
@import "highlight.css"; | ||
@import "print.css"; | ||
@import "tutorial-info.css"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.tutorial-info { | ||
display: flex; | ||
align-items: center; | ||
gap: var(--ds-space-2h); | ||
margin-bottom: var(--ds-space-3); | ||
} | ||
|
||
.tutorial-info .info-item { | ||
display: flex; | ||
gap: var(--ds-space-1); | ||
} | ||
|
||
.tutorial-info .tutorial-actions { | ||
margin-left: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict' | ||
|
||
module.exports = (html) => { | ||
const matches = html.toString().match(/class="step"/g) | ||
if (!matches) return undefined | ||
return matches.length | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict' | ||
|
||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
module.exports = (iconName) => { | ||
const pathName = path.join(__dirname, '/src/img/', iconName + '.svg') | ||
const content = fs.readFileSync(pathName, 'utf8') | ||
return content | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
{{> head defaultPageTitle='Untitled'}} | ||
</head> | ||
<body class="article{{#with (or page.attributes.role page.role)}} {{{this}}}{{/with}}"> | ||
{{> header}} | ||
{{> body}} | ||
{{> footer}} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<article class="doc"> | ||
{{#with page.title}} | ||
<h1 class="page">{{{this}}}</h1> | ||
{{/with}} | ||
{{{page.contents}}} | ||
{{> pagination}} | ||
</article> | ||
{{#with page.title}} | ||
<h1 class="page">{{{this}}}</h1> | ||
{{/with}} | ||
{{#if (eq page.layout 'tutorial')}} | ||
{{> tutorial-info}} | ||
{{/if}} | ||
{{{page.contents}}} | ||
{{> pagination}} | ||
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<div class="tutorial-info"> | ||
{{#with page.attributes.skill-level}} | ||
<div class="info-item"> | ||
<span class="material-icons">network_check</span> | ||
{{{this}}} | ||
</div> | ||
{{/with}} | ||
{{#with (stepcount page.contents)}} | ||
<div class="info-item"> | ||
<span class="material-icons">playlist_add_check</span> | ||
{{{this}}} Steps | ||
</div> | ||
{{/with}} | ||
{{#with page.attributes.time-commitment}} | ||
<div class="info-item"> | ||
<span class="material-icons">query_builder</span> | ||
{{{this}}} | ||
</div> | ||
{{/with}} | ||
<div class="tutorial-actions"> | ||
{{#with page.attributes.colab-link}} | ||
<a href="{{{this}}}" target="_blank" class="colab ds-button ds-button--variant-outlined ds-button--color-neutral"> | ||
<div class="ds-button--leading-icon">{{{svg 'colab'}}}</div> | ||
Run this on Colab | ||
</a> | ||
{{/with}} | ||
</div> | ||
</div> |