diff --git a/preview-src/1.0/index.adoc b/preview-src/1.0/index.adoc new file mode 100644 index 0000000..001fba7 --- /dev/null +++ b/preview-src/1.0/index.adoc @@ -0,0 +1,5 @@ += Spring Foobar + +Spring Foobar v1.0. + + diff --git a/preview-src/5.5/index.adoc.yml b/preview-src/1.0/index.adoc.yml similarity index 61% rename from preview-src/5.5/index.adoc.yml rename to preview-src/1.0/index.adoc.yml index b68381e..34c4c24 100644 --- a/preview-src/5.5/index.adoc.yml +++ b/preview-src/1.0/index.adoc.yml @@ -1,13 +1,13 @@ -url: /5.5/index.html +url: /1.0/index.html component: - name: micrometer -version: '5.5.9' + name: foobar +version: '1.0.0' latest: url: '/index.html' - version: '6.1.0' - displayVersion: '6.1.0' - title: 'Micrometer' - versionSegment: '5.6' + version: '2.0.0' + displayVersion: '2.0.0' + title: 'Spring Foobar' + versionSegment: '2.0' previous: content: Quickstart url: '#' @@ -17,7 +17,7 @@ next: url: '#' urlType: 'internal' breadcrumbs: - - content: Micrometer + - content: Spring Foobar url: '#' urlType: fragment - content: Overview diff --git a/preview-src/5.5/index.adoc b/preview-src/5.5/index.adoc deleted file mode 100644 index b2686d2..0000000 --- a/preview-src/5.5/index.adoc +++ /dev/null @@ -1,3 +0,0 @@ -= Micrometer - -This is 5.5 version so we can test updating to the latest version of something. diff --git a/preview-src/baz/index.adoc b/preview-src/baz/index.adoc new file mode 100644 index 0000000..952df26 --- /dev/null +++ b/preview-src/baz/index.adoc @@ -0,0 +1,3 @@ += Spring Baz + +This only has a single version so we can test that. diff --git a/preview-src/baz/index.adoc.yml b/preview-src/baz/index.adoc.yml new file mode 100644 index 0000000..0b66e61 --- /dev/null +++ b/preview-src/baz/index.adoc.yml @@ -0,0 +1,16 @@ +url: /baz/index.html +component: + name: baz +version: '1.0.0' +previous: + content: Quickstart + url: '#' + urlType: 'internal' +next: + content: Liber Recusabo + url: '#' + urlType: 'internal' +breadcrumbs: + - content: Spring Baz + url: '#' + urlType: fragment diff --git a/preview-src/index.adoc b/preview-src/index.adoc index a8ec6bf..108eccf 100644 --- a/preview-src/index.adoc +++ b/preview-src/index.adoc @@ -1,597 +1,3 @@ -= Introduction -:page-author: Jon Doe, Eric Doe -:idprefix: -:idseparator: - -:!example-caption: -:!table-caption: -:page-pagination: -:chomp-package-replacement: com.acme -:tabs-sync-option: -:page-related-doc-categories: security -:page-related-doc-projects: framework += Overview -image:multirepo-ssg.svg[Multirepo SSG,200,float=right] -Platonem complectitur mediocritatem ea eos. -Ei nonumy deseruisse ius. -Mel id omnes verear. -Vis no velit audiam, sonet <> eum ne. -*Prompta eripuit* nec ad. -Integer diam enim, dignissim eget eros et, ultricies mattis odio. -Vestibulum consectetur nec urna a luctus. -Quisque pharetra tristique arcu fringilla dapibus. -https://example.org[Curabitur,role=unresolved] ut massa aliquam, cursus enim et, accumsan lectus. - -== Cu solet - -Nominavi luptatum eos, an vim hinc philosophia intellegebat. -Lorem pertinacia `expetenda` et nec, [.underline]#wisi# illud [.line-through]#sonet# qui ea. -Eum an doctus <>. -Eu mea inani iriure. - -[source,json] ----- -{ - "name": "module-name", - "version": "10.0.1", - "description": "An example module to illustrate the usage of package.json", - "author": "Author Name ", - "scripts": { - "test": "mocha", - "lint": "eslint" - } -} ----- - -.Example paragraph syntax -[source,asciidoc] ----- -.Optional title -[example] -This is an example paragraph. ----- - -.Optional title -[example] -This is an example paragraph. - -=== Code Folding - -Fold with no replacement text. - -[,java] ----- -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class MyApplication { - public static void main(String[] args) { - // @fold:on - // @formatter:off - SpringApplication.run(MyApplication.class, args); - // @formatter:on - // @fold:off - } -} ----- - -Same fold with replacement text. - -[,java] ----- -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class MyApplication { - public static void main(String[] args) { - // @fold:on // reveal logic... - // @formatter:off - SpringApplication.run(MyApplication.class, args); - // @formatter:on - // @fold:off - } -} ----- - -Another example of folds. - -[,java,chomp=all] ----- -package org.example; - -import java.net.InetAddress; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -@ConfigurationProperties("my.service") -public class MyProperties { - // @fold:on // fields... - private boolean enabled; - - private InetAddress remoteAddress; - - private final Security security = /* @chomp:line // instantiate your instance of the Security class... */ new Security(); - // @fold:off - - // @fold:on // getters / setters... - public boolean isEnabled() { - return this.enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public InetAddress getRemoteAddress() { - return this.remoteAddress; - } - - public void setRemoteAddress(InetAddress remoteAddress) { - this.remoteAddress = remoteAddress; - } - - public Security getSecurity() { - return this.security; - } - // @fold:off -} ----- - -=== Tabs - -You can have code in different tabs: - -ifdef::asciidoctor-tabs-loaded[] -.`FilterChain` Usage Example -[tabs] -==== -Java:: -+ -[,java] ----- -public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) { - // do something before the rest of the application - chain.doFilter(request, response); // invoke the rest of the application - // do something after the rest of the application -} ----- - -Kotlin:: -+ -[,kotlin] ----- -fun doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain) { - // do something before the rest of the application - chain.doFilter(request, response) // invoke the rest of the application - // do something after the rest of the application -} ----- - -Wide Table:: -+ -|=== -|Spring Boot 2.x |ClientRegistration - -|`spring.security.oauth2.client.registration._[registrationId]_` -|`registrationId` - -|`spring.security.oauth2.client.registration._[registrationId]_.client-id` -|`clientId` - -|`spring.security.oauth2.client.registration._[registrationId]_.client-secret` -|`clientSecret` - -|`spring.security.oauth2.client.registration._[registrationId]_.client-authentication-method` -|`clientAuthenticationMethod` - -|`spring.security.oauth2.client.registration._[registrationId]_.authorization-grant-type` -|`authorizationGrantType` -|=== -+ -The table should fit within the tab panel and scroll horizontally. -==== -endif::[] -ifndef::asciidoctor-tabs-loaded[] -.`FilterChain` Usage Example -==== -.Java -[source,java,role="primary"] ----- -public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) { - // do something before the rest of the application - chain.doFilter(request, response); // invoke the rest of the application - // do something after the rest of the application -} ----- - -.Kotlin -[source,kotlin,role="secondary"] ----- -fun doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain) { - // do something before the rest of the application - chain.doFilter(request, response) // invoke the rest of the application - // do something after the rest of the application -} ----- -==== -endif::[] - -=== Some Code - -How about some code? - -[source,js] ----- -vfs - .src('js/vendor/*.js', { cwd: 'src', cwdbase: true, read: false }) - .pipe(tap((file) => { // <1> - file.contents = browserify(file.relative, { basedir: 'src', detectGlobals: false }).bundle() - })) - .pipe(buffer()) // <2> - .pipe(uglify()) - .pipe(gulp.dest('build')) ----- -<1> The tap function is used to wiretap the data in the pipe. -<2> Wrap each streaming file in a buffer so the files can be processed by uglify. -Uglify can only work with buffers, not streams. - -Execute these commands to validate and build your site: - - $ podman run -v $PWD:/antora:Z --rm -t antora/antora \ - version - 3.0.0 - $ podman run -v $PWD:/antora:Z --rm -it antora/antora \ - --clean \ - antora-playbook.yml - -Cum dicat #putant# ne. -Est in <> homero principes, meis deleniti mediocrem ad has. -Altera atomorum his ex, has cu elitr melius propriae. -Eos suscipit scaevola at. - -.... -pom.xml -src/ - main/ - java/ - HelloWorld.java - test/ - java/ - HelloWorldTest.java -.... - -Eu mea munere vituperata constituam. - -[%autowidth] -|=== -|Input | Output | Example - -m|"foo\nbar" -l|foo -bar -a| -[source,ruby] ----- -puts "foo\nbar" ----- -|=== - -Select menu:File[Open Project] to open the project in your IDE. -Per ea btn:[Cancel] inimicus. -Ferri kbd:[F11] tacimates constituam sed ex, eu mea munere vituperata kbd:[Ctrl,T] constituam. - -.Sidebar Title -**** -Platonem complectitur mediocritatem ea eos. -Ei nonumy deseruisse ius. -Mel id omnes verear. - -Altera atomorum his ex, has cu elitr melius propriae. -Eos suscipit scaevola at. -**** - -=== Liber recusabo - -No sea, at invenire voluptaria mnesarchum has. -Ex nam suas nemore dignissim, vel apeirian democritum et. -At ornatus splendide sed, phaedrum omittantur usu an, vix an noster voluptatibus. - -[upperalpha] -. potenti donec cubilia tincidunt -. etiam pulvinar inceptos velit quisque aptent himenaeos -. lacus volutpat semper porttitor aliquet ornare primis nulla enim - -Natum facilisis theophrastus an duo. -No sea, at invenire voluptaria mnesarchum has. - -[square] -* ultricies sociosqu tristique integer -* lacus volutpat semper porttitor aliquet ornare primis nulla enim -* etiam pulvinar inceptos velit quisque aptent himenaeos - -Eu sed antiopam gloriatur. -Ea mea agam graeci philosophia. - -* [ ] todo -* [x] done! - -Vis veri graeci legimus ad. - -sed:: -splendide sed - -mea:: -agam graeci - -Let's look at that another way. - -[horizontal] -sed:: -splendide sed - -mea:: -agam graeci - -At ornatus splendide sed. - -.Library dependencies -[#dependencies%footer,stripes=hover] -|=== -|Library |Version - -|eslint -|^1.7.3 - -|eslint-config-gulp -|^2.0.0 - -|expect -|^1.20.2 - -|istanbul -|^0.4.3 - -|istanbul-coveralls -|^1.0.3 - -|jscs -|^2.3.5 - -h|Total -|6 -|=== - -Cum dicat putant ne. -Est in reque homero principes, meis deleniti mediocrem ad has. -Altera atomorum his ex, has cu elitr melius propriae. -Eos suscipit scaevola at. - -[TIP] -This oughta do it! - -Cum dicat putant ne. -Est in reque homero principes, meis deleniti mediocrem ad has. -Altera atomorum his ex, has cu elitr melius propriae. -Eos suscipit scaevola at. - -[NOTE] -==== -You've been down _this_ road before. -==== - -Cum dicat putant ne. -Est in reque homero principes, meis deleniti mediocrem ad has. -Altera atomorum his ex, has cu elitr melius propriae. -Eos suscipit scaevola at. - -[WARNING] -==== -Watch out! -==== - -[CAUTION] -==== -[#inline]#I wouldn't try that if I were you.# -==== - -[IMPORTANT] -==== -Don't forget this step! -==== - -.Key Points to Remember -[TIP] -==== -If you installed the CLI and the default `site-generator` globally, you can upgrade both of them with the same command. - - $ npm i -g @antora/cli @antora/site-generator-default -==== - -Nominavi luptatum eos, an vim hinc philosophia intellegebat. -Eu mea inani iriure. - -[discrete] -== Voluptua singulis - -Cum dicat putant ne. -Est in reque homero principes, meis deleniti mediocrem ad has. -Ex nam suas nemore dignissim, vel apeirian democritum et. - -.Antora is a multi-repo documentation site generator -image::multirepo-ssg.svg[Multirepo SSG,250] - -Make the switch today! - -[#english+中文] -== English + 中文 - -Altera atomorum his ex, has cu elitr melius propriae. -Eos suscipit scaevola at. - -[quote, 'Famous Person. Cum dicat putant ne.', 'Cum dicat putant ne. https://example.com[Famous Person Website]'] -____ -Lorem ipsum dolor sit amet, consectetur adipiscing elit. -Mauris eget leo nunc, nec tempus mi? Curabitur id nisl mi, ut vulputate urna. -Quisque porta facilisis tortor, vitae bibendum velit fringilla vitae! Lorem ipsum dolor sit amet, consectetur adipiscing elit. -Mauris eget leo nunc, nec tempus mi? Curabitur id nisl mi, ut vulputate urna. -Quisque porta facilisis tortor, vitae bibendum velit fringilla vitae! -____ - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. - -[verse] -____ -The fog comes -on little cat feet. -____ - -== Font Awesome - -Showing a gear icon: icon:gear[] - -== Headers - -=== H3 - -==== H4 - -===== H5 - -====== H6 - - -== Edge cases - -There are a few things that can trip our stylesheet up if we're not careful: - - -=== Title with Code (`withcode`) - -Restdocs uses these and they should look nice. - -=== Long Tables - -A table with long entries and no breakable space. - -[cols="1,2", options="header"] -.Issues -|=== -|Name -|Description - -|VeryLongNameWithoutBreakableSpaceVeryLongNameWithoutBreakableSpaceVeryLongNameWithoutBreakableSpaceVeryLongNameWithoutBreakableSpace -|This is an edge case - -|Name -|Another entry -|=== - -That's the end of that. - - - -=== Another Long Table - -When a Spring Boot application starts: - -[cols="2,2,2,3,5"] -|=== -|Startup phase |LivenessState |ReadinessState |HTTP server |Notes - -|Starting -|`BROKEN` -|`REFUSING_TRAFFIC` -|Not started -|Kubernetes checks the "liveness" Probe and restarts the application if it takes too long. - -|Started -|`CORRECT` -|`REFUSING_TRAFFIC` -|Refuses requests -|The application context is refreshed. The application performs startup tasks and does not receive traffic yet. - -|Ready -|`CORRECT` -|`ACCEPTING_TRAFFIC` -|Accepts requests -|Startup tasks are finished. The application is receiving traffic. -|=== - -When a Spring Boot application shuts down: - -[cols="2,2,2,3,5"] -|=== -|Shutdown phase |Liveness State |Readiness State |HTTP server |Notes - -|Running -|`CORRECT` -|`ACCEPTING_TRAFFIC` -|Accepts requests -|Shutdown has been requested. - -|Graceful shutdown -|`CORRECT` -|`REFUSING_TRAFFIC` -|New requests are rejected -|If enabled, <>. - -|Shutdown complete -|N/A -|N/A -|Server is shut down -|The application context is closed and the application is shut down. -|=== - -TIP: Check out the Kubernetes container lifecycle section for more information about Kubernetes deployment. - - - -=== Long Shell Blocks - -A shell code block can also break things: - -[indent=0,subs="attributes"] ----- - . ____ _ __ _ _ - /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ -( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ - \\/ ___)| |_)| | | | | || (_| | ) ) ) ) - ' |____| .__|_| |_|_| |_\__, | / / / / - =========|_|==============|___/=/_/_/_/ - :: Spring Boot :: v{spring-boot-version} - -2019-04-31 13:09:54.117 INFO 56603 --- [ main] o.s.b.s.app.SampleApplication : Starting SampleApplication v0.1.0 on mycomputer with PID 56603 (/apps/myapp.jar started by pwebb) -2019-04-31 13:09:54.166 INFO 56603 --- [ main] ationConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6e5a8246: startup date [Wed Jul 31 00:08:16 PDT 2013]; root of context hierarchy -2019-04-01 13:09:56.912 INFO 41370 --- [ main] .t.TomcatServletWebServerFactory : Server initialized with port: 8080 -2019-04-01 13:09:57.501 INFO 41370 --- [ main] o.s.b.s.app.SampleApplication : Started SampleApplication in 2.992 seconds (JVM running for 3.658) ----- - - -=== Code With `nowrap` - -Have some HTTP that also has `nowrap` set: - -[source,http,options="nowrap"] ----- -HTTP/1.1 200 OK -Content-Type: application/vnd.spring-boot.actuator.v3+json -Content-Length: 121 -{ - "events" : [ { - "timestamp" : "2021-03-18T16:49:30.625Z", - "principal" : "alice", - "type" : "logout" - } ] -} ----- - - - - -== Fin - -That's all, folks! +Antora UI Spring theme. diff --git a/preview-src/index.adoc.yml b/preview-src/index.adoc.yml index e749e0b..b192cbb 100644 --- a/preview-src/index.adoc.yml +++ b/preview-src/index.adoc.yml @@ -1,7 +1,7 @@ url: /index.html component: - name: micrometer -version: '6.1.0' + name: foobar +version: '2.0.0' latest: url: '/index.html' previous: diff --git a/preview-src/redirect.adoc b/preview-src/redirect.adoc new file mode 100644 index 0000000..7332cb6 --- /dev/null +++ b/preview-src/redirect.adoc @@ -0,0 +1,5 @@ +:page-layout: redirect + +* xref:index.adoc[oldpage] +* xref:baz/index.adoc[#old] +* xref:samples/index.adoc[oldpage#old] diff --git a/preview-src/samples/content/index.adoc b/preview-src/samples/content/index.adoc new file mode 100644 index 0000000..cadb0e5 --- /dev/null +++ b/preview-src/samples/content/index.adoc @@ -0,0 +1,1328 @@ += Content +:antora-page-url: /samples/exploits/index.html +:page-author: Author 1, Author 2, Author 3, Author 4 +:idprefix: +:idseparator: - +:page-pagination: + +This page uses for testings **asciidoc semantic markup**. Inspired by +https://gitlab.univ-nantes.fr/bousse-e/stereopticon/-/blob/master/asciidoc-tests/index.adoc[Source] + +[.impact] +== Basics + +=== Heading and paragraphs + +==== This is an asciidoc level 3 heading + +One paragraph. + +Two paragraphs. + +=== Line Breaks + +==== Plus sign + +Rubies are red, + +Topazes are blue. + +==== Hardbreaks option + +[%hardbreaks] +Ruby is red. +Java is black. + +=== Lead style + +[.lead] +This is a lead paragraph. + + +=== Horizontal Rules + +above + +''' + +below + +=== Horizontal Rules (various syntaxes) + +--- + +- - - + +*** + +* * * + + +=== Page break + +Content before + +<<< + +Content after + +=== URLs + +The homepage for the Asciidoctor Project is https://asciidoctor.org. + +Ask questions on the http://discuss.asciidoctor.org/[*mailing list*]. + +=== Link to Relative Files + +link:protocol.json[Open the JSON file] + + +=== Footnote + +The hail-and-rainbow protocol can be initiated at five levels: +double, tertiary, supernumerary, supermassive, and apocalyptic party. +A bold statement! + +Another outrageous statement.footnote:disclaimer[] + +footnote:[The double hail-and-rainbow level makes my toes tingle.] +footnote:disclaimer[Opinions are my own.] + + +[.impact] +== Images + +=== Images + +==== Alone + +[#img-sunset] +.A mountain sunset +[link=https://www.flickr.com/photos/javh/5448336655] +image::/_/img/spring-logo.svg[Spring,300,200] + +==== Inline + +Click image:/_/img/chevron.svg[Play, 10,10] to get the party started. + + + +You can find image:https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg[Linux,25,35] everywhere these days. + + +=== Control the float + +[.float-group] +-- +[.left] +.Image A +image::/_/img/spring-logo.svg[A,240,180] + +[.left] +.Image B +image::/_/img/spring-logo.svg[B,240,180] +-- + +Text below images. + + +=== Sizing images (1) + +image::/_/img/spring-logo.svg[Spring,640,480] + +=== Sizing images (2) + +image::/_/img/spring-logo.svg[Spring,50%] + + +=== Taming SVGs + +image::/_/img/spring-logo.svg[Static,300] + +image::/_/img/spring-logo.svg[Interactive,300,opts=interactive] + +image::/_/img/spring-logo.svg[Embedded,300,opts=inline] + +[.impact] +== Text formatting + +=== Bold and italic + +_To tame_ the wild wolpertingers we needed to build a *charm*. +But **u**ltimate victory could only be won if we divined the *_true name_* of the __war__lock. + + +=== Quotation Marks and Apostrophes + +"`What kind of charm?`" Lazarus asked. "`An odoriferous one or a mineral one?`" + +Kizmet shrugged. "`The note from Olaf's desk says '`wormwood and licorice,`' but these could be normal groceries for werewolves.`" + +=== Subscript and Superscript + +"`Well the H~2~O formula written on their whiteboard could be part of a shopping list, but I don't think the local bodega sells E=mc^2^,`" Lazarus replied. + +=== Monospace + +"`Wait!`" Indigo plucked a small vial from her desk's top drawer and held it toward us. +The vial's label read: `E=mc^2^`; the `_E_` represents _energy_, but also pure _genius!_ + +=== Literal Monospace + +You can reference the value of a document attribute using the syntax `+{name}+`, where `name` is the attribute name. + +`pass:[++]` is the increment operator in C. + +=== Marking + +Werewolves are #allergic to cinnamon#. + +=== Font Awesome + +Showing a gear icon: icon:gear[] + +[.impact] +== Lists + +=== Unordered List + +.Kizmet's Favorite Authors +* Edgar Allen Poe +* Sheri S. Tepper +* Bill Bryson + +=== Nested Unordered Lists + +.Possible DefOps manual locations +* West wood maze +** Maze heart +*** Reflection pool +** Secret exit +* Untracked file in git repository + + +=== Complex List Content + +* The header in AsciiDoc is optional, but if +it is used it must start with a document title. + +* Optional Author and Revision information +immediately follows the header title. + +* The document header must be separated from + the remainder of the document by one or more + blank lines and cannot contain blank lines. + +=== List continuation + +* The header in AsciiDoc must start with a document title. ++ +-- +Here's an example of a document title: + +---- += Document Title +---- + +NOTE: The header is optional. +-- + + +=== Attaching to an ancestor list + +* parent list item +** child list item + ++ +paragraph attached to parent list item + +//- + +* grandparent list item ++ +-- +** parent list item +*** child list item +-- ++ +paragraph attached to grandparent list item + +=== Dropping the principal text + +. {blank} ++ +---- +print("one") +---- +. {blank} ++ +---- +print("one") +---- + + +=== Checklist + +==== Non-interactive + +* [*] checked +* [x] also checked +* [ ] not checked +* normal list item + +==== Interactive + +[%interactive] +* [*] checked +* [x] also checked +* [ ] not checked +* normal list item + + + +=== Ordered lists (1) + +1. Protons +2. Electrons +3. Neutrons + +//- + +. Protons +. Electrons +. Neutrons + +=== Ordered lists (2) + +[start=4] +. Step four +. Step five +. Step six + +//- + +[%reversed] +.Parts of an atom +. Protons +. Electrons +. Neutrons + +=== Nested ordered lists + + +. Step 1 +. Step 2 +.. Step 2a +.. Step 2b +. Step 3 + +//- + +. Linux +* Fedora +* Ubuntu +* Slackware +. BSD +* FreeBSD +* NetBSD + +=== Numbering Styles + + +[arabic] +. One +. Two +. Three + +[decimal] +. One +. Two +. Three + +[loweralpha] +. One +. Two +. Three + +[lowergreek] +. One +. Two +. Three + + +=== Description List (1) + +CPU:: The brain of the computer. +Hard drive:: Permanent storage for operating system and/or user files. +RAM:: Temporarily stores information the CPU uses during operation. +Keyboard:: Used to enter text or control items on the screen. +Mouse:: Used to point to and select items on your computer screen. +Monitor:: Displays information in visual form using text and graphics. + + +=== Description list (2) + +Horizontal: + +[horizontal] +CPU:: The brain of the computer. +Hard drive:: Permanent storage for operating system and/or user files. +RAM:: Temporarily stores information the CPU uses during operation. + +With lists: + + +Dairy:: +* Milk +* Eggs +Bakery:: +* Bread +Produce:: +* Bananas + + +=== Hybrid complex list (1) + + +Operating Systems:: + Linux::: + . Ubuntu + * Desktop + * Server + BSD::: + . FreeBSD + . NetBSD +Cloud Providers:: + PaaS::: + . OpenShift + . CloudBees + IaaS::: + . Amazon EC2 + +=== Question and Answer Style List + +[qanda] +What is Asciidoctor?:: + An implementation of the AsciiDoc processor in Ruby. +What is the answer to the Ultimate Question?:: 42 + + + + +[.impact] +== Blocks + +=== Block title + +Example of a list with a title: + +.TODO list +- Learn the AsciiDoc syntax +- Install Asciidoctor +- Write my document + + +=== Tabs + +ifdef::asciidoctor-tabs-loaded[] +.Usage Example +[tabs] +==== +Java:: ++ +[,java] +---- +public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) { + // do something before the rest of the application + chain.doFilter(request, response); // invoke the rest of the application + // do something after the rest of the application +} +---- + +Kotlin:: ++ +[,kotlin] +---- +fun doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain) { + // do something before the rest of the application + chain.doFilter(request, response) // invoke the rest of the application + // do something after the rest of the application +} +---- +==== + + +=== Admonition + +==== Multi-lines + +[IMPORTANT] +.title +==== +This is an important admonition +==== + +==== Single line + +CAUTION: caution + +WARNING: warning + +NOTE: note + + +=== Comment + +// A single-line comment. + +//// +Multi line +comment +//// + + +=== Example + +==== Multi-lines + +==== +This is an example +====== +This is an example inside an example +====== +==== + +==== Single line + +[example] +This is an example + +=== Fenced + +``` +This is fenced content +``` + +=== Listing / Source / Code + +==== Multi-lines + +---- +This is a listing with highlighting +that can go over multiple lines +and without any specific programming language specified +---- + +==== Single line + +[listing] +This is a listing block (ie. without highlighting) + +[source] +This is a source block (ie. with highlighting) + + +=== Code block with callouts + +[source,ruby] +---- +require 'sinatra' // <1> + +get '/hi' do // <2> + "Hello World!" // <3> +end +---- +<1> Library import +<2> URL mapping +<3> HTTP response body + +=== Code block with non-selectable callouts + +---- +line of code // <1> +line of code # <2> +line of code ;; <3> +---- +<1> A callout behind a line comment for C-style languages. +<2> A callout behind a line comment for Ruby, Python, Perl, etc. +<3> A callout behind a line comment for Clojure. + +=== Literal + +==== Multi-lines + +.... +This is a literal block +.... + +==== Single line + +[literal] +This is a literal block + +=== Open + +==== Multi-lines + +-- +This is an open anonymous block +-- + +==== Single line + +[anything] +This is an open anonymous block + + + +=== Passthrough / Stem + +==== Multi-lines + +++++ +This is a passthrough block +++++ + +==== Single line + +[pass] +This is a passthrough block + +[stem] +This is a stem block. + +=== Quote (1) + +==== Multi-lines + +.Gettysburg Address +[quote, Abraham Lincoln, Address delivered at the dedication of the Cemetery at Gettysburg] +____ +Four score and seven years ago our fathers brought forth +on this continent a new nation... + +Now we are engaged in a great civil war, testing whether +that nation, or any nation so conceived and so dedicated, +can long endure. ... +____ + +==== Single line + +[quote] +Never do today what you can put off `'til tomorrow. + + +=== Quote (2) + +"I hold it that a little rebellion now and then is a good thing, +and as necessary in the political world as storms in the physical." +-- Thomas Jefferson, Papers of Thomas Jefferson: Volume 11 + + +> I hold it that a little rebellion now and then is a good thing, +> and as necessary in the political world as storms in the physical. +> -- Thomas Jefferson, Papers of Thomas Jefferson: Volume 11 + +=== Quote (3) + +==== Air quotes (not supported) + +[, James Baldwin] +"" +Not everything that is faced can be changed. +But nothing can be changed until it is faced. +"" + + +=== Sidebar + + +==== Multi-lines + +.AsciiDoc history +**** +AsciiDoc was first released in Nov 2002 by Stuart Rackham. +It was designed from the start to be a shorthand syntax +for producing professional documents like DocBook and LaTeX. +**** + +==== Single line + +[sidebar] +sidebar block + + + +=== Verse (1) + +[verse, Carl Sandburg, Fog] +____ +The fog comes +on little cat feet. + +It sits looking +over harbor and city +on silent haunches +and then moves on. +____ + +=== Verse (2) + +[verse, Carl Sandburg, two lines from the poem Fog] +The fog comes +on little cat feet. + + + + + + +[.impact] +== Tables + +=== Simple table + +|==== + +| Cell in column 1, row 1 | Cell in column 2, row 1 + +| Cell in column 1, row 2 | Cell in column 2, row 2 + +| Cell in column 1, row 3 | Cell in column 2, row 3 + +|==== + + +=== Number of columns + +|=== + +|Cell in column 1, row 1 |Cell in column 2, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 + +|=== + + +=== Column Formatting (1) + +table with horizontal, center alignment applied to all columns + +[cols="3*^"] +|=== +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Column Formatting (2) + +table with horizontal, center alignment applied to last column + + +[cols="2*,^"] +|=== +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Column Formatting (3) + +table with vertical, middle alignment applied to all columns + +[cols="3*.^"] +|=== +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Column Formatting (4) + +table with a different vertical alignment for each column + +[cols=".<,.^,.>"] +|=== +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + +=== Column Formatting (4) + +Table rendered with column sizes adjusted by a proportional integer + +[cols="1,2,6"] +|=== +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + +=== Column Formatting (5) + +Table rendered with column sizes adjusted by a percentage + +[cols="50,20,30"] +|=== +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Column Formatting (6) + +table with variable widths and alignments + +[cols=".<2,.^5,^.>3"] +|=== +|Cell in column 1, row 1 with lots and lots and lots and lots of content +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 and another bucket of content, and then a jelly roll of content +|=== + + +=== Column Formatting (7) + +table with a header, monospaced, and strong styled column + +[cols="h,m,s,e"] +|=== +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 +|Cell in column 4, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|Cell in column 4, row 2 +|=== + +=== Cell Formatting (1) + +table where cell was duplicated across three columns + +|=== + +|Cell in column 1, row 1 |Cell in column 2, row 1 |Cell in column 3, row 1 + +3*|Same cell content in columns 1, 2, and 3 + +|Cell in column 1, row 3 +|Cell in column 2, row 3 +|Cell in column 3, row 3 + +|=== + + +=== Cell Formatting (2) + +table where cell spans three columns + +|=== + +|Cell in column 1, row 1 |Cell in column 2, row 1 |Cell in column 3, row 1 + +3+|Content in a single cell that spans columns 1, 2, and 3 + +|Cell in column 1, row 3 +|Cell in column 2, row 3 +|Cell in column 3, row 3 + +|=== + + + +=== Cell Formatting (3) + + + + +Cell spanning two rows + +|=== + +|Cell in column 1, row 1 |Cell in column 2, row 1 |Cell in column 3, row 1 + +.2+|Content in a single cell that spans rows 2 and 3 +|Cell in column 2, row 2 +|Cell in column 3, row 2 + +|Cell in column 2, row 3 +|Cell in column 3, row 3 + +|=== + + + +=== Cell Formatting (4) + + + +Cell spanning columns and rows + +|=== + +|Column 1, row 1 |Column 2, row 1 |Column 3, row 1 |Column 4, row 1 + +|Column 1, row 2 +2.3+|Content in a single cell that spans over rows and columns +|Column 4, row 2 + +|Column 1, row 3 +|Column 4, row 3 + +|Column 1, row 4 +|Column 4, row 4 +|=== + +=== Cell Formatting (5) + + +Cells aligned horizontally, vertically, and across a span of three columns + +[cols="3"] +|=== +^|Prefix the `{vbar}` with `{caret}` to center content horizontally +<|Prefix the `{vbar}` with `<` to align the content to the left horizontally +>|Prefix the `{vbar}` with `>` to align the content to the right horizontally + +.^|Prefix the `{vbar}` with a `.` and `{caret}` to center the content in the cell vertically +.<|Prefix the `{vbar}` with a `.` and `<` to align the content to the top of the cell +.>|Prefix the `{vbar}` with a `.` and `>` to align the content to the bottom of the cell + +3+^.^|This content spans three columns (`3{plus}`) and is centered horizontally (`{caret}`) and vertically (`.{caret}`) within the cell. + +|=== + +=== Cell Formatting (6) + + +Cells with source code listing + +|=== +|Source Code 1 |Source Code 2 + +a| +[source,python] +---- +import os +print "%s" %(os.uname()) +---- + +a| +[source,python] +---- +import os +print ("%s" %(os.uname())) +---- +|=== + +=== Cell Formatting (7) + + +Building a variety of cell specifiers + +|=== + +2*>m|This content is duplicated across two columns. + +It is aligned right horizontally. + +And it is monospaced. + +.3+^.>s|This cell spans 3 rows. The content is centered horizontally, aligned to the bottom of the cell, and strong. +e|This content is emphasized. + +.^l|This content is aligned to the top of the cell and literal. + +v|This cell contains a verse +that may one day expound on the +wonders of tables in an +epic sonnet. + +|=== + + +=== Header Row + + +[cols=2*,options="header"] +|=== +|Name of Column 1 +|Name of Column 2 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|=== + +=== Header Row (implicit) + +|=== +|Name of Column 1 |Name of Column 2 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|=== + +=== Footer Row + +[options="footer"] +|=== +|Name of Column 1 |Name of Column 2 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 + +|Footer in column 1, row 3 +|Footer in column 2, row 3 +|=== + + +=== Table Width (1) + + +Table with width set to 75% + +[width=75%] +|=== +|Name of Column 1 |Name of Column 2 |Name of Column 3 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Table Width (2) + + +Table using autowidth + +[%autowidth] +|=== +|Name of Column 1 |Name of Column 2 |Name of Column 3 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Table Width (3) + + +Full-width table with autowidth columns + +[%autowidth.stretch] +|=== +|Name of Column 1 |Name of Column 2 |Name of Column 3 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + +=== Table Width (3) + + +Table with both fixed and autowidth columns + +[cols="25h,~,~"] +|=== +|small |as big as the column needs to be |the rest +|=== + + +=== Table Borders (1) + +frame=topbot + +[frame=topbot] +|=== +|Name of Column 1 |Name of Column 2 |Name of Column 3 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Table Borders (2) + +frame=sides + +[frame=sides] +|=== +|Name of Column 1 |Name of Column 2 |Name of Column 3 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Table Borders (3) + +frame=none + +[frame=none] +|=== +|Name of Column 1 |Name of Column 2 |Name of Column 3 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Grid (rows) + +[grid=rows] +|=== +|Name of Column 1 |Name of Column 2 |Name of Column 3 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + + +=== Grid (cols) + +[grid=cols] +|=== +|Name of Column 1 |Name of Column 2 |Name of Column 3 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + +=== Grid (none) + +[grid=none] +|=== +|Name of Column 1 |Name of Column 2 |Name of Column 3 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 +|Cell in column 3, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|Cell in column 3, row 2 +|=== + +=== Striping (1) + +[cols=3*, stripes=even] +|=== +| A1 +| B1 +| C1 + +| A2 +| B2 +| C2 + +| A3 +| B3 +| C3 +|=== + +=== Striping (2) + +[.stripes-even,cols=3*] +|=== +| A1 +| B1 +| C1 + +| A2 +| B2 +| C2 + +| A3 +| B3 +| C3 +|=== + + +=== Orientation + +[%rotate] +|=== +|a |b +|c |d +|=== + +[orientation=landscape] +|=== +|a |b +|c |d +|=== + + +=== Nested table + +[cols="1,2a"] +|=== +| Col 1 | Col 2 + +| Cell 1.1 +| Cell 1.2 + +| Cell 2.1 +| Cell 2.2 + +[cols="2,1"] +!=== +! Col1 ! Col2 + +! C11 +! C12 + +!=== + +|=== + +=== Table Caption (1) + +.A formal table +|=== +|Name of Column 1 |Name of Column 2 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|=== + + + +=== Table Caption (2) + +[caption="Table A. "] +.A formal table +|=== +|Name of Column 1 |Name of Column 2 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|=== + + +=== Table Caption (2) + +[caption=] +.A formal table +|=== +|Name of Column 1 |Name of Column 2 + +|Cell in column 1, row 1 +|Cell in column 2, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|=== + + + +=== Escaping the Cell Separator + + +[cols=2*] +|==== +|The default separator in PSV tables is the \| character. +|The \| character is often referred to as a "`pipe`". +|==== + + +=== Delimiter-Separated Values (CSV) + +[%header,format=csv] +|=== +Artist,Track,Genre +Baauer,Harlem Shake,Hip Hop +The Lumineers,Ho Hey,Folk Rock +|=== diff --git a/preview-src/samples/content/index.adoc.yml b/preview-src/samples/content/index.adoc.yml new file mode 100644 index 0000000..c63b287 --- /dev/null +++ b/preview-src/samples/content/index.adoc.yml @@ -0,0 +1,23 @@ +url: /samples/content/index.html +component: + name: foobar +version: '2.0.0' +latest: + url: '/samples/content/index.html' + version: '2.0.0' + displayVersion: '2.0.0' + title: Spring Foobar +next: + content: Edge Cases + url: '/samples/edge-cases/index.html' + urlType: 'internal' +breadcrumbs: + - content: Spring Foobar + url: '#' + urlType: fragment + - content: Samples + url: '#' + urlType: fragment + - content: Content + url: '#' + urlType: fragment diff --git a/preview-src/samples/edge-cases/index.adoc b/preview-src/samples/edge-cases/index.adoc new file mode 100644 index 0000000..10f84fb --- /dev/null +++ b/preview-src/samples/edge-cases/index.adoc @@ -0,0 +1,124 @@ += Edge Cases +:antora-page-url: /samples/edge-cases/index.html +:tabs-sync-option: +:page-pagination: + +There are a few things that can trip our stylesheet up if we're not careful: + +== Title with Code (`withcode`) + +Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, +eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam +voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione + +Voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, +adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem + +== Long Tables + +A table with long entries and no breakable space. + +[cols="1,2", options="header"] +|=== +|Name +|Description + +|Loremipsumdolorsitamet,consecteturadipiscingelit,seddoeiusmodtemporincididuntutlaboreetdoloremagnaaliqua.Utenimadminimveniam,quisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequat.Duisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariatur +|reprehenderit in voluptate velit esse cillum dolore + +|Lorem ipsum +|consectetur adipiscing +|=== + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur + +[cols="2,2,2,3,5"] +|=== +|Startup phase |LivenessState |ReadinessState |HTTP server |Notes + +|Lorem +|`IPSUM` +|`DOLOR` +|tempor incididuntarted +|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + +|Consectetur +|`IPSUM` +|`CONSECTETUR_TEMPOR` +|ullamco laboris +|Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + +|Ipsum +|`CORRECT` +|`DOLOR_IN_REPREHENDERIT` +|fugiat nulla pariatur +|Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. +|=== + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur + +[cols="2,2,2,3,5"] +|=== +|Shutdown phase |Liveness State |Readiness State |HTTP server |Notes + +|minim veniam +|`LOREM` +|`CONSECTETUR_TEMPOR` +|ullamco laboris +|Ut enim ad minim veniam. + +|nostrud exercitation +|`DOLOR` +|`DOLOR_IN_REPREHENDERIT` +|voluptate velit esse cillum +|Lorem ipsum, <<#_long_shell_blocks,velit esse cillum dolore>>. + +|magna aliqua +|N/A +|N/A +|consectetur adipiscing elit +|exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +|=== + +== Long Shell Blocks + +A shell code block can also break things: + +[indent=0,subs="attributes"] +---- + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: v{spring-boot-version} + +2019-04-31 13:09:54.117 INFO 56603 --- [ main] o.s.b.s.app.SampleApplication : Starting SampleApplication v0.1.0 on mycomputer with PID 56603 (/apps/myapp.jar started by pwebb) +2019-04-31 13:09:54.166 INFO 56603 --- [ main] ationConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6e5a8246: startup date [Wed Jul 31 00:08:16 PDT 2013]; root of context hierarchy +2019-04-01 13:09:56.912 INFO 41370 --- [ main] .t.TomcatServletWebServerFactory : Server initialized with port: 8080 +2019-04-01 13:09:57.501 INFO 41370 --- [ main] o.s.b.s.app.SampleApplication : Started SampleApplication in 2.992 seconds (JVM running for 3.658) +---- + + +== Code With `nowrap` + +Have some HTTP that also has `nowrap` set: + +[source,http,options="nowrap"] +---- +HTTP/1.1 200 OK +Content-Type: application/vnd.spring-boot.actuator.v3+json +Content-Length: 121 +{ + "events" : [ { + "timestamp" : "2021-03-18T16:49:30.625Z", + "principal" : "alice", + "type" : "logout" + } ] +} +---- diff --git a/preview-src/samples/edge-cases/index.adoc.yml b/preview-src/samples/edge-cases/index.adoc.yml new file mode 100644 index 0000000..5cfe965 --- /dev/null +++ b/preview-src/samples/edge-cases/index.adoc.yml @@ -0,0 +1,27 @@ +url: /samples/edge-cases/index.html +component: + name: foobar +version: '2.0.0' +latest: + url: '/samples/edge-cases/index.html' + version: '2.0.0' + displayVersion: '2.0.0' + title: Spring Foobar +previous: + content: Content + url: '/samples/content/index.html' + urlType: 'internal' +next: + content: 404 + url: '/404.html' + urlType: 'internal' +breadcrumbs: + - content: Spring Foobar + url: '#' + urlType: fragment + - content: Samples + url: '#' + urlType: fragment + - content: Edge cases + url: '#' + urlType: fragment diff --git a/preview-src/samples/index.adoc b/preview-src/samples/index.adoc new file mode 100644 index 0000000..036c69a --- /dev/null +++ b/preview-src/samples/index.adoc @@ -0,0 +1,5 @@ += Samples +:antora-page-url: /samples/index.html +:page-section-summary-toc: true + +This contains a listing of samples. diff --git a/preview-src/samples/index.adoc.yml b/preview-src/samples/index.adoc.yml new file mode 100644 index 0000000..3cecf5a --- /dev/null +++ b/preview-src/samples/index.adoc.yml @@ -0,0 +1,25 @@ +url: /samples/index.html +component: + name: foobar + url: '#' +version: '2.0.0' +latest: + url: '/samples/index.html' + version: '2.0.0' + displayVersion: '2.0.0' + title: Spring Foobar +previous: + content: Quickstart + url: '#' + urlType: 'internal' +next: + content: Liber Recusabo + url: '#' + urlType: 'internal' +breadcrumbs: + - content: Spring Foobar + url: '#' + urlType: fragment + - content: Samples + url: '#' + urlType: fragment diff --git a/preview-src/search.adoc.yml b/preview-src/search.adoc.yml index e01c5fe..7538a75 100644 --- a/preview-src/search.adoc.yml +++ b/preview-src/search.adoc.yml @@ -1,7 +1,7 @@ url: /search.html component: - name: micrometer -version: '6.1.0' + name: foobar +version: '2.0.0' latest: url: '/index.html' previous: @@ -13,7 +13,7 @@ next: url: '#' urlType: 'internal' breadcrumbs: - - content: Spring Security + - content: Spring Foobar url: '#' urlType: fragment - content: Overview diff --git a/preview-src/spring-projects.adoc.yml b/preview-src/spring-projects.adoc.yml index 97e37f9..a3f6997 100644 --- a/preview-src/spring-projects.adoc.yml +++ b/preview-src/spring-projects.adoc.yml @@ -1,7 +1,7 @@ url: /all-docs.html component: - name: micrometer -version: '6.1.0' + name: foobar +version: '2.0.0' latest: url: '/index.html' previous: @@ -13,7 +13,7 @@ next: url: '#' urlType: 'internal' breadcrumbs: - - content: Spring Security + - content: Spring Foobar url: '#' urlType: fragment - content: Overview diff --git a/preview-src/ui-model.yml b/preview-src/ui-model.yml index 1801bc4..f036673 100644 --- a/preview-src/ui-model.yml +++ b/preview-src/ui-model.yml @@ -1,98 +1,123 @@ antoraVersion: '3.1.2' asciidoc: extensions: + # TIP uncomment the next line to switch to Asciidoctor Tabs + - '@asciidoctor/tabs' - '@springio/asciidoctor-extensions' site: url: http://localhost:5252 - title: Micrometer + title: Spring homeUrl: /index.html components: - - name: micrometer - title: &component_title Micrometer + - name: foobar + title: &component_title Spring Foobar url: '#' - versions: µmeter_versions - - µmeter_latest_version + versions: &foobar_versions + - &foobar_latest_version url: '/index.html' - version: '6.1.0' - displayVersion: '6.1.0' + version: '2.0.0' + displayVersion: '2.0.0' title: *component_title - versionSegment: '5.6' - - µmeter_5_5_version - url: '/5.5/index.html' - version: '5.5.9' - displayVersion: '5.5.9' - versionSegment: '5.5' - latest: *micrometer_latest_version + versionSegment: '2.0' + - &foobar_1_0_version + url: '/1.0/index.html' + version: '1.0.0' + displayVersion: '1.0.0' + versionSegment: '1.0' + latest: *foobar_latest_version + - name: baz + title: &baz_component_title Spring Baz + url: '#' + versions: + - &baz_latest_version + url: '/baz/index.html' + version: '1.0.0' + displayVersion: '1.0.0' + title: *baz_component_title + versionSegment: '1.0' + latest: *baz_latest_version shared: - micrometer: - 5.5.9: + foobar: + 1.0.0: home: true - title: Micrometer + title: Spring Foobar relativeSrcPath: index.adoc editUrl: http://example.com/project-xyz/blob/master/index.adoc component: - title: Micrometer + title: Spring Foobar url: '#' versions: - url: '/index.html' - version: '6.1.0' - displayVersion: '6.1.0' + version: '2.0.0' + displayVersion: '2.0.0' title: *component_title - versionSegment: '5.6' - - url: '/5.5/index.html' - version: '5.5.9' - displayVersion: '5.5.9' - versionSegment: '5.5' - componentVersion: *micrometer_5_5_version + versionSegment: '2.0' + - url: '/1.0/index.html' + version: '1.0.0' + displayVersion: '1.0.0' + versionSegment: '1.0' + componentVersion: *foobar_1_0_version versions: - - version: '6.1.0' - displayVersion: '6.1.0' + - version: '2.0.0' + displayVersion: '2.0.0' url: '#' - versionSegment: '5.6' - - version: '5.5.9' - displayVersion: '5.5.9' - versionSegment: '5.5' + versionSegment: '' + - version: '1.0.0' + displayVersion: '1.0.0' + versionSegment: '1.0' url: '#' navigation: - root: true items: - content: Overview - url: '/5.5/index.html' - - content: Features - url: '#' - items: - - content: Authentication - url: '#' - - content: Protection Against Exploits - url: '#' - 6.1.0: + url: '/1.0/index.html' + 2.0.0: home: true - title: Micrometer + title: Spring Foobar relativeSrcPath: index.adoc editUrl: http://example.com/project-xyz/blob/master/index.adoc component: - title: &component_title Micrometer + title: &component_title Spring Foobar url: '#' - versions: *micrometer_versions - componentVersion: *micrometer_latest_version + versions: *foobar_versions + componentVersion: *foobar_latest_version versions: - - version: '6.1.0' - displayVersion: '6.1.0' + - version: '2.0.0' + displayVersion: '2.0.0' url: '#' - versionSegment: '5.6' - - version: '5.5.9' - displayVersion: '5.5.9' + versionSegment: '' + - version: '1.0.0' + displayVersion: '1.0.0' url: '#' - versionSegment: '5.5' + versionSegment: '1.0' navigation: - root: true items: - content: Overview url: '/index.html' - - content: Concepts - url: '#' + - content: Samples + url: '/samples/index.html' items: - - content: Purpose - url: '#' - - content: Dependencies - url: '#' \ No newline at end of file + - content: Content + url: '/samples/content/index.html' + - content: Edge cases + url: '/samples/edge-cases/index.html' + - content: 404 + url: '/404.html' + baz: + 1.0.0: + home: true + title: Spring Baz + relativeSrcPath: index.adoc + editUrl: http://example.com/project-xyz/blob/master/index.adoc + component: + title: Spring Baz + url: '#' + versions: + - *baz_latest_version + componentVersion: *baz_latest_version + navigation: + - root: true + items: + - content: Baz + url: '/baz/index.html' diff --git a/src/css/doc.css b/src/css/doc.css index 46f8a2b..2ec10ee 100644 --- a/src/css/doc.css +++ b/src/css/doc.css @@ -63,7 +63,6 @@ } .doc h2:not(.discrete) { - border-bottom: 1px solid var(--section-divider-color); margin-left: -1rem; margin-right: -1rem; padding: 0.4rem 1rem 0.1rem; @@ -761,7 +760,7 @@ .doc .sidebarblock { background: var(--sidebar-background); border-radius: 0.75rem; - padding: 0.75rem 1.5rem; + padding: 1.75rem 1.5rem; } .doc .sidebarblock > .content > .title { @@ -769,7 +768,6 @@ font-weight: var(--alt-heading-font-weight); line-height: 1.3; margin-bottom: 0.5rem; - text-align: center; } .doc .sidebarblock > .content > .title + *, diff --git a/src/css/micrometer/layout.css b/src/css/micrometer/layout.css index fdea612..19ec81d 100644 --- a/src/css/micrometer/layout.css +++ b/src/css/micrometer/layout.css @@ -85,3 +85,7 @@ footer.footer img.dark { mark { background: #5accc2; } + +body.status-404 h1.page { + color: #1ba89c; +} diff --git a/src/css/nav.css b/src/css/nav.css index 6bbe200..35874be 100644 --- a/src/css/nav.css +++ b/src/css/nav.css @@ -125,10 +125,14 @@ html.is-clipped--nav { .nav-item.is-current-page > .nav-item-toggle { background: transparent url(../img/chevron-white.svg) no-repeat center / 50%; - transform: rotate(0deg); + transform: rotate(-90deg); filter: opacity(75%); } +.nav-item.is-current-page.is-active > .nav-item-toggle { + transform: rotate(0deg); +} + .dark-theme .nav-item.is-current-page > .nav-item-toggle { background: transparent url(../img/chevron.svg) no-repeat center / 50%; } diff --git a/src/css/spring/spring-404.css b/src/css/spring/spring-404.css new file mode 100644 index 0000000..2308827 --- /dev/null +++ b/src/css/spring/spring-404.css @@ -0,0 +1,20 @@ +body.status-404 .page-404 { + text-align: center; + margin: 0 auto; + padding: 4rem 0; +} +body.status-404 h1.page { + color: #086dc3; + font-size: 130px; + font-weight: 100; + line-height: 110px; + margin: 0; + padding: 0; + font-family: var(--body-font-family); +} +body.status-404 .strong { + font-weight: bold; +} +body.status-404 a { + color: #086dc3; +} diff --git a/src/css/spring/spring-doc.css b/src/css/spring/spring-doc.css index 647baa9..0f5cbfc 100644 --- a/src/css/spring/spring-doc.css +++ b/src/css/spring/spring-doc.css @@ -7,7 +7,7 @@ color: var(--page-author-font-color); padding: 1rem; margin: 1rem 0; - font-size: calc(12 / var(--rem-base) * 1rem); + font-size: calc(15 / var(--rem-base) * 1rem); font-weight: var(--body-font-weight-bold); } @@ -140,13 +140,7 @@ mark { .doc > h1#page-title { font-size: calc(42 / var(--rem-base) * 1rem); - margin: 0.2rem 0; -} - -@media screen and (min-width: 769px) { - .doc > h1#page-title { - margin-top: 0.2rem; - } + margin: 0.8rem 0 0.2rem 0; } .doc > h1#page-title + aside.toc.embedded { @@ -309,3 +303,14 @@ mark { .admonitionblock.latest { padding: 1.5rem 1rem 0; } + +/* Improve Breadcrumbs */ + +.breadcrumbs, +.breadcrumbs a { + color: var(--breadcrumb-font-color); +} + +.breadcrumbs a:hover { + color: var(--breadcrumb-hover-font-color); +} diff --git a/src/css/spring/spring-site.css b/src/css/spring/spring-site.css index eae04b9..d1c5597 100644 --- a/src/css/spring/spring-site.css +++ b/src/css/spring/spring-site.css @@ -17,4 +17,5 @@ @import "spring-base.css"; @import "spring-doc.css"; @import "spring-toc.css"; +@import "spring-404.css"; @import "spring-switchtheme.css"; diff --git a/src/css/vars.css b/src/css/vars.css index 3efdc4e..6a4ce80 100644 --- a/src/css/vars.css +++ b/src/css/vars.css @@ -155,6 +155,10 @@ --page-version-menu-background: var(--color-smoke-70); --page-version-missing-font-color: var(--color-gray-30); + /* Breadcrumbs */ + --breadcrumb-font-color: var(--body-font-light-color); + --breadcrumb-hover-font-color: var(--link_hover-font-color); + /* Doc */ --doc-font-color: var(--body-font-color); --doc-font-size: inherit; diff --git a/src/helpers/spring-projects.js b/src/helpers/spring-projects.js index 62c8f9a..364af54 100644 --- a/src/helpers/spring-projects.js +++ b/src/helpers/spring-projects.js @@ -1,6 +1,11 @@ 'use strict' module.exports = () => [ + { + href: 'https://docs.spring.io/spring-boot/', + id: 'boot', + text: 'Spring Boot', + }, { href: 'https://docs.spring.io/spring-framework/reference/', id: 'framework', diff --git a/src/js/01-nav.js b/src/js/01-nav.js index d9378a5..4557106 100644 --- a/src/js/01-nav.js +++ b/src/js/01-nav.js @@ -8,12 +8,17 @@ var navToggle1 = document.querySelector('#nav-toggle-1') var navToggle2 = document.querySelector('#nav-toggle-2') var isNavOpen = window.localStorage && window.localStorage.getItem('sidebar') === 'open' - - navToggle1.addEventListener('click', showNav) - navToggle2.addEventListener('click', showNav) - navContainer.addEventListener('click', trapEvent) - - var menuPanel = navContainer.querySelector('[data-panel=menu]') + if (navToggle1) { + navToggle1.addEventListener('click', showNav) + } + if (navToggle2) { + navToggle2.addEventListener('click', showNav) + } + var menuPanel + if (navContainer) { + navContainer.addEventListener('click', trapEvent) + menuPanel = navContainer.querySelector('[data-panel=menu]') + } if (!menuPanel) return var nav = navContainer.querySelector('.nav') @@ -26,6 +31,15 @@ menuPanel.scrollTop = 0 } + var currentActivePageItem = menuPanel.querySelector('.nav-item.is-current-page.is-active') + if (currentActivePageItem && currentActivePageItem.querySelector('.nav-item-toggle')) { + currentActivePageItem.querySelector('.nav-link').addEventListener('click', function (e) { + currentActivePageItem.querySelector('.nav-item-toggle').click() + e.preventDefault() + return false + }) + } + find(menuPanel, '.nav-item-toggle').forEach(function (btn) { var li = btn.parentElement btn.addEventListener('click', toggleActive.bind(li)) @@ -36,8 +50,6 @@ } }) - // var isOpen = false - document.querySelector('#browse-version').addEventListener('click', function () { MicroModal.show('modal-versions', { disableScroll: true, diff --git a/src/js/vendor/redirect.js b/src/js/vendor/redirect.js new file mode 100644 index 0000000..98bbf08 --- /dev/null +++ b/src/js/vendor/redirect.js @@ -0,0 +1,24 @@ +;(function () { + 'use strict' + + window.addEventListener('load', onChange) + window.addEventListener('hashchange', onChange) + + function onChange () { + const params = new URLSearchParams(window.location.search) + const page = params.get('page') || '' + const fragment = window.location.hash + const pageAndFragment = page + ((fragment.length === 1) ? '' : fragment) + let foundForFragment + let foundForPageAndFragment + const candidates = document.querySelector('body ul') + if (candidates) { + for (const candidate of candidates.children) { + const anchorElement = candidate.querySelector('a') + if (anchorElement.text === pageAndFragment) foundForPageAndFragment = anchorElement.href + if (anchorElement.text === fragment) foundForFragment = anchorElement.href + } + } + window.location.replace(foundForPageAndFragment || foundForFragment || 'index.html') + } +})() diff --git a/src/layouts/404.hbs b/src/layouts/404.hbs index 8caab1d..3cdf5af 100644 --- a/src/layouts/404.hbs +++ b/src/layouts/404.hbs @@ -5,7 +5,11 @@ {{> header}} -{{> body}} +
+
+{{> article-404}} +
+
{{> footer}} diff --git a/src/layouts/redirect.hbs b/src/layouts/redirect.hbs new file mode 100644 index 0000000..cda8699 --- /dev/null +++ b/src/layouts/redirect.hbs @@ -0,0 +1,7 @@ + + + +{{{page.contents}}} + diff --git a/src/partials/article-404.hbs b/src/partials/article-404.hbs index 436b280..c6ae38e 100644 --- a/src/partials/article-404.hbs +++ b/src/partials/article-404.hbs @@ -1,10 +1,8 @@ -
-

