feat: add doks default style + examples
This commit is contained in:
9
content/docs/examples/_index.md
Normal file
9
content/docs/examples/_index.md
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
title: "Examples"
|
||||
description: "Examples"
|
||||
lead: ""
|
||||
date: 2021-03-16T08:43:03+01:00
|
||||
lastmod: 2021-03-16T08:43:03+01:00
|
||||
draft: false
|
||||
images: []
|
||||
---
|
79
content/docs/examples/code.md
Normal file
79
content/docs/examples/code.md
Normal file
@ -0,0 +1,79 @@
|
||||
---
|
||||
title: "Code"
|
||||
description: "Code highlighting examples"
|
||||
lead: "Code highlighting examples"
|
||||
date: 2021-03-16T08:43:34+01:00
|
||||
lastmod: 2021-03-16T08:43:34+01:00
|
||||
draft: false
|
||||
images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "examples"
|
||||
weight: 200
|
||||
toc: true
|
||||
---
|
||||
|
||||
## JavaScript
|
||||
|
||||
```js
|
||||
function $initHighlight(block, cls) {
|
||||
try {
|
||||
if (cls.search(/\bno\-highlight\b/) != -1)
|
||||
return process(block, true, 0x0F) +
|
||||
` class="${cls}"`;
|
||||
} catch (e) {
|
||||
/* handle exception */
|
||||
}
|
||||
for (var i = 0 / 2; i < classes.length; i++) {
|
||||
if (checkCondition(classes[i]) === undefined)
|
||||
console.log('undefined');
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<web-component>{block}</web-component>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export $initHighlight;
|
||||
```
|
||||
|
||||
## JSON
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"title": "apples",
|
||||
"count": [12000, 20000],
|
||||
"description": {"text": "...", "sensitive": false}
|
||||
},
|
||||
{
|
||||
"title": "oranges",
|
||||
"count": [17500, null],
|
||||
"description": {"text": "...", "sensitive": false}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## Bash
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
###### CONFIG
|
||||
ACCEPTED_HOSTS="/root/.hag_accepted.conf"
|
||||
BE_VERBOSE=false
|
||||
|
||||
if [ "$UID" -ne 0 ]
|
||||
then
|
||||
echo "Superuser rights required"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
genApacheConf(){
|
||||
echo -e "# Host ${HOME_DIR}$1/$2 :"
|
||||
}
|
||||
|
||||
echo '"quoted"' | tr -d \" > text.txt
|
||||
```
|
Reference in New Issue
Block a user