File tree 14 files changed +6042
-8664
lines changed 14 files changed +6042
-8664
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy Docs to Pages
2
+
3
+ on :
4
+ # Runs on pushes targeting the `docs` branch and `main` branch.
5
+ push :
6
+ branches : ["docs", "main"]
7
+
8
+ # Allows you to run this workflow manually from the Actions tab.
9
+ workflow_dispatch :
10
+
11
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages.
12
+ permissions :
13
+ contents : read
14
+ pages : write
15
+ id-token : write
16
+
17
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19
+ # concurrency:
20
+ # group: pages
21
+ # cancel-in-progress: false
22
+
23
+ jobs :
24
+ # Build the documentation.
25
+ build :
26
+ runs-on : ubuntu-latest
27
+
28
+ steps :
29
+ - uses : actions/checkout@v4
30
+
31
+ - name : Setup Node
32
+ uses : actions/setup-node@v4
33
+ with :
34
+ node-version : ' 18.17.1'
35
+ cache : npm
36
+
37
+ - name : Install dependencies
38
+ run : npm ci
39
+
40
+ - name : Build with VitePress
41
+ run : |
42
+ npm run docs:build
43
+ touch docs/.vitepress/dist/.nojekyll
44
+
45
+ - name : Upload artifact
46
+ uses : actions/upload-pages-artifact@v3
47
+ with :
48
+ path : ./docs/.vitepress/dist
49
+
50
+ # Deploy the documentation.
51
+ deploy :
52
+ environment :
53
+ name : github-pages
54
+ url : ${{ steps.deployment.outputs.page_url }}
55
+
56
+ runs-on : ubuntu-latest
57
+
58
+ needs : build
59
+
60
+ steps :
61
+ - name : Deploy to Github Pages
62
+ id : deployment
63
+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change @@ -23,3 +23,8 @@ pnpm-debug.log*
23
23
* .njsproj
24
24
* .sln
25
25
* .sw ?
26
+
27
+ # API docs
28
+ docs /.vitepress /dist
29
+ docs /.vitepress /cache
30
+ docs /components
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ You can now use the SimulationVuer in your Vue template as follows:
45
45
<SimulationVuer :apiLocation =" apiLocation" :id =123 />
46
46
```
47
47
48
- where ` apiLocation ` is the URL to the API location and ` id ` the id of the dataset.
48
+ where ` apiLocation ` is the URL to the API location and ` id ` the id of the simulation-based dataset.
49
49
50
50
## Project setup
51
51
@@ -79,3 +79,15 @@ npm run build-bundle
79
79
80
80
SimulationVuer is now being developed as a Vue 3 component only.
81
81
The [ Vue 2 version of SimulationVuer] ( https://github.com/ABI-Software/simulationvuer/tree/vue2 ) is not maintained anymore.
82
+
83
+ ## Documentation
84
+
85
+ The documentation is written using [ VitePress] ( https://vitepress.dev/ ) and [ vuese] ( https://github.com/vuese/vuese#readme ) , and it can be found in the ` docs ` folder.
86
+
87
+ #### To run in local development mode
88
+
89
+ ``` bash
90
+ npm run docs:watch
91
+ ```
92
+
93
+ This will start the documentation server with [ VitePress] ( https://vitepress.dev/ ) on port ` 5173 ` : http://localhost:5173/simulationvuer/ .
Original file line number Diff line number Diff line change
1
+ import { defineConfig } from 'vitepress'
2
+ import Components from 'unplugin-vue-components/vite'
3
+ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
4
+
5
+ const versionNumber = process . env . npm_package_version
6
+
7
+ // https://vitepress.dev/reference/site-config
8
+ export default defineConfig ( {
9
+ title : "SimulationVuer" ,
10
+ description : "API documentation for SimulationVuer" ,
11
+ base : '/simulationvuer/' ,
12
+ themeConfig : {
13
+ // https://vitepress.dev/reference/default-theme-config
14
+ nav : [
15
+ { text : 'Home' , link : '/' } ,
16
+ {
17
+ text : 'API Reference' ,
18
+ link : '/components/SimulationVuer'
19
+ }
20
+ ] ,
21
+
22
+ sidebar : [
23
+ {
24
+ text : 'Live Demo' ,
25
+ link : '/demo'
26
+ } ,
27
+ {
28
+ text : 'API Reference' ,
29
+ link : '/components/SimulationVuer'
30
+ } ,
31
+ {
32
+ text : 'Version' ,
33
+ items : [
34
+ {
35
+ text : `${ versionNumber } `
36
+ }
37
+ ]
38
+ }
39
+ ] ,
40
+
41
+ socialLinks : [
42
+ { icon : 'github' , link : 'https://github.com/ABI-Software/simulationvuer' }
43
+ ]
44
+ } ,
45
+ markdown : { attrs : { disable : true } } ,
46
+ vite : {
47
+ css : {
48
+ preprocessorOptions : {
49
+ scss : {
50
+ additionalData : `@use '../src/assets/styles' as *;`
51
+ } ,
52
+ } ,
53
+ } ,
54
+ plugins : [
55
+ Components ( {
56
+ // Allow auto load markdown components under `./src/components/`.
57
+ extensions : [ 'vue' ] ,
58
+ // Allow auto import and register the components used in markdown.
59
+ include : [ / \. v u e $ / , / \. v u e \? v u e / ] ,
60
+ resolvers : [
61
+ ElementPlusResolver ( {
62
+ importStyle : 'css' ,
63
+ } ) ,
64
+ ] ,
65
+ } ) ,
66
+ ]
67
+ }
68
+ } )
Original file line number Diff line number Diff line change
1
+ /* Modify content styles for the desktop view. */
2
+ @media (min-width : 1280px ) {
3
+ .VPContent .VPDoc .has-aside {
4
+ & .content-container {
5
+ max-width : none;
6
+ }
7
+
8
+ .content-container .vp-doc {
9
+ & table {
10
+ overflow : unset;
11
+ }
12
+
13
+ & table thead {
14
+ position : sticky;
15
+ top : 64px ; /* Navigation height. */
16
+
17
+ & th {
18
+ background-color : var (--vp-c-gray-1 );
19
+ }
20
+ }
21
+
22
+ & table tr {
23
+ th , td {
24
+ vertical-align : top;
25
+ }
26
+
27
+ th : first-child ,
28
+ td : first-child {
29
+ width : 10% ;
30
+ text-wrap : nowrap;
31
+ }
32
+
33
+ /* Description column. */
34
+ th : nth-child (2 ),
35
+ td : nth-child (2 ) {
36
+ width : 40% ;
37
+ }
38
+
39
+ th : nth-child (3 ),
40
+ td : nth-child (3 ) {
41
+ width : 10% ;
42
+ }
43
+
44
+ th : nth-child (4 ),
45
+ td : nth-child (4 ) {
46
+ width : 10% ;
47
+ }
48
+
49
+ th : last-child ,
50
+ td : last-child {
51
+ width : 20% ;
52
+ word-wrap : break-word;
53
+ word-break : break-word;
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }
Original file line number Diff line number Diff line change
1
+ import DefaultTheme from "vitepress/theme" ;
2
+ import "./custom.css" ;
3
+
4
+ export default DefaultTheme ;
Original file line number Diff line number Diff line change
1
+ .demo-map-container {
2
+ width : 100% ;
3
+ height : 0 ;
4
+ padding-bottom : 75% ;
5
+ border : 1px solid var (--vp-c-divider );
6
+ position : relative;
7
+ z-index : 1 ; /* Just for the demo, to prevent tooltips from going out of the container. */
8
+ }
9
+
10
+ .demo-map-container-inner {
11
+ width : 100% ;
12
+ height : 100% ;
13
+ position : absolute;
14
+ }
15
+
16
+ .flatmap-container {
17
+ overflow : hidden;
18
+ }
19
+
20
+ .bottom-right-control {
21
+ display : flex;
22
+ flex-direction : row;
23
+ gap : 8px ;
24
+ }
25
+
26
+ .zoomOut ,
27
+ .fitWindow {
28
+ padding-left : 0px !important ;
29
+ }
Original file line number Diff line number Diff line change
1
+ # SimulationVuer Live Demo
2
+
3
+ ## Live Demo
4
+
5
+ <div class =" demo-map-container " >
6
+ <div class =" demo-map-container-inner " >
7
+ <ClientOnly>
8
+ <SimulationVuer
9
+ :apiLocation="apiLocation"
10
+ :id="id"
11
+ />
12
+ </ClientOnly>
13
+ </div >
14
+ </div >
15
+
16
+ <script setup >
17
+ import { defineClientComponent } from " vitepress" ;
18
+ import " ./demo-styles.css" ;
19
+
20
+ const SimulationVuer = defineClientComponent (() => {
21
+ return import (" ../src/components/SimulationVuer.vue" );
22
+ })
23
+ </script >
24
+
25
+ <script >
26
+ export default {
27
+ data : function () {
28
+ return {
29
+ apiLocation: import .meta.env.VITE_API_LOCATION,
30
+ id: 135 ,
31
+ };
32
+ }
33
+ }
34
+ </script >
35
+
36
+ ## Code Preview
37
+
38
+ ``` js-vue
39
+ <div class="your-outer-container">
40
+ <SimulationVuer
41
+ :apiLocation="apiLocation"
42
+ :id="id"
43
+ />
44
+ </div>
45
+
46
+ <script>
47
+ import { SimulationVuer } from "@abi-software/simulationvuer";
48
+
49
+ export default {
50
+ components: { SimulationVuer },
51
+ data: function () {
52
+ return {
53
+ apiLocation: API_LOCATION,
54
+ id: 135,
55
+ }
56
+ }
57
+ }
58
+ </script>
59
+ ```
Original file line number Diff line number Diff line change
1
+ ---
2
+ # https://vitepress.dev/reference/default-theme-home-page
3
+ layout : home
4
+
5
+ hero :
6
+ name : " SimulationVuer"
7
+ text : " API documentation"
8
+ tagline : SimulationVuer is a Vue component used in the SPARC portal to run some simulation-based datasets.
9
+ actions :
10
+ - theme : brand
11
+ text : API Reference
12
+ link : /components/SimulationVuer
13
+ - theme : alt
14
+ text : Demo
15
+ link : /demo
16
+ ---
You can’t perform that action at this time.
0 commit comments