-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
551 additions
and
20 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
docs/document/Articles/docs/Integrating Cygwin with VSCode.md
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,66 @@ | ||
# Integrating Cygwin with VSCode in Windows | ||
|
||
## Installation | ||
|
||
Follow guide from [Cygwin](https://cygwin.com/). | ||
|
||
## Add terminal profile in `settings.json` | ||
|
||
Add new profile for cygwin, this will register a new option when we choose to launch a new integrated terminal. | ||
|
||
```json{15, 19} | ||
{ | ||
"terminal.integrated.profiles.windows": { | ||
"PowerShell": { | ||
"source": "PowerShell", | ||
"icon": "terminal-powershell" | ||
}, | ||
"Command Prompt": { | ||
"path": ["${env:windir}\\Sysnative\\cmd.exe", "${env:windir}\\System32\\cmd.exe"], | ||
"args": [], | ||
"icon": "terminal-cmd" | ||
}, | ||
"Git Bash": { | ||
"source": "Git Bash" | ||
}, | ||
"Cygwin": { | ||
"path": "C:\\cygwin64\\bin\\bash.exe", | ||
"args": ["--login"], | ||
"overrideName": true | ||
} | ||
}, | ||
} | ||
``` | ||
|
||
Then we got a new option to create a integrated terminal. | ||
![cygwin-option](../pics/cygwin-profile.png) | ||
|
||
:::info | ||
For more information: [Terminal Profiles](https://code.visualstudio.com/docs/terminal/profiles#_cygwin). | ||
::: | ||
|
||
## Change default working directory of cygwin in `.bashrc` | ||
|
||
The default working directory of cygwin is `{installation-path}\home\{username}` like `C:\cygwin64\home\anon`. | ||
|
||
You might like to launch cygwin with working directory as the root of current user. | ||
|
||
- Open cygwin, make sure you're at `~` | ||
|
||
```bash | ||
cd ~ | ||
``` | ||
|
||
- Execute this line into `.bashrc`. | ||
|
||
```bash | ||
touch .bashrc && echo 'cd /cygdrive/c/users/{username}' >> .bashrc | ||
``` | ||
|
||
- Check the content is successfully appended. | ||
|
||
```bash | ||
cat .bashrc | ||
``` | ||
|
||
- Launch a new cygwin instance, it will start at your user root. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions
72
docs/document/CesiumJS/docs/1. Init your cesium project with vite.md
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,72 @@ | ||
# Init your cesium project with vite | ||
|
||
## Create a latest vue3 project | ||
|
||
Redirect to your working directory, run | ||
|
||
```bash | ||
pnpm create vue@latest | ||
``` | ||
|
||
Follow the instruction, select options based on your need.(It's recommended to work with `typescript`, `vite` and `Vue Router`) | ||
|
||
:::info | ||
For more information: [Vue3 Tooling](https://vuejs.org/guide/scaling-up/tooling.html#project-scaffolding) | ||
::: | ||
|
||
## Add [cesium vite plugin](/~https://github.com/s3xysteak/vite-plugin-cesium-build) | ||
|
||
```bash | ||
pnpm add -D vite-plugin-cesium-build | ||
``` | ||
|
||
```ts{9} | ||
import { fileURLToPath, URL } from 'node:url'; | ||
import { defineConfig } from 'vite'; | ||
import vue from '@vitejs/plugin-vue'; | ||
import vueJsx from '@vitejs/plugin-vue-jsx'; | ||
import cesium from 'vite-plugin-cesium-build'; | ||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [vue(), vueJsx(), cesium()], | ||
resolve: { | ||
alias: { | ||
'@': fileURLToPath(new URL('./src', import.meta.url)) | ||
} | ||
} | ||
}); | ||
``` | ||
|
||
## Add a earth at `App.vue` | ||
|
||
Delete auto-generated template, add following code. | ||
|
||
```vue | ||
<script setup lang="ts"> | ||
import { Viewer } from 'cesium'; | ||
import 'cesium/Build/Cesium/Widgets/widgets.css'; | ||
import { onMounted, ref, shallowRef } from 'vue'; | ||
const cesium = ref<Element | null>(null); | ||
const viewer = shallowRef<Viewer | null>(null); | ||
onMounted(() => { | ||
viewer.value = new Viewer(cesium.value as Element); | ||
}); | ||
</script> | ||
<template> | ||
<div ref="cesium" style="height: 100vh; width: 100vw"></div> | ||
</template> | ||
<style scoped></style> | ||
``` | ||
|
||
Start the server. | ||
|
||
```bash | ||
pnpm dev | ||
``` | ||
|
||
:::warning | ||
Check scripts in `package.json` to make sure you use the right command, auto-generated scripts might differ from versions. | ||
::: |
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
Oops, something went wrong.