Skip to content

Commit

Permalink
Merge pull request #35 from SilasBerger/feature/more-components
Browse files Browse the repository at this point in the history
Add tabs and MDX syntax for tiles.
  • Loading branch information
SilasBerger authored Jan 20, 2024
2 parents 23a31c4 + 1dad23b commit 9c10dc0
Show file tree
Hide file tree
Showing 31 changed files with 353 additions and 110 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Markdown and HTML Features
title: Markdown and HTML Features
---

# Markdown and HTML Features :seeCode[https://github.com/SilasBerger/teaching-website/blob/main/content/material/Components-Gallery/00-Markdown-Features.mdx]
Expand Down
1 change: 1 addition & 0 deletions content/material/Components-Gallery/01-Admonitions.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Admonitions
title: Admonitions
---

# Admonitions :seeCode[https://github.com/SilasBerger/teaching-website/blob/main/content/material/Components-Gallery/01-Admonitions.mdx]
Expand Down
90 changes: 65 additions & 25 deletions content/material/Components-Gallery/02-Tiles.mdx
Original file line number Diff line number Diff line change
@@ -1,37 +1,77 @@
---
sidebar_label: Tiles
title: Tiles
---

import TileGrid, {Layout} from "@site/src/app/components/tiles/TileGrid";
import Tile from "@site/src/app/components/tiles/Tile";

# Tiles :seeCode[https://github.com/SilasBerger/teaching-website/blob/main/content/material/Components-Gallery/02-Tiles.mdx]
## Tile types
<TileGrid>
<Tile title="Title"></Tile>
<Tile title="Title and body">This tile has a title and a body</Tile>
<Tile title="Title, body, link" href="#">This tile has a title, a body, and a link</Tile>
<Tile title="Title and link" href="#"></Tile>
::::Tiles
:::Tile[Title]
:::

:::Tile[Title and body]
This tile has a title and a body
:::

</TileGrid>
:::Tile[Title, body, link]{href="#"}
This tile has a title, a body, and a link
:::

:::Tile[Title and link]{href="#"}
:::
::::

## Larger tiles
<TileGrid layout={Layout.LARGE_TILES}>
<Tile title="Alpha">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Bravo">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Charlie">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Delta">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
</TileGrid>
::::Tiles{layout="large"}
:::Tile[Alpha]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::

:::Tile[Bravo]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::

:::Tile[Charlie]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::

:::Tile[Delta]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::
::::

## Smaller tiles (and without grow-on-hover)
<TileGrid layout={Layout.SMALL_TILES} preventGrowOnHover={true}>
<Tile title="Alpha">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Bravo">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Charlie">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Delta">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Echo">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Foxtrot">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Golf">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
<Tile title="Hotel">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt</Tile>
</TileGrid>
::::Tiles{layout="small" preventGrowOnHover="true"}
:::Tile[Alpha]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::

:::Tile[Bravo]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor inviduntv
:::

:::Tile[Charlie]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::

:::Tile[Delta]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::

:::Tile[Echo]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::

:::Tile[Foxtrot]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::

:::Tile[Golf]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::

:::Tile[Hotel]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
:::
::::

1 change: 1 addition & 0 deletions content/material/Components-Gallery/03-YouTube-Video.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: YouTube Video
title: YouTube Video
---

# YouTube Video :seeCode[https://github.com/SilasBerger/teaching-website/blob/main/content/material/Components-Gallery/03-YouTube-Video.mdx]
Expand Down
1 change: 1 addition & 0 deletions content/material/Components-Gallery/04-Hero-Image.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Hero Image
title: Hero Image
---

# Hero Image :seeCode[https://github.com/SilasBerger/teaching-website/blob/main/content/material/Components-Gallery/04-Hero-Image-and-Source-Reference.mdx]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Mermaid Diagrams
title: Mermaid Diagrams
---

# Mermaid Diagrams :seeCode[https://github.com/SilasBerger/teaching-website/blob/main/content/material/Components-Gallery/05-Mermaid-Diagrams.mdx]
Expand Down
1 change: 1 addition & 0 deletions content/material/Components-Gallery/06-Definition-List.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Definition List
title: Definition List
---