{{{or page.title 'Page Not Found'}}}

-
-

The page you’re looking for does not exist. It may have been moved. You can{{#with site.homeUrl}} return to the start page, or{{/with}} follow one of the links in the navigation to the left.

-
-
-

If you arrived on this page by clicking on a link, please notify the owner of the site that the link is broken. -If you typed the URL of this page manually, please double check that you entered the address correctly.

-
-
+
+

404

+
+

Oops! The page can’t be found.

+

{{#with site.homeUrl}}Go to + homepage{{/with}}

+
+
\ No newline at end of file diff --git a/src/partials/footer-content.hbs b/src/partials/footer-content.hbs index 67177d2..9d7c12c 100644 --- a/src/partials/footer-content.hbs +++ b/src/partials/footer-content.hbs @@ -2,8 +2,8 @@
diff --git a/src/partials/toc.hbs b/src/partials/toc.hbs index 54e9165..501b00f 100644 --- a/src/partials/toc.hbs +++ b/src/partials/toc.hbs @@ -37,7 +37,7 @@ {{/if}} {{#if page.origin.webUrl}} - +
- \ No newline at end of file + diff --git a/src/partials/version.hbs b/src/partials/version.hbs index 526d107..2cbc4df 100644 --- a/src/partials/version.hbs +++ b/src/partials/version.hbs @@ -45,5 +45,4 @@ - - + \ No newline at end of file