Skip to content

Commit

Permalink
Добавлено: Markdown Containers - Alignment, Highlights
Browse files Browse the repository at this point in the history
Изменено: Исправлены ошибки подсветки синтаксиса patch и nano
  • Loading branch information
Ampernic committed Mar 27, 2024
1 parent e49f060 commit fe27075
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .vitepress/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@
"wiki.md",
"contributions.md",
"about.md"
],

"alignment_containers": [
["left", {}],
["center", {}],
["half", {}],
["highlight", {}],
["right", {}]
]
}
5 changes: 5 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { rewrites } from './paths'
import languages from './theme/syntaxes'
import * as config from './config.json'
export const META_DESCRIPTION = config.meta_description
import {default as createContainer} from './theme/utils/customContainers';


/* Markdown */
import VitepressMarkdownTimeline from "vitepress-markdown-timeline";
Expand Down Expand Up @@ -194,6 +196,9 @@ export default defineConfig({
detailsLabel: 'Подробнее',
},
config: (md) => {
for (const [name, opts] of config.alignment_containers) {
md.use(...createContainer(name, opts, md));
}
md.use(markdownItKbd);
md.use(markdownItTaskLists);
md.use(VitepressMarkdownTimeline);
Expand Down
69 changes: 69 additions & 0 deletions .vitepress/theme/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,73 @@ figure>figcaption {
max-width: 350px;
max-height: 350px;
}
}

/**
* Alignment Containers
* -------------------------------------------------------------------------- */

.center {
&.custom-block {
text-align: center;
padding: 0;
img {
margin: auto;
}
}
}

.half {
&.custom-block {
width: 50%;
padding: 1px;
display: inline-block;
vertical-align: top;
box-sizing: border-box;
}
}

.highlight {
&.custom-block {
text-align: left;
color: var(--vp-c-brand-1);
font-size: 1.2em;
font-weight: 700;
border-top: 4px dashed var(--vp-c-brand-soft);
border-bottom: 4px dashed var(--vp-c-brand-soft);
padding: 1em;
margin-top: 1em;
margin-bottom: 1em;
p {
margin: 0;
}
}
}

.left {
&.custom-block {
float: left;
padding: 1em 2em;
padding-left: 0;
width: auto;
text-align: center;
max-width: 50%;
}
}
.right {
&.custom-block {
float: right;
padding: 1em 2em;
width: auto;
text-align: center;
max-width: 50%;
}
}

img {
border-radius: 15px;
}

.vp-doc .custom-block {
margin: 0 0 !important;
}
24 changes: 24 additions & 0 deletions .vitepress/theme/utils/customContainers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import container from 'markdown-it-container';

export default function(name, opts = {}, md) {
return [container, name, {
render(tokens, index, _options, env) {
const token = tokens[index];
const info = token.info.trim().slice(name.length).trim() || opts.defaultTitle;
const attrs = md.renderer.renderAttrs(token);

// opening tag
if (token.nesting === 1) {
const title = info ? md.renderInline(info, {references: env.references}) : undefined;
const titleMarkdown = title ? `<p class="custom-block-title">${title ? title : ''}</p>` : '';

// special handling for details
if (name === 'details') return `<details class="${name} custom-block"${attrs}><summary>${title}</summary>\n`;
// otherwise
return `<div class="${name} custom-block"${attrs}>${titleMarkdown}\n`;

// closing tag
} else return name === 'details' ? `</details>\n` : `</div>\n`;
}},
];
};
4 changes: 3 additions & 1 deletion docs/equipment/dualshock.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ progress: 70
sudo nano /etc/bluetooth/input.conf
```


Далее добавить в него данное содержимое, нажать `ctrl+x` для выхода и `Y` для сохранения изменений

```nano
```bash
[General]
ClassicBondedOnly=false
```
Expand All @@ -37,6 +38,7 @@ ClassicBondedOnly=false
systemctl restart bluetooth
```

------
### Подключение

Далее для первого сопряжения геймпада нам потребуется выполнить следующие действия:
Expand Down
2 changes: 1 addition & 1 deletion docs/system/macbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ make
```

Сохраните патч ниже, как `alt-linux-lib64.patch` для команды выше в папку `apple-set-os`
```patch
```bash
commit 7f29a978c13de7cacc6d4d1c00bb160bf3bc51ae
Author: iTux <itux@idev.pro>
Date: Sun Oct 29 17:13:43 2023 +0300
Expand Down

0 comments on commit fe27075

Please sign in to comment.