Update doc load and add nvm doc

This commit is contained in:
Gabriel Pastori 2023-12-01 01:27:23 -03:00
parent 3e003725d9
commit fb6636ed87
9 changed files with 161 additions and 13 deletions

View File

@ -1,3 +1,5 @@
[title]: \\ "CLI"
# Evolution-Manager CLI
## Description

View File

@ -0,0 +1,58 @@
[title]: \\ "Installing Node Using NVM"
# Installing Node.js with NVM
This guide provides step-by-step instructions on how to install Node.js on Linux using NVM (Node Version Manager).
## Prerequisites
- Access to a terminal in Linux.
- Permissions to execute installation commands (usually as a root user or with `sudo`).
## Step 1: Install NVM
NVM is a tool that allows you to manage multiple versions of Node.js. To install it, execute the following command in your terminal:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
```
*Note: You can check the latest version of NVM on their [GitHub page](https://github.com/nvm-sh/nvm).*
After installation, close and reopen the terminal, and then run the following command to check if NVM was installed correctly:
```bash
nvm --version
```
## Step 2: Install Node.js
With NVM installed, you can now install Node.js. To install the latest version, use the command:
```bash
nvm install node
```
To install a specific version of Node.js, you can do:
```bash
nvm install 18
```
After installation, verify the Node.js version with:
```bash
node -v
```
## Step 3: Use a Specific Version of Node.js
You can switch between installed versions of Node.js with the `nvm use` command:
```bash
nvm use 18 # replace 18 with the version you want to use
```
## Conclusion
You now have NVM installed on your Linux system, allowing you to install and manage multiple versions of Node.js. This is particularly useful for developers working on multiple projects that may require different versions of Node.js.

View File

@ -1,3 +1,5 @@
[title]: \\ "About"
# Evolution Manager
## Introduction

View File

@ -1,3 +1,5 @@
[title]: \\ "CLI"
# Evolution-Manager CLI
## Instalação

View File

@ -0,0 +1,58 @@
[title]: \\ "Instalar Node usando NVM"
# Instalando Node.js com NVM
Este guia fornece instruções passo a passo sobre como instalar o Node.js no Linux usando o NVM (Node Version Manager).
## Pré-requisitos
- Acesso a um terminal no Linux.
- Permissões para executar comandos de instalação (geralmente como usuário root ou com `sudo`).
## Passo 1: Instalar NVM
NVM é uma ferramenta que permite gerenciar múltiplas versões do Node.js. Para instalá-lo, execute o seguinte comando no seu terminal:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
```
*Nota: Você pode verificar a versão mais recente do NVM na [página do GitHub](https://github.com/nvm-sh/nvm).*
Após a instalação, feche e reabra o terminal, e então execute o seguinte comando para verificar se o NVM foi instalado corretamente:
```bash
nvm --version
```
## Passo 2: Instalar Node.js
Com o NVM instalado, você pode instalar o Node.js. Para instalar a versão mais recente, use o comando:
```bash
nvm install node
```
Para instalar uma versão específica do Node.js, você pode fazer:
```bash
nvm install 18 # substitua 18 pela versão que você quer instalar
```
Após a instalação, verifique a versão do Node.js com:
```bash
node -v
```
## Passo 3: Usar uma Versão Específica do Node.js
Você pode alternar entre as versões instaladas do Node.js com o comando `nvm use`:
```bash
nvm use 18 # substitua 18 pela versão que você quer usar
```
## Conclusão
Agora você tem o NVM instalado no seu sistema Linux, permitindo que você instale e gerencie múltiplas versões do Node.js. Isso é especialmente útil para desenvolvedores trabalhando em múltiplos projetos que podem requerer diferentes versões do Node.js.

View File

@ -1,3 +1,6 @@
[title]: \\ "Sobre"
# Evolution Manager
## Introdução

View File

@ -15,7 +15,7 @@
</v-btn>
</v-app-bar>
<v-navigation-drawer :width="200" v-model="drawer">
<v-navigation-drawer :width="300" v-model="drawer">
<v-select
:value="lang"
:items="lang_list"
@ -33,10 +33,10 @@
<v-divider></v-divider>
<v-list-item
link
:title="doc"
v-for="doc in docs"
:key="doc"
:to="{ name: 'doc', params: { doc } }"
:title="doc.title || doc.filename || doc.path"
v-for="(doc, i) in docs"
:key="i"
:to="{ name: 'doc', params: { doc: doc.filename || doc.path } }"
/>
</v-navigation-drawer>
</template>
@ -67,12 +67,11 @@ export default {
return this.DocStore.lang;
},
docs() {
return Object.keys(this.DocStore.docs).filter((doc) => doc !== "index");
return Object.values(this.DocStore.docs).map((doc) => doc[this.lang]).filter((doc) => doc);
},
dark() {
return this.theme.global.current.dark;
},
files() {},
},
mounted() {
this.DocStore.loadDocs();

View File

@ -20,7 +20,7 @@ export const useDocStore = defineStore('doc', {
try {
const { languages, docs } = getFileTree();
this.languages = languages;
this.docs = docs;
this.docs = docs;
} catch (error) {
console.log(error);
}
@ -29,7 +29,7 @@ export const useDocStore = defineStore('doc', {
try {
const { language } = this;
const doc = this.docs[path]
const content = await doc[language]();
const content = doc[language].content
return {
content,
language,
@ -44,7 +44,7 @@ export const useDocStore = defineStore('doc', {
// Function to get the file tree from @doc
function getFileTree() {
const tree = import.meta.glob('@docs/**/*.{md,mdx}', { as: 'raw'})
const tree = import.meta.glob('@docs/**/*.{md,mdx}', { as: 'raw', eager: true })
const docsFiles = {}
const languages = new Set()
@ -54,7 +54,15 @@ function getFileTree() {
const filename = rest.join('/').replace(/\.mdx?$/, '')
docsFiles[filename] = docsFiles[filename] || {}
docsFiles[filename][lang] = imprt
const vars = extractVars(imprt);
docsFiles[filename][lang] = {
path,
filename,
content: imprt,
...vars,
}
})
return {
@ -62,3 +70,19 @@ function getFileTree() {
docs: docsFiles,
}
}
function extractVars(content) {
const regex = /\[([a-zA-Z]+)\]: \\\\ "(.*)"/g;
const vars = {};
let m;
while ((m = regex.exec(content)) !== null) {
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
vars[m[1]] = m[2];
}
return vars;
}

View File

@ -76,8 +76,8 @@ export default {
</script>
<style>
.markdown-body[data-theme=dark] {
.markdown-body[data-theme="dark"] {
background-color: #121212 !important;
color: #fff !important;
}
</style>
</style>