From 39757db8ffcea8291850af538bea8ac5fedb586d Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Wed, 12 Dec 2018 17:12:48 -0600 Subject: [PATCH] Update docs to use new Spring style sheets. --- spring-credhub-docs/build.gradle | 55 ++++++++++++++++++- .../src/docs/asciidoc/boot-configuration.adoc | 4 +- .../src/docs/asciidoc/index.adoc | 2 +- .../src/docs/asciidoc/operations.adoc | 2 +- .../docs/asciidoc/reactive-operations.adoc | 2 +- 5 files changed, 57 insertions(+), 8 deletions(-) diff --git a/spring-credhub-docs/build.gradle b/spring-credhub-docs/build.gradle index b564d2d..22efdfc 100644 --- a/spring-credhub-docs/build.gradle +++ b/spring-credhub-docs/build.gradle @@ -29,17 +29,66 @@ description = "Spring CredHub Documentation" apply plugin: 'org.asciidoctor.convert' +repositories { + maven { url "https://repo.spring.io/libs-snapshot-local" } + mavenCentral() +} + +configurations { + docs +} + dependencies { compile project(":spring-credhub-core") compile("io.projectreactor:reactor-core") + + docs("io.spring.docresources:spring-doc-resources:0.1.1.BUILD-SNAPSHOT@zip") +} + +task prepareAsciidocBuild(type: Sync) { + dependsOn configurations.docs + // copy doc resources + from { + configurations.docs.collect { zipTree(it) } + } + // and doc sources + from "src/docs/asciidoc" + // to a temporary build directory + into "$buildDir/asciidoc" } asciidoctor { - sourceDir = file('src/docs/asciidoc') - attributes 'revnumber': project.version, + sourceDir = file("$buildDir/asciidoc") + sources { + include '*.adoc' + } + resources { + from(sourceDir) { + include 'images/*', 'css/**', 'js/**' + } + } + logDocuments = true + backends = ["html5"] + options doctype: 'book', eruby: 'erubis' + attributes 'icons': 'font', + 'idprefix': '', + 'idseparator': '-', + docinfo: 'shared', + revnumber: project.version, + 'spring-version': project.version, 'branch-or-tag': project.version.endsWith('SNAPSHOT') ? 'master' : "v${project.version}", + sectanchors: '', + sectnums: '', + stylesdir: "css/", + stylesheet: 'spring.css', + 'linkcss': true, 'nofooter': true, - 'allow-uri-read': '' + 'allow-uri-read': '', + 'source-highlighter=highlight.js', + 'highlightjsdir=js/highlight', + 'highlightjs-theme=atom-one-dark-reasonable' } +asciidoctor.dependsOn prepareAsciidocBuild + configurations.archives.artifacts.clear() diff --git a/spring-credhub-docs/src/docs/asciidoc/boot-configuration.adoc b/spring-credhub-docs/src/docs/asciidoc/boot-configuration.adoc index 70b6ef4..405e6f8 100644 --- a/spring-credhub-docs/src/docs/asciidoc/boot-configuration.adoc +++ b/spring-credhub-docs/src/docs/asciidoc/boot-configuration.adoc @@ -16,7 +16,7 @@ To use mutual TLS authentication to a CredHub server, simply provide the URL of [source,properties,%autofit] ---- -include::{examples-dir}/config-minimal.yml[] +include::{examples-dir}config-minimal.yml[] ---- See the {credhub-api-mtls}[CredHub documentation] for more information on mutual TLS authentication. @@ -30,7 +30,7 @@ Spring CredHub supports client credentials grant tokens for authentication using [source,properties,%autofit] ---- -include::{examples-dir}/config-oauth2.yml[] +include::{examples-dir}config-oauth2.yml[] ---- The ID provided in `spring.credhub.oauth2.registration-id` must refer to a client configured under `spring.security.oauth2.client.registration`. diff --git a/spring-credhub-docs/src/docs/asciidoc/index.adoc b/spring-credhub-docs/src/docs/asciidoc/index.adoc index 669644c..e0dd39c 100644 --- a/spring-credhub-docs/src/docs/asciidoc/index.adoc +++ b/spring-credhub-docs/src/docs/asciidoc/index.adoc @@ -8,7 +8,7 @@ Scott Frederick; :toclevels: 3 :sectlinks: -:examples-dir: ../../test/java/com/example/credhub/ +:examples-dir: ../../src/test/java/com/example/credhub/ :credhub-home: https://docs.cloudfoundry.org/credhub/ :credhub-api-home: https://credhub-api.cfapps.io/ :credhub-api-credentials: {credhub-api-home}version/2.0/#credentials diff --git a/spring-credhub-docs/src/docs/asciidoc/operations.adoc b/spring-credhub-docs/src/docs/asciidoc/operations.adoc index bc12465..dad2068 100644 --- a/spring-credhub-docs/src/docs/asciidoc/operations.adoc +++ b/spring-credhub-docs/src/docs/asciidoc/operations.adoc @@ -65,5 +65,5 @@ Application classes can autowire an instance of this bean to interact with a Cre [source,java,%autofit] ---- -include::{examples-dir}/CredHubService.java[] +include::{examples-dir}CredHubService.java[] ---- diff --git a/spring-credhub-docs/src/docs/asciidoc/reactive-operations.adoc b/spring-credhub-docs/src/docs/asciidoc/reactive-operations.adoc index c3026ae..2f662d7 100644 --- a/spring-credhub-docs/src/docs/asciidoc/reactive-operations.adoc +++ b/spring-credhub-docs/src/docs/asciidoc/reactive-operations.adoc @@ -65,5 +65,5 @@ Application classes can autowire an instance of this bean to interact with a Cre [source,java,%autofit] ---- -include::{examples-dir}/ReactiveCredHubService.java[] +include::{examples-dir}ReactiveCredHubService.java[] ----