Skip to content

Commit cf49c4a

Browse files
vlsiclaudecodex
committed
chore: replace Anakia printable docs with CSS @media print
The printable documentation was generated by a separate Anakia/Velocity pipeline, but its only differences from the regular site (no sidebar, no social widgets, no ¶ anchors, full-width content) are trivially achieved with @media print CSS rules that already existed in new-style.css. Remove the Anakia infrastructure and its dependencies so the project has a single XSLT-based doc pipeline instead of two. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-Authored-By: GPT 5.4 <codex@openai.com>
1 parent f857b8e commit cf49c4a

16 files changed

Lines changed: 47 additions & 1827 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/dist/
2121
/docs/
2222
/local/
23+
# We no longer use printable_docs folder, however, keep it here so everybody else do not acidentally commit it
2324
/printable_docs/
2425
/reports/
2526
/site/

.ratignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ lib/aareadme.txt
2626
lib/opt/README.txt
2727
src/licenses/licenses/*/CC0-1.0.txt
2828
#local/**
29-
#printable_docs/**
3029
#reports/**
3130
src/launcher/src/main/resources/org/apache/jmeter/jmeter_as_ascii_art.txt
3231
src/core/src/main/resources/org/apache/jmeter/help.txt

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ a JMX file onto:
136136
## Documentation
137137

138138
The documentation available as of the date of this release is
139-
also included, in HTML format, in the [printable_docs](printable_docs) directory,
140-
and it may be browsed starting from the file called [index.html](printable_docs/index.html).
139+
also included, in HTML format, in the [docs](docs) directory,
140+
and it may be browsed starting from the file called [index.html](docs/index.html).
141141

142142
## Reporting a bug/enhancement
143143

bin/jmeter.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# JMeter properties are described in the file
3434
# http://jmeter.apache.org/usermanual/properties_reference.html
3535
# A local copy can be found in
36-
# printable_docs/usermanual/properties_reference.html
36+
# docs/usermanual/properties_reference.html
3737

3838
#Preferred GUI language. Comment out to use the JVM default locale's language.
3939
#language=en

renovate.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,6 @@
128128
"org.eclipse.jetty{/,}**"
129129
]
130130
},
131-
{
132-
"groupName": "org.jdom",
133-
"description": "Velocity Anakia uses JDOM 1.0",
134-
"allowedVersions": "< 2.0",
135-
"matchPackageNames": [
136-
"org.jdom{/,}**"
137-
]
138-
},
139131
{
140132
"groupName": "org.jetbrains.lets-plot",
141133
"matchPackageNames": [

src/core/src/main/java/org/apache/jmeter/gui/action/Help.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class Help extends AbstractAction {
4949

5050
private static final String HELP_DOCS = "file:///" // $NON-NLS-1$
5151
+ JMeterUtils.getJMeterHome()
52-
+ "/printable_docs/usermanual/"; // $NON-NLS-1$
52+
+ "/docs/usermanual/"; // $NON-NLS-1$
5353

5454
private static final String HELP_COMPONENTS = HELP_DOCS + "component_reference.html"; // $NON-NLS-1$
5555

src/dist/build.gradle.kts

Lines changed: 34 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ inline fun <reified T : Named> AttributeContainer.attribute(attr: Attribute<T>,
5959
attribute(attr, objects.named<T>(value))
6060

6161
// isCanBeConsumed = false ==> other modules must not use the configuration as a dependency
62-
val buildDocs by configurations.creating {
63-
isCanBeConsumed = false
64-
}
6562
val generatorJar by configurations.creating {
6663
isCanBeConsumed = false
6764
}
@@ -109,12 +106,6 @@ dependencies {
109106
srcLicense(project(":src:licenses", "srcLicense"))
110107
generatorJar(project(":src:generator", "archives"))
111108
junitSampleJar(project(":src:protocol:junit-sample"))
112-
113-
buildDocs(platform(projects.src.bomThirdparty))
114-
buildDocs("org.apache.velocity:velocity")
115-
buildDocs("commons-lang:commons-lang")
116-
buildDocs("org.apache.commons:commons-collections4")
117-
buildDocs("org.jdom:jdom")
118109
}
119110

120111
node {
@@ -338,89 +329,6 @@ val createDist by tasks.registering {
338329
// source/binary artifacts with the appropriate eol/executable file flags
339330
val gitProps by rootProject.tasks.existing(FindGitAttributes::class)
340331

341-
fun createAnakiaTask(
342-
taskName: String,
343-
baseDir: Directory,
344-
extension: String = ".html",
345-
style: String,
346-
velocityProperties: String,
347-
projectFile: String,
348-
excludes: Array<String>,
349-
includes: Array<String>
350-
): TaskProvider<Task> {
351-
val outputDir = layout.buildDirectory.dir("docs/$taskName").get().asFile
352-
353-
val prepareProps = tasks.register("prepareProperties$taskName") {
354-
// AnakiaTask can't use relative paths, and it forbids ../, so we create a dedicated
355-
// velocity.properties file that contains absolute path
356-
inputs.file(velocityProperties)
357-
val outputProps = layout.buildDirectory.file("docProps/$taskName/velocity.properties").get().asFile
358-
outputs.file(outputProps)
359-
doLast {
360-
// Unfortunately, Velocity does not use Java properties format.
361-
// For instance, Properties escape : as \:, however Velocity does not understand that.
362-
// Thus it tries to use c\:\path\to\workspace which does not work
363-
val p = `java.util`.Properties()
364-
file(velocityProperties).reader().use {
365-
p.load(it)
366-
}
367-
p["resource.loader"] = "file"
368-
p["file.resource.loader.path"] = baseDir.asFile.absolutePath
369-
p["file.resource.loader.class"] = "org.apache.velocity.runtime.resource.loader.FileResourceLoader"
370-
val specials = Regex("""([,\\])""")
371-
val lines = p.entries
372-
.map { (it.key as String) + "=" + ((it.value as String).replace(specials, """\\$1""")) }
373-
.sorted()
374-
file(outputProps).apply {
375-
parentFile.run { isDirectory || mkdirs() } || throw IllegalStateException("Unable to create directory $parentFile")
376-
377-
writer().use {
378-
it.appendLine("# Auto-generated from $velocityProperties to pass absolute path to Velocity")
379-
for (line in lines) {
380-
it.appendLine(line)
381-
}
382-
}
383-
}
384-
}
385-
}
386-
387-
return tasks.register(taskName) {
388-
inputs.file("$baseDir/$style").withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("styleDir")
389-
inputs.file("$baseDir/$projectFile").withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("projectDir")
390-
inputs.files(
391-
fileTree(baseDir) {
392-
include(*includes)
393-
exclude(*excludes)
394-
}
395-
).withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("baseDir")
396-
inputs.property("extension", extension)
397-
outputs.dir(outputDir)
398-
outputs.cacheIf { true }
399-
dependsOn(prepareProps)
400-
401-
doLast {
402-
ant.withGroovyBuilder {
403-
"taskdef"(
404-
"name" to "anakia",
405-
"classname" to "org.apache.velocity.anakia.AnakiaTask",
406-
"classpath" to buildDocs.asPath
407-
)
408-
"anakia"(
409-
"basedir" to baseDir,
410-
"destdir" to outputDir,
411-
"extension" to extension,
412-
"style" to style,
413-
"projectFile" to projectFile,
414-
"excludes" to excludes.joinToString(" "),
415-
"includes" to includes.joinToString(" "),
416-
"lastModifiedCheck" to "true",
417-
"velocityPropertiesFile" to prepareProps.get().outputs.files.singleFile
418-
)
419-
}
420-
}
421-
}
422-
}
423-
424332
val xdocs = rootProject.layout.projectDirectory.dir("xdocs")
425333

426334
fun CopySpec.docCssAndImages() {
@@ -439,13 +347,34 @@ fun CopySpec.manuals() {
439347
}
440348
}
441349

442-
fun CopySpec.printableDocumentation() {
443-
into("docs") {
444-
docCssAndImages()
350+
fun CopySpec.docFontsAndCss() {
351+
into("fonts") {
352+
from(
353+
fileTree(xdocs.dir("node_modules/@fontsource/merriweather/files")) {
354+
builtBy(yarn_install)
355+
}
356+
) {
357+
include("*400*normal*.woff2")
358+
}
359+
from(xdocs.dir("node_modules/@fortawesome/fontawesome-free/webfonts")) {
360+
include("fa-brands*.woff2")
361+
}
445362
}
446-
into("printable_docs") {
447-
from(buildPrintableDoc)
448-
manuals()
363+
into("css") {
364+
from(xdocs.dir("node_modules/@fontsource/merriweather")) {
365+
include("400.css")
366+
rename { "merriweather.css" }
367+
filter {
368+
it.replace("./files", "../fonts")
369+
}
370+
}
371+
from(xdocs.dir("node_modules/@fortawesome/fontawesome-free/css")) {
372+
include("fontawesome.min.css")
373+
include("brands.min.css")
374+
filter {
375+
it.replace("../webfonts", "../fonts")
376+
}
377+
}
449378
}
450379
}
451380

@@ -465,25 +394,6 @@ val yarn_install = tasks.named<YarnTask>("yarn_install") {
465394
outputs.dir(xdocs.dir("node_modules")).withPropertyName("node_modules")
466395
}
467396

468-
val buildPrintableDoc = createAnakiaTask(
469-
"buildPrintableDoc", baseDir = xdocs,
470-
style = "stylesheets/site_printable.vsl",
471-
velocityProperties = "$xdocs/velocity.properties",
472-
projectFile = "stylesheets/printable_project.xml",
473-
excludes = arrayOf("**/stylesheets/**", "extending.xml", "extending/*.xml", "node_modules", "package.json", "package-lock.json", "yarn.lock"),
474-
includes = arrayOf("**/*.xml")
475-
)
476-
477-
val previewPrintableDocs by tasks.registering(Copy::class) {
478-
group = JavaBasePlugin.DOCUMENTATION_GROUP
479-
description = "Creates preview of a printable documentation to build/docs/printable_preview"
480-
into(layout.buildDirectory.dir("docs/printable_preview"))
481-
CrLfSpec().run {
482-
gitattributes(gitProps)
483-
printableDocumentation()
484-
}
485-
}
486-
487397
val lastEditYear: String by rootProject.extra
488398

