Jolene 2 lat temu
commit
ee7ec21db9
43 zmienionych plików z 899 dodań i 0 usunięć
  1. 25 0
      README.md
  2. 12 0
      docker-compose.yaml
  3. 32 0
      dockerbuild/Dockerfile
  4. 112 0
      dockerbuild/README.md
  5. 12 0
      dockerbuild/build.sh
  6. 25 0
      dockerbuild/demo/page1.md
  7. 17 0
      dockerbuild/demo/page2.md
  8. 6 0
      dockerbuild/dot_vuepress/compdir/demo.vue
  9. 30 0
      dockerbuild/dot_vuepress/components/clock.vue
  10. 6 0
      dockerbuild/dot_vuepress/components/demo.vue
  11. 5 0
      dockerbuild/dot_vuepress/components/dummy.vue
  12. 65 0
      dockerbuild/dot_vuepress/components/graph.vue
  13. 29 0
      dockerbuild/dot_vuepress/components/imageroll.vue
  14. 59 0
      dockerbuild/dot_vuepress/components/myimg-2.vue
  15. 74 0
      dockerbuild/dot_vuepress/components/myimg.vue
  16. 4 0
      dockerbuild/dot_vuepress/components/viz.js
  17. 109 0
      dockerbuild/dot_vuepress/config.js
  18. 15 0
      dockerbuild/dot_vuepress/enhanceApp.js
  19. 9 0
      dockerbuild/dot_vuepress/modules/module1/index.js
  20. 11 0
      dockerbuild/dot_vuepress/modules/module1/package.json
  21. 32 0
      dockerbuild/dot_vuepress/plugins/pageData/README.md
  22. 7 0
      dockerbuild/dot_vuepress/plugins/pageData/index.js
  23. 14 0
      dockerbuild/dot_vuepress/plugins/pageData/package.json
  24. 2 0
      dockerbuild/dot_vuepress/plugins/plugin-demo/README.md
  25. 16 0
      dockerbuild/dot_vuepress/plugins/plugin-demo/index.js
  26. 14 0
      dockerbuild/dot_vuepress/plugins/plugin-demo/package.json
  27. 1 0
      dockerbuild/dot_vuepress/public/DAGS
  28. 1 0
      dockerbuild/dot_vuepress/public/DataMigration
  29. 1 0
      dockerbuild/dot_vuepress/public/Demos
  30. 1 0
      dockerbuild/dot_vuepress/public/Features
  31. 1 0
      dockerbuild/dot_vuepress/public/Main/images
  32. 1 0
      dockerbuild/dot_vuepress/public/Operators
  33. 1 0
      dockerbuild/dot_vuepress/public/Services
  34. 1 0
      dockerbuild/dot_vuepress/public/Tasks
  35. BIN
      dockerbuild/dot_vuepress/public/favicon.ico
  36. 1 0
      dockerbuild/dot_vuepress/public/videos
  37. 4 0
      dockerbuild/dot_vuepress/public/viz.js
  38. 17 0
      dockerbuild/dot_vuepress/styles/index.styl
  39. 4 0
      dockerbuild/dot_vuepress/styles/palette.styl
  40. 35 0
      dockerbuild/entrypoint.sh
  41. 12 0
      dockerbuild/init.json
  42. 58 0
      dockerbuild/match-query.js
  43. 18 0
      dockerbuild/package.json

+ 25 - 0
README.md

@@ -0,0 +1,25 @@
+
+
+run.sh - build docker image kinisi/vuepress and push to docker,io
+
+Samle docker-compose - slower at first run to initialise
+
+```
+version: '3.3'
+services:
+
+  vuepress :
+
+    image: kinisi/vuepress
+    container_name : vuepress
+    restart : always
+    # volumes:
+    #  - ./docs:/vp/docs
+    ports :
+      - 8088:8080
+    command : [ 'npm' , 'run' , 'docs:dev' ]
+    working_dir: /vp
+```
+
+- extract the docs folder and replace with with my own
+- access at host:8088

+ 12 - 0
docker-compose.yaml

@@ -0,0 +1,12 @@
+version: '3.1'
+
+services:
+
+  tpress :
+
+    image : kinisi/vuepress
+    ports : [ 8080:8080 ]
+    volumes :
+      - ./markdowns:/vp/docs
+    # command : [ "sleep" , "30000" ]
+    command : [ npm , run , docs:dev ]

