Skip to content

Commit

Permalink
#332 Include existing (live) code where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Aug 15, 2024
1 parent 94abbb0 commit 391854f
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@
public class AllCheckers {
public static final List<Class<? extends Checker>> CHECKER_CLASSES =
Arrays.asList(
// Keep the list ordering to ensure comparability with HSC 1.x versions
// tag::checker-classes[]
// Keep the list ordering to ensure
// report ordering comparability
// with HSC 1.x versions
MissingAltInImageTagsChecker.class,
MissingImageFilesChecker.class,
DuplicateIdChecker.class,
BrokenHttpLinksChecker.class,
ImageMapChecker.class,
BrokenCrossReferencesChecker.class,
MissingLocalResourcesChecker.class
// end::checker-classes[]
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ private static Set<Integer> join (Set<Integer> first, Set<Integer> second) {
422, 423, 424, 425, 426,
428, 429, 431, 451,
500, 501, 502, 503, 504,
505, 506, 507, 508, 510, 511
505, 506, 507, 508, 510,
511
// end::HTTP_ERROR_CODES[]
)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.language.base.plugins.LifecycleBasePlugin

// tag::gradle-plugin-implementation[]
class HtmlSanityCheckPlugin implements Plugin<Project> {

final static String HTML_SANITY_CHECK = "htmlSanityCheck"
Expand All @@ -19,6 +20,7 @@ class HtmlSanityCheckPlugin implements Plugin<Project> {

}
}
// end::gradle-plugin-implementation[]


/*========================================================================
Expand Down
6 changes: 4 additions & 2 deletions src/docs/arc42/chapters/_config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ ifndef::imagesdir[:imagesdir: ../images]

ifndef::projectRootDir[:projectRootDir: ../../../..]

:coresourcepath: {projectRootDir}/htmlSanityCheck-core/src/main/java/org/aim42
:coretestpath: {projectRootDir}/htmlSanityCheck-core/src/test/groovy/org/aim42
:core-source-path: {projectRootDir}/htmlSanityCheck-core/src/main/java/org/aim42
:core-test-path: {projectRootDir}/htmlSanityCheck-core/src/test/groovy/org/aim42
:gradle-plugin-source-path: {projectRootDir}/htmlSanityCheck-gradle-plugin/src/main/groovy/org/aim42
:gradle-plugin-test-path: {projectRootDir}/htmlSanityCheck-gradle-plugin/src/test/groovy/org/aim42

:asciidoctor-gradle-plugin-url: https://github.com/asciidoctor/asciidoctor-gradle-plugin

Expand Down
3 changes: 1 addition & 2 deletions src/docs/arc42/chapters/chap-01-Requirements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ See the following snippet, taken from the unit test class `WebTest.groovy`:
[source, groovy]
.Generic URI Structure
----
include::{coretestpath}/htmlsanitycheck/tools/WebTest.groovy[tags=GenericURIExample]
include::{core-test-path}/htmlsanitycheck/tools/WebTest.groovy[tags=GenericURIExample]
----


Expand Down
6 changes: 3 additions & 3 deletions src/docs/arc42/chapters/chap-05-BuildingBlocks.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,20 @@ overall `RunResults`, single-page results (`PageResults`) and single-check resul
[source, groovy]
.Interface RunResults
----
include::{coresourcepath}/htmlsanitycheck/collect/RunResults.java[tags=RunResultInterface]
include::{core-source-path}/htmlsanitycheck/collect/RunResults.java[tags=RunResultInterface]
----



[source, groovy]
.Interface PageResults
----
include::{coresourcepath}/htmlsanitycheck/collect/PageResults.java[tags=PageResultInterface]
include::{core-source-path}/htmlsanitycheck/collect/PageResults.java[tags=PageResultInterface]
----


[source, groovy]
.Interface CheckResults
----
include::{coresourcepath}/htmlsanitycheck/collect/CheckResults.java[tags=CheckResultsInterface]
include::{core-source-path}/htmlsanitycheck/collect/CheckResults.java[tags=CheckResultsInterface]
----
2 changes: 1 addition & 1 deletion src/docs/arc42/chapters/chap-08-checking-algorithms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The invariant steps are implemented in the abstract base class, while the varian
[source, java, linenums, highlight='16']
.Template method "performCheck"
----
include::{coresourcepath}/htmlsanitycheck/check/Checker.java[tags=performCheckTemplateMethod,indent=0]
include::{core-source-path}/htmlsanitycheck/check/Checker.java[tags=performCheckTemplateMethod,indent=0]
----

ifndef::imagesdir[:imagesdir: ../../images]
Expand Down
13 changes: 3 additions & 10 deletions src/docs/arc42/chapters/chap-08-gradle-plugin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,10 @@ You should definitely read the original https://gradle.org/docs/current/userguid
To enable the {xrefRequirementsGradleIntegration},
we implement a lean wrapper as described in the Gradle user guide.



[source, groovy]
class HtmlSanityCheckPlugin implements Plugin<Project> {
void apply(Project project) {
project.task('htmlSanityCheck',
type: HtmlSanityCheckTask,
group: 'Check')
}
}

----
include::{gradle-plugin-source-path}/htmlsanitycheck/HtmlSanityCheckPlugin.groovy[tag=gradle-plugin-implementation]
----

==== Directory Structure and Required Files

Expand Down

0 comments on commit 391854f

Please sign in to comment.