diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03d27cc7c..c6ac26f94 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -81,8 +81,42 @@ jobs: with: file: ./photon-server/build/reports/jacoco/test/jacocoTestReport.xml + build-offline-docs: + runs-on: ubuntu-latest + + steps: + # Checkout docs. + - uses: actions/checkout@v2 + with: + repository: 'PhotonVision/photonvision-docs.git' + ref: master + + # Install Python. + - uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install sphinx sphinx_rtd_theme sphinx-tabs + sudo apt install -y texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra latexmk texlive-lang-greek texlive-luatex texlive-xetex texlive-fonts-extra dvipng graphviz + - name: Check the docs + run: | + ls + make linkcheck + - name: Build the docs + run: | + make html + + # Upload docs artifact. + - uses: actions/upload-artifact@master + with: + name: built-docs + path: build/html + + build-package: - needs: [build-client, build-server] + needs: [build-client, build-server, build-offline-docs] # Let all steps run within the photon-server dir. defaults: @@ -104,7 +138,7 @@ jobs: # Clear any existing web resources. - run: | rm -rf src/main/resources/web/* - mkdir -p src/main/resources/web/ + mkdir -p src/main/resources/web/docs # Download client artifact to resources folder. - uses: actions/download-artifact@v2 @@ -112,6 +146,13 @@ jobs: name: built-client path: photon-server/src/main/resources/web/ + # Download docs artifact to resources folder. + - uses: actions/download-artifact@v2 + with: + name: built-docs + path: photon-server/src/main/resources/web/docs + + # Print folder contents. - run: ls working-directory: photon-server/src/main/resources/web/ diff --git a/photon-client/src/App.vue b/photon-client/src/App.vue index 4c421cd00..1ab43d09f 100644 --- a/photon-client/src/App.vue +++ b/photon-client/src/App.vue @@ -25,6 +25,9 @@ Settings + + Docs + diff --git a/photon-client/src/router.js b/photon-client/src/router.js index 7d7f6c59d..7277dea16 100644 --- a/photon-client/src/router.js +++ b/photon-client/src/router.js @@ -2,9 +2,9 @@ import Vue from 'vue' import Router from 'vue-router' import Camera from "./views/PipelineView"; import Settings from "./views/SettingsView"; +import Docs from "./views/DocsView"; Vue.use(Router); - export default new Router({ // mode: 'history', base: process.env.BASE_URL, @@ -19,5 +19,9 @@ export default new Router({ path: '/settings', name: 'Settings', component: Settings + }, { + path: '/docs', + name: 'Docs', + component: Docs }] }) diff --git a/photon-client/src/views/DocsView.vue b/photon-client/src/views/DocsView.vue new file mode 100644 index 000000000..2e94774ad --- /dev/null +++ b/photon-client/src/views/DocsView.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/photon-server/build.gradle b/photon-server/build.gradle index faa8b8028..6a12ad591 100644 --- a/photon-server/build.gradle +++ b/photon-server/build.gradle @@ -112,6 +112,12 @@ buildAndCopyUI.dependsOn copyClientUIToResources copyClientUIToResources.dependsOn runNpmOnClient copyClientUIToResources.shouldRunAfter runNpmOnClient +task generateJavaDocs(type: Javadoc) { + source = sourceSets.main.allJava + classpath = sourceSets.main.compileClasspath + destinationDir = file("${projectDir}/build/docs") +} + spotless { java { googleJavaFormat() diff --git a/photon-server/src/main/java/org/photonvision/common/util/ShellExec.java b/photon-server/src/main/java/org/photonvision/common/util/ShellExec.java index c172d46af..9da429d5a 100644 --- a/photon-server/src/main/java/org/photonvision/common/util/ShellExec.java +++ b/photon-server/src/main/java/org/photonvision/common/util/ShellExec.java @@ -37,7 +37,7 @@ public class ShellExec { /** * Execute a bash command. We can handle complex bash commands including multiple executions (; | - * && ||), quotes, expansions ($), escapes (\), e.g.: "cd /abc/def; mv ghi 'older ghi '$(whoami)" + * and ||), quotes, expansions ($), escapes (\), e.g.: "cd /abc/def; mv ghi 'older ghi '$(whoami)" * * @param command Bash command to execute * @return true if bash got started, but your command may have failed. diff --git a/photon-server/src/main/java/org/photonvision/vision/processes/VisionRunner.java b/photon-server/src/main/java/org/photonvision/vision/processes/VisionRunner.java index 3cbe372e2..d727f0f02 100644 --- a/photon-server/src/main/java/org/photonvision/vision/processes/VisionRunner.java +++ b/photon-server/src/main/java/org/photonvision/vision/processes/VisionRunner.java @@ -39,8 +39,8 @@ public class VisionRunner { private long loopCount; /** - * VisionRunner contains a Thread to run a pipeline, given a frame, and - * will give the result to the consumer. + * VisionRunner contains a thread to run a pipeline, given a frame, and will give the result to + * the consumer. * * @param frameSupplier The supplier of the latest frame. * @param pipelineSupplier The supplier of the current pipeline.