489399
fun xslt(
@@ -542,34 +452,7 @@ fun CopySpec.siteLayout() {
542452
from(processSiteXslt)
543453
docCssAndImages()
544454
manuals()
545-
into("fonts") {
546-
from(
547-
fileTree(xdocs.dir("node_modules/@fontsource/merriweather/files")) {
548-
builtBy(yarn_install)
549-
}
550-
) {
551-
include("*400*normal*.woff2")
552-
}
553-
from(xdocs.dir("node_modules/@fortawesome/fontawesome-free/webfonts")) {
554-
include("fa-brands*.woff2")
555-
}
556-
}
557-
into("css") {
558-
from(xdocs.dir("node_modules/@fontsource/merriweather")) {
559-
include("400.css")
560-
rename { "merriweather.css" }
561-
filter {
562-
it.replace("./files", "../fonts")
563-
}
564-
}
565-
from(xdocs.dir("node_modules/@fortawesome/fontawesome-free/css")) {
566-
include("fontawesome.min.css")
567-
include("brands.min.css")
568-
filter {
569-
it.replace("../webfonts", "../fonts")
570-
}
571-
}
572-
}
455+
docFontsAndCss()
573456
}
574457

575458
// See https://github.com/gradle/gradle/issues/10960
@@ -628,7 +511,12 @@ fun CrLfSpec.binaryLayout() = copySpec {
628511
with(libsExt)
629512
}
630513
}
631-
printableDocumentation()
514+
into("docs") {
515+
from(processSiteXslt)
516+
docCssAndImages()
517+
manuals()
518+
docFontsAndCss()
519+
}
632520
into("docs/api") {
633521
javadocs()
634522
}

xdocs/css/new-style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ table {
619619
}
620620

621621
@media print {
622-
.nav, .header, .footer, .pagelinks, .go-top, .social-media, .share-links {
622+
.nav, .header, .footer, .pagelinks, .go-top, .social-media, .share-links, .sectionlink {
623623
display: none;
624624
}
625625

xdocs/css/style.css

Lines changed: 0 additions & 50 deletions
This file was deleted.

xdocs/stylesheets/printable_project.xml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)