-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from sasial-dev/docs
Add Docs
- Loading branch information
Showing
22 changed files
with
2,227 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Docs | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy Docs | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: yarn | ||
- name: Get latest zap release | ||
uses: robinraju/[email protected] | ||
with: | ||
latest: true | ||
fileName: "zap-*-wasm.tgz" | ||
out-file-path: "staging" | ||
- name: Extract file | ||
run: tar -xvzf staging/zap-*-wasm.tgz -C zap | ||
- name: Install Dependencies | ||
run: yarn install --frozen-lockfile --force | ||
- name: Build | ||
run: yarn docs:build | ||
- uses: actions/configure-pages@v2 | ||
- uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: docs/.vitepress/dist | ||
- name: Deploy | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
zap.redblox.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<div class="language-" :style="styles"> | ||
<Editor | ||
:modelValue="props.code" | ||
:options="{ ...(props.isCodeBlock ? CODEBLOCK_OPTIONS : EDITOR_OPTIONS), ...props.options }" | ||
:lang="lang" | ||
:isCodeBlock="props.isCodeBlock" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type monacoEditor from 'monaco-editor/esm/vs/editor/editor.api'; | ||
import { ref, watch } from 'vue'; | ||
const props = withDefaults(defineProps<{ code: string, options?: monacoEditor.editor.IStandaloneEditorConstructionOptions, lang?: string, isCodeBlock?: boolean }>(), { | ||
isCodeBlock: true | ||
}) | ||
defineEmits<{ (e: "update:modelValue", value: string): void }>() | ||
const styles = ref() | ||
watch( | ||
() => props.code, | ||
(code: string) => { | ||
styles.value = { | ||
width: "100%", | ||
height: Math.min(code.split("\n").length * (props.options?.lineHeight ?? 18), 460) + 40 + "px", | ||
padding: "20px 0px", | ||
background: props.isCodeBlock ? undefined : "transparent" | ||
}; | ||
}, | ||
{ immediate: true }, | ||
); | ||
; | ||
const EDITOR_OPTIONS: monacoEditor.editor.IStandaloneEditorConstructionOptions = { readOnly: true, scrollBeyondLastLine: false } | ||
const CODEBLOCK_OPTIONS: monacoEditor.editor.IStandaloneEditorConstructionOptions = { ...EDITOR_OPTIONS, minimap: { enabled: false }, lineNumbers: "off", scrollbar: { vertical: "hidden", horizontal: "hidden", handleMouseWheel: false }, overviewRulerLanes: 0 } | ||
</script> | ||
|
Oops, something went wrong.