import DefinitionList from "@site/src/app/components/DefinitionList";
Expand Down
1 change: 1 addition & 0 deletions content/material/Components-Gallery/07-Browser-Window.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Browser Window
title: Browser Window
---

import BrowserWindow, {Browser} from "@site/src/app/components/BrowserWindow";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Material Design Icons
title: Material Design Icons
---

# Material Design Icons (MDI) :seeCode[https://github.com/SilasBerger/teaching-website/blob/main/content/material/Components-Gallery/08-Material-Design-Icons.mdx]
Expand Down
73 changes: 73 additions & 0 deletions content/material/Components-Gallery/09-Tabs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
sidebar_label: Tabs
title: Tabs
---

# Tabs :seeCode[https://github.com/SilasBerger/teaching-website/blob/main/content/material/Components-Gallery/09-Tabs.mdx]
Tabs are a builtin component provided by the Docusaurus default theme.

::::Tabs
:::Tab[Windows]{value="win"}
:::insight[Paths on Windows :mdi[linux]]
On Windows :mdi[microsoft-windows], paths take the form `C:\foo\bar`.
:::

:::Tab[macOS]{value="macos"}
:::insight[Paths on macOS]
On macOS :mdi[apple], paths are specified in the Unix-like style `/foo/bar`
:::

:::Tab[Linux]{value="linux"}
:::insight[Paths on Linux]
On Linux :mdi[linux], just like on macOS, we use Unix-like paths, such as `/foo/bar`.
:::
::::

## Synchronized tab groups
The above tab group is set to have a `groupId` of `operating-systems`. If we now add a second group with the same `groupId`, you will notice that both groups change their selected tab whenever we change it in either one of them. The exception here being the `FreeBSD` tab: Since it only exists within the second group, selecting that tab won't affect the state of the first one.

::::Tabs
:::Tab[Windows]{value="win"}
Microsoft Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For instance, Windows NT for consumer and corporate desktops, Windows Server for servers, and Windows IoT for embedded systems. Defunct Windows families include Windows 9x, Windows Mobile, Windows Phone, and Windows Embedded Compact. _Source: [Wikipedia](https://en.wikipedia.org/wiki/Microsoft_Windows)._
:::

:::Tab[macOS]{value="macos"}
macOS, originally Mac OS X, previously shortened as OS X, is an operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and laptop computers, it is the second most widely used desktop OS, after Microsoft Windows and ahead of all Linux distributions, including ChromeOS. _Source: [Wikipedia](https://en.wikipedia.org/wiki/MacOS)._
:::

:::Tab[Linux]{value="linux"}
Linux is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution (distro), which includes the kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses and recommends the name "GNU/Linux" to emphasize the use and importance of GNU software in many distributions, causing some controversy. _Source: [Wikipedia](https://en.wikipedia.org/wiki/Linux)._
:::

:::Tab[FreeBSD]{value="freebsd"}
FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version of FreeBSD was released in 1993 developed from 386BSD[3] and the current version runs on x86, ARM, PowerPC and RISC-V processors. The project is supported and promoted by the FreeBSD Foundation. _Source: [Wikipedia](https://en.wikipedia.org/wiki/FreeBSD)._
:::
::::

## Syntactical particularities
Consider the code used to create the first tab group on this page:

```mdx
::::Tabs
:::Tab[Windows]{value="win"}
:::insight[Paths on Windows :mdi[linux]]
On Windows :mdi[microsoft-windows], paths take the form `C:\foo\bar`.
:::

:::Tab[macOS]{value="macos"}
:::insight[Paths on macOS]
On macOS :mdi[apple], paths are specified in the Unix-like style `/foo/bar`
:::

:::Tab[Linux]{value="linux"}
:::insight[Paths on Linux]
On Linux :mdi[linux], just like on macOS, we use Unix-like paths, such as `/foo/bar`.
:::
::::
```

For this code to render as expected, we need to follow two particular rules, which may not be obvious at first glance:
1. The `Tab` parent must use a strictly higher count of leading colons than its `Tab` or Admonitions children (e.g. `::::Tabs` vs. `:::Tab`). This parent container must also have its own closing directive (i.e. `::::` for `::::Tabs`). _Source: [Discussion on GitHub](https://github.com/micromark/micromark-extension-directive/issues/8#issuecomment-965878986)._
2. Each `Tab` element must specify a `value` property, such as `{value="macos"}`. The semantics of this property are explained in the [previous section](#synchronized-tab-groups).

Note that the indentation is only used to improve legibility and does not affect the semantics of this code.
3 changes: 0 additions & 3 deletions content/material/Components-Gallery/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
import TileGrid, {Layout} from "@site/src/app/components/tiles/TileGrid";
import Tile from "@site/src/app/components/tiles/Tile";

# Components
A gallery and development sandbox for React components.
2 changes: 1 addition & 1 deletion content/material/Kryptologie/01-secureLink.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Iframe from "@site/src/app/components/Iframe";

# secureLINK
Special Agent Charles Marsh benötigt Ihre Hilfe! Nutzen Sie Ihr Wissen über Kryptologie, um ihn bei zahlreichen
Special Agent Charles Marsh benötigt Ihre Hilfe! Nutzen Sie Ihr Wissen aus der Kryptologie, um ihn bei zahlreichen
spannenden Missionen zu unterstützen.

:::warning[Seite im Aufbau]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Unter den Empfängern von Anjas Nachricht ist auch Elvira, die sogleich eine Cha

![Gefälschte Nachricht von Elvira](img/nachricht-elvira.png)

Tatsächlich erbeutet Elvira mit dieser Masche einen ordentlichen Betrag, bevor jemand merkt, dass etwas Merkwürdiges vor sich geht. Als Belinda sie darauf hinweist, dass wohl jemand in ihrem Namen Spenden ergaunert hat, macht Anja sich Gedanken. Hätte sie das verhindern können? Und wenn ja, wie?
Tatsächlich erbeutet Elvira mit dieser Masche einen ordentlichen Betrag, bevor jemand merkt, dass etwas Komisches vor sich geht. Als ihre Freundin Belinda sie darauf hinweist, dass wohl jemand in ihrem Namen Spenden ergaunert hat, macht Anja sich Gedanken. Hätte sie das verhindern können? Und wenn ja, wie?

Ein klassischer Brief auf Papier wäre vielleicht besser gewesen, denkt sie sich. Den hätte sie nämlich unterschreiben können. Wirklich überzeugt ist sie von dieser Idee aber nicht: Erstens kennt wohl kaum jemand ihre Unterschrift. Zweitens liesse sich die ja auch ziemlich leicht fälschen – mindestens so gut, dass es niemandem auffällt, der nicht sehr genau hinschaut.
Ein klassischer Brief auf Papier wäre vielleicht besser gewesen, denkt sie sich. Den hätte sie wenigstens unterschreiben können. Wirklich überzeugt ist sie von dieser Idee aber nicht: Erstens kennt wohl kaum jemand ihre Unterschrift. Zweitens liesse sich die ja auch ziemlich leicht fälschen – mindestens so gut, dass es niemandem auffällt, der nicht sehr genau hinschaut.

Nein, denkt Anja, es muss eine bessere Lösung geben. Vielleicht findet sich in der Informatik ja das eine oder andere Prinzip, das sich hier anwenden lässt? Eine Art «digitale Unterschrift» im SMS... Das klingt doch nach einem Problem, das sich mit Kryptologie lösen lassen könnte.
Nein, denkt Anja, es muss eine bessere Lösung geben. Vielleicht findet sich in der Informatik ja das eine oder andere Prinzip, das sich hier anwenden lässt? Eine Art «digitale Unterschrift» im SMS... Das klingt doch nach einem Problem, das sich vielleicht mit Konzepten aus der Kryptologie lösen lässt!
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Health Points
title: Health Points
---

# Health Points :seeCode[https://github.com/SilasBerger/microbit/tree/main/projects/health-points]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Jukebox
title: Jukebox
---

# Jukebox :seeCode[https://github.com/SilasBerger/microbit/blob/main/projects/jukebox.py]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar_label: Maqueen RC Car
title: Maqueen RC Car
---

# Maqueen RC Car :seeCode[https://github.com/SilasBerger/microbit/tree/main/projects/maqueen-rc-car]
Expand Down
Loading

0 comments on commit 9c10dc0

Please sign in to comment.