+ 32 - 0
dockerbuild/Dockerfile

@@ -0,0 +1,32 @@
+FROM node:18.10.0
+
+
+ENV TERM=linux
+ENV NODE_OPTIONS=--openssl-legacy-provider
+
+WORKDIR "/vp"
+
+COPY init.json package.json
+
+RUN apt-get update
+RUN apt-get install vim -y
+RUN npm install -D vuepress -loglevel verbose
+
+COPY package.json package.json
+COPY dot_vuepress /tmp/stash/dot_vuepress
+COPY README.md /tmp/stash/README.md
+COPY demo /tmp/stash/demo
+
+RUN npm install -D @vuepress/plugin-register-components -loglevel verbose
+# RUN npm install nextapps-de/flexsearch#0.6.22 -loglevel verbose
+
+ARG modules="directory-tree vuepress-plugin-code-copy vuepress-plugin-graphviz vuepress-plugin-mermaidjs vuepress-plugin-tabs vue-tabs-component markdown-it-html5-embed"
+
+RUN for mod in ${modules} ; do npm install --save-dev $mod -loglevel verbose ; done
+
+COPY match-query.js node_modules/@vuepress/plugin-search/match-query.js
+
+COPY entrypoint.sh /entrypoint.sh
+
+ENTRYPOINT ["/entrypoint.sh"]
+CMD [ "npm" , "run" , "docs:dev" ]

+ 112 - 0
dockerbuild/README.md

