Skip to content

Commit 6f3f7eb

Browse files
committed
[ADD] add termynal feature
1 parent 0ded2ce commit 6f3f7eb

15 files changed

+1344
-10
lines changed

.github/workflows/build-docs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build Docs
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
jobs:
9+
changes:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
docs: ${{ steps.filter.outputs.docs }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: dorny/paths-filter@v3
16+
id: filter
17+
with:
18+
filters: |
19+
docs:
20+
- README.md
21+
- docs/**
22+
build-docs:
23+
needs:
24+
- changes
25+
if: ${{ needs.changes.outputs.docs == 'true' }}
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Configure Git Credentials
30+
run: |
31+
git config user.name github-actions[bot]
32+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
33+
- uses: actions/setup-python@v5
34+
with:
35+
python-version: "3.12.4"
36+
- uses: pdm-project/setup-pdm@v4
37+
- name: Install docs dependencies
38+
run: |
39+
echo "Attempting to install docs dependencies with PDM..."
40+
if pdm install --group docs --no-default; then
41+
echo "PDM install succeeded"
42+
else
43+
echo "PDM install failed or PDM not available, falling back to requirements-docs.txt"
44+
echo "Installing dependencies via pip..."
45+
pip install -r requirements-docs.txt
46+
echo "Fallback installation completed"
47+
fi
48+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
49+
- uses: actions/cache@v4
50+
with:
51+
key: mkdocs-material-${{ env.cache_id }}
52+
path: .cache
53+
restore-keys: |
54+
mkdocs-material-
55+
- run: mkdocs gh-deploy --force

docs/css/custom.css

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.termynal-comment {
2+
color: #4a968f;
3+
font-style: italic;
4+
display: block;
5+
}
6+
7+
.termy [data-termynal] {
8+
white-space: pre-wrap;
9+
}
10+
11+
.termy .linenos {
12+
display: none;
13+
}
14+
15+
a.external-link::after {
16+
/* \00A0 is a non-breaking space
17+
to make the mark be on the same line as the link
18+
*/
19+
content: "\00A0[↪]";
20+
}
21+
22+
a.internal-link::after {
23+
/* \00A0 is a non-breaking space
24+
to make the mark be on the same line as the link
25+
*/
26+
content: "\00A0↪";
27+
}
28+
29+
.shadow {
30+
box-shadow: 5px 5px 10px #999;
31+
}
32+
33+
.user-list {
34+
display: flex;
35+
flex-wrap: wrap;
36+
margin-bottom: 2rem;
37+
}
38+
39+
.user-list-center {
40+
justify-content: space-evenly;
41+
}
42+
43+
.user {
44+
margin: 1em;
45+
min-width: 7em;
46+
}
47+
48+
.user .avatar-wrapper {
49+
width: 80px;
50+
height: 80px;
51+
margin: 10px auto;
52+
overflow: hidden;
53+
border-radius: 50%;
54+
position: relative;
55+
}
56+
57+
.user .avatar-wrapper img {
58+
position: absolute;
59+
top: 50%;
60+
left: 50%;
61+
transform: translate(-50%, -50%);
62+
}
63+
64+
.user .title {
65+
text-align: center;
66+
}
67+
68+
.user .count {
69+
font-size: 80%;
70+
text-align: center;
71+
}

docs/css/termynal.css

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/**
2+
* termynal.js
3+
*
4+
* @author Ines Montani <ines@ines.io>
5+
* @version 0.0.1
6+
* @license MIT
7+
*/
8+
9+
:root {
10+
--color-bg: #252a33;
11+
--color-text: #eee;
12+
--color-text-subtle: #a2a2a2;
13+
}
14+
15+
[data-termynal] {
16+
width: 750px;
17+
max-width: 100%;
18+
background: var(--color-bg);
19+
color: var(--color-text);
20+
font-size: 16px;
21+
font-family: 'Fira Mono', Consolas, Menlo, Monaco, 'Courier New', Courier, monospace;
22+
border-radius: 4px;
23+
padding: 75px 45px 35px;
24+
position: relative;
25+
-webkit-box-sizing: border-box;
26+
box-sizing: border-box;
27+
}
28+
29+
[data-termynal]:before {
30+
content: '';
31+
position: absolute;
32+
top: 15px;
33+
left: 15px;
34+
display: inline-block;
35+
width: 15px;
36+
height: 15px;
37+
border-radius: 50%;
38+
/* A little hack to display the window buttons in one pseudo element. */
39+
background: #d9515d;
40+
-webkit-box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;
41+
box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;
42+
}
43+
44+
[data-termynal]:after {
45+
content: 'bash';
46+
position: absolute;
47+
color: var(--color-text-subtle);
48+
top: 5px;
49+
left: 0;
50+
width: 100%;
51+
text-align: center;
52+
}
53+
54+
[data-ty] {
55+
display: block;
56+
line-height: 2;
57+
}
58+
59+
[data-ty]:before {
60+
/* Set up defaults and ensure empty lines are displayed. */
61+
content: '';
62+
display: inline-block;
63+
vertical-align: middle;
64+
}
65+
66+
[data-ty="input"]:before,
67+
[data-ty-prompt]:before {
68+
margin-right: 0.75em;
69+
color: var(--color-text-subtle);
70+
}
71+
72+
[data-ty="input"]:before {
73+
content: '$';
74+
}
75+
76+
[data-ty][data-ty-prompt]:before {
77+
content: attr(data-ty-prompt);
78+
}
79+
80+
[data-ty-cursor]:after {
81+
content: attr(data-ty-cursor);
82+
font-family: monospace;
83+
margin-left: 0.5em;
84+
-webkit-animation: blink 1s infinite;
85+
animation: blink 1s infinite;
86+
}
87+
88+
89+
/* Cursor animation */
90+
91+
@-webkit-keyframes blink {
92+
50% {
93+
opacity: 0;
94+
}
95+
}
96+
97+
@keyframes blink {
98+
50% {
99+
opacity: 0;
100+
}
101+
}

0 commit comments

Comments
 (0)