Skip to content

Commit

Permalink
Addon Docs: Incorporate with addons page
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans5958 committed Jun 2, 2024
1 parent 9e31f31 commit 5494d7b
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 8 deletions.
2 changes: 0 additions & 2 deletions content/addons.html → content/addons/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

{{< scss "assets/css/addons.scss" >}}

<h1>Addons</h1>

<div class="container">

<p>This page lists all of the addons that are implemented on Scratch Addons.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Insert blocks by name
id: middle-click-popup
layout: addons
---

**Insert blocks by name** is an addon which allows users to code more quickly by typing the name of blocks and inserting them at their mouse position, rather than having to search for them in the flyout. The popup is opened by middle clicking in the workspace or pressing `ctrl` + `space`. You can then type to search for blocks and using the mouse to grab one out of the popup.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Scratch Messaging
id: scratch-messaging
layout: addons
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus accumsan massa sit amet sapien tristique, vel vulputate enim sagittis. Nulla vestibulum, ante vel ullamcorper porta, leo massa egestas lacus, ac bibendum mauris elit non lectus. Curabitur aliquet quis nulla nec dictum. Phasellus lobortis massa quis libero dictum, eu rhoncus leo vulputate. Etiam vehicula, nunc eu scelerisque lobortis, erat erat viverra nisi, nec egestas odio erat eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus. Curabitur ex neque, laoreet at consequat nec, semper pellentesque dolor. Proin rutrum metus nec arcu gravida sagittis. Donec fringilla fringilla leo vitae vehicula. Quisque interdum blandit malesuada. Maecenas blandit purus eu molestie mollis. Vivamus eu neque eget ante suscipit laoreet a at felis. Integer in tincidunt arcu. Sed iaculis, justo vel porta tempus, nisl turpis tempor ex, vel consequat quam nibh non elit. Fusce bibendum tincidunt diam, ac tincidunt nisi. Suspendisse ornare eget est at pulvinar.
Expand Down
4 changes: 0 additions & 4 deletions content/docs/addons/_index.md

This file was deleted.

1 change: 1 addition & 0 deletions layouts/addons/_markup/render-heading.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} <a href="#{{ .Anchor | safeURL }}" class="anchor" aria-label="Anchor"></a></h{{ .Level }}>
108 changes: 108 additions & 0 deletions layouts/addons/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{{ block "html" . -}}

<!DOCTYPE html>

<html lang="{{ .Site.Language.Lang }}">

<head>

{{ partial "head" . }}
{{ partial "scss" "assets/css/docs.scss" }}
{{ if isset $.Params "embed_js" }}{{ range $.Params.embed_js }}
<script defer src="{{ . }}"></script>
{{ end }}{{ end }}
{{ if isset $.Params "embed_css" }}{{ range $.Params.embed_css }}
<link rel="stylesheet" href="{{ . }}" crossorigin />
{{ end }}{{ end }}
<script src="https://cdn.jsdelivr.net/npm/simple-scrollspy@2.2.0/demo/dist/simple-scrollspy.min.js" defer></script>
<script defer src="/assets/js/docs.js"></script>
{{ block "head-additional" . }}{{ end }}

</head>

<body>

{{ block "body" . }}{{ end }}

</body>

</html>

{{- end }}

{{ define "body" }}

{{ partial "nav" . }}

{{ partial "docs/sidebar-toggle" . }}

<main>
{{ block "main" . }}{{ end }}
</main>

{{ partialCached "footer" . .Site.Language.Lang }}

{{ end }}

{{ define "main" }}

<div class="container-fluid">

<div id="docs-container">

<aside class="collapse d-lg-block" id="docs-nav-wrapper">
<!-- d-none -->
<!-- px-2 py-4 -->
{{ partial "docs/sidebar" . }}
</aside>

{{ if ( and (ne .TableOfContents "<nav id=\"TableOfContents\"></nav>") (ne .TableOfContents "") ) -}}
<aside class="text-muted mb-3 mb-xl-0 p-3 p-xl-0" id="docs-toc">
<!-- d-none -->
<!-- px-2 py-4 -->
<a class="text-muted collapse-button mx-xl-2 collapsed" data-toggle="collapse" href="#docs-toc-inner" role="button" aria-expanded="true">
<div>{{ T "Docs.TOC" }}</div>
{{- template "svg" -}}
</a>
<div class="collapse d-xl-block" id="docs-toc-inner">
<hr class="my-1 mx-2" />
{{ .TableOfContents }}
</div>

</aside>
{{- end }}

<div id="docs-header" class="md-content mb-3">
{{ block "header" . }}{{ end }}
</div>

<article id="docs-content" class="md-content mb-3">
{{ block "content" . }}{{ end }}
</article>

<div id="docs-footer" class="md-content">
{{ partial "docs/footer" . }}
{{ if ( not $.Params.no_comments ) -}}
<div id="comments" class="mt-4">{{ partial "comments" }}</div>
{{- end }}
</div>

</div>

</div>

{{ end }}

{{ define "header" }}

<h1>{{ .Title }}</h1>

{{ end }}

{{ define "content" }}

{{ .Content }}

{{ end }}

{{- define "svg" -}}<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"><g fill="#626262"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8L4.646 2.354a.5.5 0 0 1 0-.708z"/></g></svg>{{- end -}}
56 changes: 56 additions & 0 deletions layouts/addons/section.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{{ define "head" }}{{ end }}

{{ define "body" }}

{{ partial "nav" . }}

<main>
<h1>Addons</h1>

<div class="container-fluid">

<div id="docs-container">

<aside class="collapse d-lg-block" id="docs-nav-wrapper">
<!-- d-none -->
<!-- px-2 py-4 -->
{{ partial "docs/sidebar" . }}
</aside>

{{ if ( and (ne .TableOfContents "<nav id=\"TableOfContents\"></nav>") (ne .TableOfContents "") ) -}}
<aside class="text-muted mb-3 mb-xl-0 p-3 p-xl-0" id="docs-toc">
<!-- d-none -->
<!-- px-2 py-4 -->
<a class="text-muted collapse-button mx-xl-2 collapsed" data-toggle="collapse" href="#docs-toc-inner" role="button" aria-expanded="true">
<div>{{ T "Docs.TOC" }}</div>
{{- template "svg" -}}
</a>
<div class="collapse d-xl-block" id="docs-toc-inner">
<hr class="my-1 mx-2" />
{{ .TableOfContents }}
</div>

</aside>
{{- end }}

<article id="docs-content" class="md-content mb-3">
{{ block "content" . }}{{ end }}
</article>

<div id="docs-footer" class="md-content">
{{ partial "docs/footer" . }}
{{ if ( not $.Params.no_comments ) -}}
<div id="comments" class="mt-4">{{ partial "comments" }}</div>
{{- end }}
</div>

</div>

</div>

{{ block "content" . }}{{ end }}
</main>

{{ partialCached "footer" . .Site.Language.Lang }}

{{ end }}
22 changes: 22 additions & 0 deletions layouts/addons/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{ define "header" }}
{{ $data := ( index ( where ( index $.Site.Data.addons $.Page.Language.Lang ) "id" .Params.id ) 0 ) }}

<h1>{{ $data.name }}</h1>

{{ end }}

{{ define "content" }}

{{ $data := ( index ( where ( index $.Site.Data.addons $.Page.Language.Lang ) "id" .Params.id ) 0 ) }}

{{ partial "docs/addons-infobox" $data }}

{{ .Content }}

{{ end }}

{{ define "head-additional" }}

{{ partial "scss" "assets/css/markdown.scss" }}

{{ end }}

0 comments on commit 5494d7b

Please sign in to comment.