@@ -0,0 +1,112 @@
+---
+pageClass: custom-page-class
+title : mine
+sidebar : true 
+navbar : true
+---
+
+# My Markdown
+
+[doc](https://v2.vuepress.vuejs.org/)
+
+Time now : <clock style="display:inline"></clock>.  This page is README.md
+
+Calling my component demo :
+<demo />
+
+::: slot footer
+MIT Licensed | Copyright © 2018-present [Evan You](https://github.com/yyx990803)
+:::
+
+<code-group>
+<code-block title="YARN">
+```bash
+yarn create vuepress-site [optionalDirectoryName]
+```
+</code-block>
+
+<code-block title="NPM" active>
+```bash
+npx create-vuepress-site [optionalDirectoryName]
+```
+</code-block>
+</code-group>
+
+# QCH
+
+Changes
+
+-   Amend file docs/.vuepress/config.js to examine the folder docs and display it as a tree.
+
+-   save/match-query.js will replace node_modules/@vuepress/plugin-search/match-query.js - so that it searches entire document instead of just title headers and $ tag ( debugging messages in console.log if > 4 characters )
+
+```
+  if ( query.length < 4 ) return false ;
+  // console.log ( { in : "match-query.js" , query , path : page.path } ) ;
+  var res = matchTest(query, page.pagecontent) ;
+  return res ;
+```
+
+File config.js set the max number of suggestions
+
+```
+	// sidebar
+	themeConfig: {
+		sidebar: sidebar,
+		searchMaxSuggestions : 10 ,
+		lastUpdated: 'Last Updated' 			// string | boolean 
+	},
+```
+
+Run this.  Bc it is installing to .vuepress, has to do it AFTER starting the container
+
+```
+npm install --save-dev /vp/docs/.vuepress/plugins/pageData
+```
+
+-   amend docs/.vuepress/plugins/pageData/index.js and change from $page.pagecontent = $page.content to $page.pagecontent = $page.\_content
+
+# Adding a component
+
+Just add the VUE file to .vuepress/components, no need to declare anything.
+
+# Add an external JS file
+
+Add this to .vuepress/config.js
+
+```
+	head: [
+		['script', { src: 'https://cdnjs.cloudflare.com/ajax/libs/viz.js/1.3.0/viz.js' }]
+	]
+```
+
+# Add a plugin.
+
+See .vuepress/plugins/pageData for sample.
+
+
+## Building vuepress
+
+kinisi/vuepress should be used for all markdowns.  It is built in adele:/vuepress/build.
+
+Run with this docker-compose 
+
+``` yaml
+  vuepress :
+
+    image: kinisi/vuepress
+    restart : always
+    volumes:
+      - ./markdowns:/vp/docs
+    ports :
+      - 5555:8080
+    working_dir: /vp
+    command :
+      - /bin/sh
+      - -c
+      - |
+        npm install --save-dev /vp/docs/.vuepress/plugins/pageData
+        npm run docs:dev
+```
+
+The adele/docs folder contains all the markdowns and should have a .vuepress folder.  There is a sample .vuepress in the /vp image.

+ 12 - 0
dockerbuild/build.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export CACHE="--no-cache"
+
+docker build -t kinisi/vuepress .
+
+# push this to docker hub
+echo 'zaq1@WSXqwertyu' | docker login -u kinisi --password-stdin
+docker image push kinisi/vuepress
+
+
+

+ 25 - 0
dockerbuild/demo/page1.md

@@ -0,0 +1,25 @@
+---
+title: Page1
+sidebar: true
+navbar: true
+---
+
+# My Markdowns
+
+[doc](https://v2.vuepress.vuejs.org/)
+
+::: tip
+Hooray
+:::
+
+Hello {{ new Date().toLocaleTimeString() }} --- <Hello></Hello>
+
+[page2](page2.md)
+
+<div v-for="(n,idx) in 3">
+>---N = {{ n }}
+</div>
+
+<pre style="color:white">{{ $page }}</pre>
+
+<pre style="color:yellow">{{ $site }}</pre>

+ 17 - 0
dockerbuild/demo/page2.md

@@ -0,0 +1,17 @@
+
+<clock />
+
+<graph>
+digraph {
+  A -> B -> C, D
+}
+</graph>
+
+:::: tabs :options="{ useUrlFragment: false }"
+::: tab "Reader1"
+Reader1
+:::
+::: tab "Reader2"
+Reader2
+:::
+::::

+ 6 - 0
dockerbuild/dot_vuepress/compdir/demo.vue

@@ -0,0 +1,6 @@
+
+<template>
+    <div>
+        Another VUE component , but in .vuepress/compdir.
+    </div>
+</template>

+ 30 - 0
dockerbuild/dot_vuepress/components/clock.vue

@@ -0,0 +1,30 @@
+<template>
+    <div>{{ dtstr }}</div>
+</template>
+
+<style>
+code {
+    white-space: pre-wrap !important;
+}
+</style>
+
+<script>
+export default {
+    data() {
+        return {
+            dtstr: "boo",
+        };
+    },
+
+    mounted: function () {
+        this.startTime();
+    },
+
+    methods: {
+        startTime: function () {
+            this.dtstr = new Date().toLocaleTimeString();
+            setTimeout(this.startTime, 1000);
+        },
+    },
+};
+</script>

+ 6 - 0
dockerbuild/dot_vuepress/components/demo.vue

@@ -0,0 +1,6 @@
+
+<template>
+    <div>
+        Another VUE component , but in .vuepress/compdir.
+    </div>
+</template>

+ 5 - 0
dockerbuild/dot_vuepress/components/dummy.vue

@@ -0,0 +1,5 @@
+<template>
+  <div>
+    dummy
+  </div>
+</template>

+ 65 - 0
dockerbuild/dot_vuepress/components/graph.vue

@@ -0,0 +1,65 @@
+
+<template>
+  <div>
+    <div :id="id" v-show="noshow">
+      <slot></slot>
+    </div>
+    <div class="image" v-html="image"></div>
+  </div>
+</template>
+
+<style scoped>
+.input {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  top: 56px;
+  width: 100%;
+  height: 100%;
+}
+
+.image {
+    position: relative;
+}
+</style>
+
+
+<script>
+
+export default {
+
+  data() {
+    return {
+      id : 0 ,
+      noshow : false ,
+      dots: 'digraph "x"{\n  1->2\n  5->2;\n  1->3;\n  3->4;\n  4->1\n}'
+    }
+  } ,
+
+  /*
+  beforeMount() {
+    var newScript = document.createElement("script"); 
+    newScript.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/viz.js/1.3.0/viz.js' ) ;
+    document.body.appendChild(newScript);
+  } ,
+  */
+  created() {
+    this.id = Math.floor(Math.random() * 5000);
+  } ,
+
+  mounted() {
+    var slotdata = document.getElementById(this.id) ;
+    console.log ( { slotdata , text : slotdata.outerText }  ) ;
+    this.dots = slotdata.outerText ;
+    // this.image = Viz( slotdata.outerText , {format: 'svg'});
+  } ,
+
+  computed: {
+    image : function(){
+      var image = Viz(this.dots, {format: 'svg'});
+      return image;
+    }
+  }
+}
+
+</script>

+ 29 - 0
dockerbuild/dot_vuepress/components/imageroll.vue

@@ -0,0 +1,29 @@
+
+<template>
+  <div class="grid">
+    <img v-for="img in images" width=70% :src="img">
+  </div>
+</template>
+
+<style scoped>
+.grid {
+  align : center ;
+  display : flex ;
+  flex-direction : row ;
+  flex-wrap: wrap ;
+}
+
+</style>
+
+<script>
+export default {
+
+  props : {
+    images : Array
+  } ,
+
+  mounted : function() {
+    console.log ( { images : this.images } ) ;
+  }
+};
+</script>

+ 59 - 0
dockerbuild/dot_vuepress/components/myimg-2.vue

@@ -0,0 +1,59 @@
+
+<template>
+  <div align="center">
+    <table :width="width">
+      <tr class="header"><td v-if="title1">{{  title1 }}</td><td v-if="title2">{{  title2 }}</td></tr>
+      <tr>
+        <td width=50%><img :src="path1"></td>
+        <td width=50%><img :src="path2"></td>
+      </tr>
+    </table>
+  </div>
+</template>
+
+<style scoped>
+table {
+  border : 1px solid black ;
+  border-collapse: collapse;
+}
+th, td {
+  padding: 15px;
+  border : 1px solid black ;
+  text-align: left;
+}
+
+.header {
+  background-color:grey ;
+  color : white ;
+}
+
+img {
+  object-fit: contain;
+}
+</style>
+
+<script>
+
+export default {
+
+  computed : {
+    path1 : function() { return "/" + this.me + "/images/" + this.data1 } ,
+    path2 : function() { return "/" + this.me + "/images/" + this.data2 }
+
+  } ,
+
+  props : {
+    me : String ,
+    width : String ,
+    title1 : String ,
+    title2 : String ,
+    data1 : String ,
+    data2 : String ,
+  } ,
+
+  methods : {
+
+
+  }
+}
+</script>

+ 74 - 0
dockerbuild/dot_vuepress/components/myimg.vue

@@ -0,0 +1,74 @@
+
+<template>
+  <div class="divimg">
+      <img :src="path" :width="nwidth" :style="style">
+  </div>
+</template>
+
+<style scoped>
+.divimg {
+  text-align : center ;
+}
+
+img {
+  border : 1px solid purple ;
+  object-fit: contain ;
+}
+</style>
+
+
+<script>
+
+export default {
+
+  computed : {
+    path : function() {
+      return "/" + this.me + "/images/" + this.data ;
+    }  ,
+
+    nwidth : function() {
+
+
+      return this.width || '80%' ;
+    }
+
+  } ,
+
+  props : {
+    me : String ,
+    data : String ,
+    dim : String ,
+    width : String ,
+  } ,
+
+  data() {
+    return {
+      style : {}
+    }
+
+  } ,
+
+  mounted : function() {
+
+      if ( this.dim ) {
+        this.style = {} ;
+        const regex = /(\d+)x(\d+)/;
+        const found = this.dim.match(regex);
+        if ( found[1] > 0 ) {
+          this.style['width'] = found[1] + "px" ;
+        }
+        if ( found[2] > 0 ) {
+          this.style['height'] = found[2] + "px" ;
+        }
+        console.log ( { style : this.style } ) ;
+      }
+
+  } ,
+
+  methods : {
+
+
+  }
+
+}
+</script>

Plik diff jest za duży
+ 4 - 0
dockerbuild/dot_vuepress/components/viz.js


+ 109 - 0
dockerbuild/dot_vuepress/config.js

@@ -0,0 +1,109 @@
+
+const util = require('util')
+const path = require("path");
+const dirTree = require("directory-tree");
+const tree = dirTree("docs");
+const fs = require("fs");
+
+console.log("Current directory:", __dirname);
+
+/* 
+	This transform the node from dirTree into a form acceptable by Vuepress sidebar 
+	a.name becomes a.text
+	a.path becomes a.link , and remove this field if there is children and set collapsible to true
+	recursively do the same operator for each a.children
+*/
+function transform_sidebar(child) {
+
+	child.title = child.name.replace(".md", "");;
+	child.link = child.path.replace("docs", "");
+
+	if (child.link == "/README.md") {
+		child.link = "/";		/* special case */
+		child.title = "Home";
+	}
+
+	/* no children , return array of link/text */
+	if (!child.children) {
+		return [child.link, child.title];
+	}
+
+	/* return as a hash record with title/children */
+	if (child.children) {
+
+		let rec = { title: child.title, collapsible: true, children: [] };
+		child.children.forEach(children => {
+			/* bad child if this is a terminating node */
+			if (!children.name.endsWith(".md") && !children.children) {
+				// console.log("Ignoring : " + children.name)
+				return;
+			}
+			rec.children.push(transform_sidebar(children));
+		});
+		return rec;
+	}
+}
+
+// comment
+
+let sidebar = [];
+
+tree.children.forEach(child => {
+	if (child.name == ".vuepress") return;
+	if (child.name == ".npmignore") return;
+	sidebar.push(transform_sidebar(child));
+});
+
+console.log("SIDEBAR", sidebar[8]);
+
+
+module.exports = {
+
+	title: 'Kinisi-User-Guide',
+	description: 'Just playing around',
+
+	head: [
+		['link', { rel: 'icon', href: '/favicon.ico' }]
+	],
+
+	server: {
+		hmr: { port: 8080 },
+	},
+
+	// sidebar
+	themeConfig: {
+		sidebar: sidebar,
+		searchMaxSuggestions: 10,
+		lastUpdated: 'Last Updated' 			// string | boolean 
+	},
+
+	plugins: [
+		["vuepress-plugin-code-copy", { staticIcon: true, align: 'top' }],
+		['@vuepress/plugin-register-components', { componentsDir: "/vp/docs/.vuepress/compdir" }],
+		['tabs'],
+		// ["demo", { car: 'mercedes' }],
+		["pagedata", { car: 'mercedes' }]
+		// ['vuepress-plugin-graphviz']
+	],
+
+	// add javascript to header
+	head: [
+		// ['script', { src: 'https://cdnjs.cloudflare.com/ajax/libs/viz.js/1.3.0/viz123.js' }]
+		['script', { src: '/viz.js' }]
+	],
+
+	/*
+	markdown: {
+		extendMarkdown: md => {
+			md.use(require('markdown-it-html5-embed'), {
+				html5embed: {
+					useImageSyntax: true,
+					useLinkSyntax: false
+				}
+			})
+		}
+	}
+	*/
+
+}
+

+ 15 - 0
dockerbuild/dot_vuepress/enhanceApp.js

@@ -0,0 +1,15 @@
+
+//  view these console messages on the browser console
+
+// async function is also supported, too
+export default ({
+
+  Vue, // the version of Vue being used in the VuePress app
+  options, // the options for the root Vue instance
+  router, // the router instance for the app
+  siteData, // site metadata
+  isServer // is this enhancement applied in server-rendering or client
+}) => {
+  // ...apply enhancements to the app
+  console.log({ Vue, options, router, siteData, isServer });
+}

+ 9 - 0
dockerbuild/dot_vuepress/modules/module1/index.js

@@ -0,0 +1,9 @@
+
+// <script src='https://cdnjs.cloudflare.com/ajax/libs/viz.js/1.3.0/viz.js' ></script >
+
+exports.printMsg = function () {
+
+  console.log("This is a message from the demo package");
+
+}
+

+ 11 - 0
dockerbuild/dot_vuepress/modules/module1/package.json

@@ -0,0 +1,11 @@
+{
+  "name": "filesearch",
+  "version": "1.0.0",
+  "description": "Search for text in file",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "ah poh",
+  "license": "ISC"
+}

+ 32 - 0
dockerbuild/dot_vuepress/plugins/pageData/README.md

@@ -0,0 +1,32 @@
+
+# Purpose
+
+The current search is on tags , titles etc.  I want to search the entire file content.  This is a plugin that does the following
+
+- extend page by setting page.pagecontent to the page._content ( not available to Search plugin )
+- modify the match-query.js to search on page._content instead of tags/titles/headers
+
+# Module info
+
+Name of package : vuepress-plugin-pagedata".  Install via inside the docker exec
+
+cd /vp
+npm install --save-dev /vp/docs/.vuepress/plugins/pageData
+
+verify package.json
+
+```
+  "devDependencies": {
+    "vuepress-plugin-pagedata": "file:docs/.vuepress/plugins/pageData"
+  },
+```
+
+add this to .vuepress/config.js
+
+```
+plugins: [
+		[ "pagedata" , { car : 'mercedes' } ]
+	]
+```
+
+Verify that module is loaded on npm run docs:dev console.

+ 7 - 0
dockerbuild/dot_vuepress/plugins/pageData/index.js

@@ -0,0 +1,7 @@
+
+// Assigning to exports will not modify module, must use module.exports
+module.exports = (options, ctx) => ({
+	extendPageData($page) {
+		$page.pagecontent = $page._content;
+	}
+})

+ 14 - 0
dockerbuild/dot_vuepress/plugins/pageData/package.json

@@ -0,0 +1,14 @@
+{
+  "name": "vuepress-plugin-pagedata",
+  "version": "1.0.0",
+  "description": "Get page data",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [
+    "none"
+  ],
+  "author": "ahpoh",
+  "license": "ISC"
+}

+ 2 - 0
dockerbuild/dot_vuepress/plugins/plugin-demo/README.md

@@ -0,0 +1,2 @@
+
+# Make a plugin module to Vuepress

+ 16 - 0
dockerbuild/dot_vuepress/plugins/plugin-demo/index.js

@@ -0,0 +1,16 @@
+
+const fs = require("fs") ;
+
+console.log ( "demo plugin loaded" ) ;
+
+// Assigning to exports will not modify module, must use module.exports
+module.exports = (options, ctx) => {
+	console.log ( { options , ctx } ) ;
+	console.log ( { pages : ctx.pages , sourceDir : ctx.sourceDir }) ;
+	console.log ( { me : this} ) ;
+	console.trace() ;
+	
+   	return {
+		fruit : 'Banana' 
+   	}
+}

+ 14 - 0
dockerbuild/dot_vuepress/plugins/plugin-demo/package.json

@@ -0,0 +1,14 @@
+{
+  "name": "vuepress-plugin-demo",
+  "version": "1.0.0",
+  "description": "Demo",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [
+    "none"
+  ],
+  "author": "ahpoh",
+  "license": "ISC"
+}

+ 1 - 0
dockerbuild/dot_vuepress/public/DAGS

@@ -0,0 +1 @@
+../../DAGS

+ 1 - 0
dockerbuild/dot_vuepress/public/DataMigration

@@ -0,0 +1 @@
+../../DataMigration

+ 1 - 0
dockerbuild/dot_vuepress/public/Demos

@@ -0,0 +1 @@
+../../Demos

+ 1 - 0
dockerbuild/dot_vuepress/public/Features

@@ -0,0 +1 @@
+../../Features

+ 1 - 0
dockerbuild/dot_vuepress/public/Main/images

@@ -0,0 +1 @@
+../../../images

+ 1 - 0
dockerbuild/dot_vuepress/public/Operators

@@ -0,0 +1 @@
+../../Operators

+ 1 - 0
dockerbuild/dot_vuepress/public/Services

@@ -0,0 +1 @@
+../../Services

+ 1 - 0
dockerbuild/dot_vuepress/public/Tasks

@@ -0,0 +1 @@
+../../Tasks

BIN
dockerbuild/dot_vuepress/public/favicon.ico


+ 1 - 0
dockerbuild/dot_vuepress/public/videos

@@ -0,0 +1 @@
+../../videos

Plik diff jest za duży
+ 4 - 0
dockerbuild/dot_vuepress/public/viz.js


+ 17 - 0
dockerbuild/dot_vuepress/styles/index.styl

@@ -0,0 +1,17 @@
+
+/* page-specific rules */
+.theme-container.custom-page-class {
+    color : blue ;
+    
+}
+
+/* override page font size */
+div.theme-default-content:not(.custom) {
+    font-size : 15px ;
+}
+
+div.theme-default-content pre {
+    font-size : 12px ;
+}
+
+@require '~vuepress-plugin-tabs/dist/themes/default.styl'

+ 4 - 0
dockerbuild/dot_vuepress/styles/palette.styl

@@ -0,0 +1,4 @@
+
+/* https://vuepress.vuejs.org/config/#palette-styl */
+
+$contentWidth = 90%

+ 35 - 0
dockerbuild/entrypoint.sh

@@ -0,0 +1,35 @@
+#!/bin/bash
+
+set -x
+
+# Copy README.md to /vp/docs if it does not exists
+if [ ! -f /vp/docs/README.md ] ; then
+	cp /tmp/stash/README.md /vp/docs/README.md
+fi
+
+# Copy demo folder to /vp/docs if it does not exists
+if [ ! -d /vp/docs/demo ] ; then
+	cp -r /tmp/stash/demo /vp/docs
+fi
+
+if [ ! -d /vp/docs/.vuepress ] ; then
+	echo Copy dot_vuepress
+	cp -r /tmp/stash/dot_vuepress /vp/docs/.vuepress
+fi
+
+if [ ! -f /var/tmp/init ] ; then
+	echo npm install --save-dev /vp/docs/.vuepress/plugins/pageData -loglevel verbose
+	npm install --save-dev /vp/docs/.vuepress/plugins/pageData -loglevel verbose
+	touch /var/tmp/init
+fi
+
+case "$1" in
+	npm )
+		echo Entrypoint
+    	exec "$@"
+    	;;
+	*)
+    	# The command is something like bash. Just run it in the right environment.
+    	exec "$@"
+    	;;
+esac

+ 12 - 0
dockerbuild/init.json

@@ -0,0 +1,12 @@
+{
+  "name": "vp",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC"
+}
+

+ 58 - 0
dockerbuild/match-query.js

@@ -0,0 +1,58 @@
+import get from 'lodash/get';
+
+export default (query, page, additionalStr = null) => {
+
+
+  let domain = get(page, 'title', '')
+
+  if (get(page, 'frontmatter.tags')) {
+    domain += ` ${page.frontmatter.tags.join(' ')}`
+  }
+
+  if (additionalStr) {
+    domain += ` ${additionalStr}`
+  }
+
+  // Search page.pagecontent instead of domain
+  // var res = matchTest(query, domain) ;
+  if (query.length < 4) return false;
+
+  var res = matchTest(query, page.pagecontent);
+  return res;
+}
+
+const matchTest = (query, domain) => {
+  const escapeRegExp = str => str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')
+
+  // eslint-disable-next-line no-control-regex
+  const nonASCIIRegExp = new RegExp('[^\x00-\x7F]')
+
+  const words = query
+    .split(/\s+/g)
+    .map(str => str.trim())
+    .filter(str => !!str)
+
+  if (!nonASCIIRegExp.test(query)) {
+    // if the query only has ASCII chars, treat as English
+    const hasTrailingSpace = query.endsWith(' ')
+    const searchRegex = new RegExp(
+      words
+        .map((word, index) => {
+          if (words.length === index + 1 && !hasTrailingSpace) {
+            // The last word - ok with the word being "startswith"-like
+            return `(?=.*\\b${escapeRegExp(word)})`
+          } else {
+            // Not the last word - expect the whole word exactly
+            return `(?=.*\\b${escapeRegExp(word)}\\b)`
+          }
+        })
+        .join('') + '.+',
+      'gi'
+    )
+    return searchRegex.test(domain)
+  } else {
+    // if the query has non-ASCII chars, treat as other languages
+    return words.some(word => domain.toLowerCase().indexOf(word) > -1)
+  }
+}
+

+ 18 - 0
dockerbuild/package.json

@@ -0,0 +1,18 @@
+{
+  "name": "vp",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC",
+  "devDependencies": {
+    "vuepress": "^1.9.7"
+  },
+  "scripts": {
+    "docs:dev": "vuepress dev docs --debug",
+    "docs:build": "vuepress build docs"
+  }
+}

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików