diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 3ec8cce0..00000000 --- a/.dockerignore +++ /dev/null @@ -1,58 +0,0 @@ -# Git -.git -.gitignore -.gitattributes - -# Build outputs -build/ -dist/ -.gradle/ - -# IDE and editor files -.vscode/ -.idea/ -*.swp -*.swo -*~ -.DS_Store -Thumbs.db - -# CI/CD -.github/ -.gitlab-ci.yml -.circleci/ -.travis.yml - -# Documentation -*.md -*.adoc -README* -CHANGELOG* -LICENSE* - -# OS files -.DS_Store -.AppleDouble -.LSOverride -Thumbs.db -Desktop.ini - -# Temporary files -*.tmp -*.log -.env.local -*.pem -*.key - -# Node (if added in future) -node_modules/ -package-lock.json -yarn.lock - -# Maven (if added in future) -target/ -.m2/ - -# Other -*.jar -!gradle/wrapper/*.jar diff --git a/.gitignore b/.gitignore index aec447e6..31b1f9a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,4 @@ -.gradle *.iml -/.nb-gradle/ -gradle-app.setting -.nb-gradle-properties .idea Arc42.code-workspace .DS_Store diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index beef2df6..00000000 --- a/Dockerfile +++ /dev/null @@ -1,82 +0,0 @@ -# Multi-stage Dockerfile for arc42 template build -# Build stage: Builds the documentation -FROM eclipse-temurin:11-jdk-jammy as builder - -WORKDIR /workspace - -# Install additional dependencies for PDF generation and font support -RUN apt-get update && apt-get install -y --no-install-recommends \ - fonts-noto-cjk \ - fonts-noto-cjk-extra \ - fonts-liberation \ - && rm -rf /var/lib/apt/lists/* - -# Copy the entire project -COPY . . - -# Make gradlew executable -RUN chmod +x gradlew - -# Create version.properties files for all languages if they don't exist -# This ensures the build doesn't fail on missing version files -RUN for lang in CZ DE EN ES FR IT NL PT RU UKR ZH; do \ - if [ ! -f "$lang/version.properties" ]; then \ - mkdir -p "$lang" && \ - echo "revnumber=9.0" > "$lang/version.properties" && \ - echo "revdate=$(date +'%B %Y')" >> "$lang/version.properties" && \ - echo "revremark=" >> "$lang/version.properties"; \ - fi; \ - done - -# Build all languages (HTML and PDF) -RUN ./gradlew asciidoctorAll --info - -# Runtime stage: Minimal image with just the built output -FROM eclipse-temurin:11-jre-jammy - -WORKDIR /workspace - -# Install fonts for viewing/validating PDFs -RUN apt-get update && apt-get install -y --no-install-recommends \ - fonts-noto-cjk \ - fonts-liberation \ - && rm -rf /var/lib/apt/lists/* - -# Copy built documentation from builder stage -COPY --from=builder /workspace/build ./build - -# Copy all language directories with source files and version.properties for validation -COPY --from=builder /workspace/CZ/adoc ./CZ/adoc -COPY --from=builder /workspace/CZ/version.properties ./CZ/version.properties -COPY --from=builder /workspace/DE/adoc ./DE/adoc -COPY --from=builder /workspace/DE/version.properties ./DE/version.properties -COPY --from=builder /workspace/EN/adoc ./EN/adoc -COPY --from=builder /workspace/EN/version.properties ./EN/version.properties -COPY --from=builder /workspace/ES/adoc ./ES/adoc -COPY --from=builder /workspace/ES/version.properties ./ES/version.properties -COPY --from=builder /workspace/FR/adoc ./FR/adoc -COPY --from=builder /workspace/FR/version.properties ./FR/version.properties -COPY --from=builder /workspace/IT/adoc ./IT/adoc -COPY --from=builder /workspace/IT/version.properties ./IT/version.properties -COPY --from=builder /workspace/NL/adoc ./NL/adoc -COPY --from=builder /workspace/NL/version.properties ./NL/version.properties -COPY --from=builder /workspace/PT/adoc ./PT/adoc -COPY --from=builder /workspace/PT/version.properties ./PT/version.properties -COPY --from=builder /workspace/RU/adoc ./RU/adoc -COPY --from=builder /workspace/RU/version.properties ./RU/version.properties -COPY --from=builder /workspace/UKR/adoc ./UKR/adoc -COPY --from=builder /workspace/UKR/version.properties ./UKR/version.properties -COPY --from=builder /workspace/ZH/adoc ./ZH/adoc -COPY --from=builder /workspace/ZH/version.properties ./ZH/version.properties - -# Copy gradle files for validation tasks -COPY --from=builder /workspace/gradle ./gradle -COPY --from=builder /workspace/gradlew ./ -COPY --from=builder /workspace/build.gradle ./ -COPY --from=builder /workspace/gradle.properties ./ - -# Expose a port for serving documentation (optional) -EXPOSE 8080 - -# Default command: Show build output directory contents -CMD ["bash", "-c", "echo 'Arc42 documentation built successfully!' && echo 'Output location: /workspace/build' && ls -la build/"] diff --git a/Dockerfile.build b/Dockerfile.build deleted file mode 100644 index d7e9a597..00000000 --- a/Dockerfile.build +++ /dev/null @@ -1,32 +0,0 @@ -# Dockerfile for building arc42 documentation -# Single-stage: builds and outputs to mounted volume -FROM eclipse-temurin:11-jdk-jammy - -WORKDIR /workspace - -# Install additional dependencies for PDF generation and font support -RUN apt-get update && apt-get install -y --no-install-recommends \ - fonts-noto-cjk \ - fonts-noto-cjk-extra \ - fonts-liberation \ - && rm -rf /var/lib/apt/lists/* - -# Copy the entire project -COPY . . - -# Make gradlew executable -RUN chmod +x gradlew - -# Create version.properties files for all languages if they don't exist -RUN for lang in CZ DE EN ES FR IT NL PT RU UKR ZH; do \ - if [ ! -f "$lang/version.properties" ]; then \ - mkdir -p "$lang" && \ - echo "revnumber=9.0" > "$lang/version.properties" && \ - echo "revdate=$(date +'%B %Y')" >> "$lang/version.properties" && \ - echo "revremark=" >> "$lang/version.properties"; \ - fi; \ - done - -# Build all languages (HTML and PDF) - output goes to /workspace/build which is mounted as volume -# Note: We don't use 'clean' because the build directory is a mounted volume -CMD ["bash", "-c", "./gradlew asciidoctorAll && echo 'Build complete! Documentation is in /workspace/build'"] diff --git a/README.adoc b/README.adoc index 3c7f6dd4..16dcb352 100644 --- a/README.adoc +++ b/README.adoc @@ -13,7 +13,7 @@ This repository contains the (AsciiDoc) source of the arc42 template. It is used... -* as the basis for generating (by the https://github.com/arc42/arc42-generator[arc42-generator] project) the official download formats (i.e. docx, markdown, docbook and others). To generate, THIS repo is included as submodule from the generator project. Use the gradle build contained here just for preview! +* as the basis for generating (by the https://github.com/arc42/arc42-generator[arc42-generator] project) the official download formats (i.e. docx, markdown, docbook and others). To generate, THIS repo is included as submodule from the generator project; see <> for a preview of your changes. * to maintain structure, content and help for the template * to keep non-asciidoc, non-generable formats (like Sparx(R) Enterprise-Architect(R) EAP) in `other-formats/`. @@ -120,235 +120,45 @@ The following languages are currently available: |=== -== Build a Local Version +== Build a Local Version -In case you want to build the HTML or PDF version of the template on your local, just checkout this repo and call +The template is built by the https://github.com/arc42/arc42-generator[arc42-generator], which also produces the official downloads. It needs only `make` and Docker. To preview your changes (for example a translation) in HTML or PDF: ---- -$> gradle ----- +git clone --recurse-submodules https://github.com/arc42/arc42-generator.git +cd arc42-generator +make image # once: the Docker image with all tools -on the command line. -To select another language set the Gradle build property `languages` in the file `gradle.properties` to one of the provided languages (e.g. DE, EN, ES, IT, NL etc). +# the template to build: newest master, or your branch +make template-update +git -C arc42-template fetch https://github.com//arc42-template.git +git -C arc42-template checkout FETCH_HEAD -[source, java] ----- -include::gradle.properties[] +make generate FORMAT=html # or FORMAT=pdf; without FORMAT: all 15 formats +make templates OPTS=--lint=warn # only check the template (conditionals, help blocks, images, version.properties) ---- +The output is in `build////`, e.g. `build/DE/html/with-help/arc42-template.html` or `build/ZH-TW/pdf/plain/arc42-template-ZH-TW.pdf`. See the https://github.com/arc42/arc42-generator#readme[generator README] for all targets. -### Directory Structure +Every pull request to this repository is checked by the same generator (workflow _Golden master validation_): problems appear as annotations on the file and line. -The build process assumes the following directory structure: +=== Directory Structure -``` +---- / - ├── DE/ // German language files - │ ├── arc42-template.adoc // Main document for German - │ ├── version.properties // Version information for German - │ ├── adoc/ // AsciiDoc chapter files - │ └── images/ // Language-specific images - │ - ├── EN/ // English language files - │ ├── arc42-template.adoc // Main document for English - │ ├── version.properties // Version information for English - │ ├── adoc/ // AsciiDoc chapter files - │ └── images/ // Language-specific images - │ - ├── common/ // Common files (e.g., styles) - │ └── styles/ - │ - ├── graphics-originals/ // Original diagram sources (being phased out) - │ - └── build/ // Generated output - ├── DE/ // German output - │ ├── html/ // HTML output - │ └── pdf/ // PDF output - │ - └── EN/ // English output - ├── html/ // HTML output - └── pdf/ // PDF output - ├── / // Language files for language - │ ├── arc42-template.adoc // Main document for - │ ├── version.properties // Version information for - │ ├── adoc/ // AsciiDoc chapter files - │ └── images/ // Language-specific images -``` - -## Requirements - -- Java 11 or newer -- Gradle 8.0 or newer (or use the included Gradle wrapper) - -## Configuration - -Language configuration is done in the `gradle.properties` file: - -```properties -# Configure languages to be built (comma-separated list) -languages=DE -``` - -The project name is set to 'arc42-template' in the settings.gradle file. - -You can add multiple languages by separating them with commas: - -```properties -languages=DE,EN,FR -``` - - -### Clean the build directory - -```bash -./gradlew clean -``` - -### Build all formats for all configured languages - -```bash -./gradlew -``` - -or - -```bash -./gradlew asciidoctorAll -``` - -### Build only HTML for all configured languages - -```bash -./gradlew asciidoctorHtmlAll -``` - -### Build only PDF for all configured languages - -```bash -./gradlew asciidoctorPdfAll -``` - -### Build specific language in HTML format - -```bash -./gradlew asciidoctorHtmlDE -``` - -Replace `DE` with the desired language code. - -### Build specific language in PDF format - -```bash -./gradlew asciidoctorPdfDE -``` - -Replace `DE` with the desired language code. - -### Validate Image References - -The build system automatically validates that all images referenced in AsciiDoc files exist before generating documentation. You can also run validation independently: - -```bash -# Validate all configured languages (shortest form) -./gradlew validate - -# Alternative commands (same result) -./gradlew validateImages -./gradlew validateImagesAll - -# Validate specific language -./gradlew validateImagesDE -./gradlew validateImagesEN -``` - -If images are missing, you'll see warnings like: - -``` -⚠ Image Reference Validation: DE -WARNING: Missing image references found: - - File: DE/adoc/01_introduction_and_goals.adoc:60 - Missing: diagram.png - Expected: /path/to/DE/images/diagram.png - -Summary: 1 missing image(s) in DE -``` - -The build continues with warnings (permissive mode), but the generated documentation will show broken image placeholders. Image validation runs automatically before every HTML and PDF build. - -## Output - -Generated documentation will be available in the build directory: - -- HTML: `build//html/arc42-template-.html` -- PDF: `build//pdf/arc42-template-.pdf` - -For example, German (DE) documentation would be in: -- `build/DE/html/arc42-template-DE.html` -- `build/DE/pdf/arc42-template-DE.pdf` - -## Adding a New Language - -1. Add the language code to the `languages` property in `gradle.properties` -2. Create the necessary AsciiDoc source files for the new language -3. Run the build - -## Building with Docker (Optional) - -If you prefer not to install Java locally, you can use Docker to build the documentation. This approach is optional and fully compatible with the traditional local build. - -### Requirements - -- Docker (version 20.10 or newer) -- Docker Compose (version 1.29 or newer) - -### Building with Docker Compose - -```bash -# Build all languages using Docker -docker-compose up build - -# Build and verify images are referenced correctly -docker-compose up validate - -# Build and run a web server (http://localhost:8080) to view HTML documentation -docker-compose up server -``` - -### Building with Docker directly - -```bash -# Build the Docker image -docker build -t arc42-template . - -# Run a container to generate documentation -docker run -v $(pwd)/build:/workspace/build arc42-template - -# Run validation -docker run arc42-template ./gradlew validate - -# Build specific languages only (override languages in environment) -docker run -e LANGUAGES=DE,EN -v $(pwd)/build:/workspace/build arc42-template -``` - -### Docker Advantages - -- No Java installation required -- Guaranteed build reproducibility (same Java version for all) -- Pre-installed fonts for proper PDF rendering of multi-language documents (especially CJK: Chinese, Japanese, Korean) -- Consistent builds across Windows, macOS, and Linux - -### Docker Output - -Generated documentation will be available in the `build/` directory on your host system (same location as traditional builds): -- HTML: `build//html/arc42-template-.html` -- PDF: `build//pdf/arc42-template-.pdf` + ├── / // one folder per language, e.g. EN, DE, ZH-TW + │ ├── arc42-template.adoc // main document + │ ├── version.properties // revnumber, revdate, revdate-iso (YYYY-MM), revremark + │ ├── adoc/ // chapter files + │ └── images/ // images of this language + ├── common/ // shared files (styles) + ├── other-formats// // hand-made templates: Confluence, Doxygen, Enterprise Architect, Rhapsody + └── graphics-originals/ // original diagram sources (being phased out) +---- -### Notes +=== Adding a New Language -- The Docker image is built multi-stage for efficiency (one stage for building, one for runtime) -- Build artifacts are mounted as volumes, so the output is accessible directly on your host -- The optional Nginx server displays HTML documentation only (PDFs must be downloaded) +Create a folder `/` like the ones above (a code such as `TR`, optionally with a region such as `ZH-TW`), with all four `version.properties` entries, and add it to the table under <>. The generator finds it on its own; nothing else needs to change. == Questions on using arc42? diff --git a/ZH-TW/pdf-theme/fonts/NotoSansSC-Bold.ttf b/ZH-TW/pdf-theme/fonts/NotoSansSC-Bold.ttf deleted file mode 100644 index 1edc5461..00000000 Binary files a/ZH-TW/pdf-theme/fonts/NotoSansSC-Bold.ttf and /dev/null differ diff --git a/ZH-TW/pdf-theme/fonts/NotoSansSC-Medium.ttf b/ZH-TW/pdf-theme/fonts/NotoSansSC-Medium.ttf deleted file mode 100644 index 3131ae95..00000000 Binary files a/ZH-TW/pdf-theme/fonts/NotoSansSC-Medium.ttf and /dev/null differ diff --git a/ZH-TW/pdf-theme/fonts/NotoSansSC-Regular.ttf b/ZH-TW/pdf-theme/fonts/NotoSansSC-Regular.ttf deleted file mode 100644 index 176f1134..00000000 Binary files a/ZH-TW/pdf-theme/fonts/NotoSansSC-Regular.ttf and /dev/null differ diff --git a/ZH-TW/pdf-theme/fonts/NotoSansSC-SemiBold.ttf b/ZH-TW/pdf-theme/fonts/NotoSansSC-SemiBold.ttf deleted file mode 100644 index 5e3a7d4f..00000000 Binary files a/ZH-TW/pdf-theme/fonts/NotoSansSC-SemiBold.ttf and /dev/null differ diff --git a/ZH-TW/pdf-theme/zh-tw-theme.yml b/ZH-TW/pdf-theme/zh-tw-theme.yml deleted file mode 100644 index 2c692261..00000000 --- a/ZH-TW/pdf-theme/zh-tw-theme.yml +++ /dev/null @@ -1,13 +0,0 @@ -extends: default -font: - catalog: - merge: true - Noto Sans SC: - normal: NotoSansSC-Regular.ttf - bold: NotoSansSC-Bold.ttf - italic: NotoSansSC-SemiBold.ttf - bold_italic: NotoSansSC-SemiBold.ttf - fallbacks: - - Helvetica - - Noto Sans SC -base_font_family: Noto Sans SC \ No newline at end of file diff --git a/ZH/pdf-theme/fonts/NotoSansSC-Bold.ttf b/ZH/pdf-theme/fonts/NotoSansSC-Bold.ttf deleted file mode 100644 index 1edc5461..00000000 Binary files a/ZH/pdf-theme/fonts/NotoSansSC-Bold.ttf and /dev/null differ diff --git a/ZH/pdf-theme/fonts/NotoSansSC-Medium.ttf b/ZH/pdf-theme/fonts/NotoSansSC-Medium.ttf deleted file mode 100644 index 3131ae95..00000000 Binary files a/ZH/pdf-theme/fonts/NotoSansSC-Medium.ttf and /dev/null differ diff --git a/ZH/pdf-theme/fonts/NotoSansSC-Regular.ttf b/ZH/pdf-theme/fonts/NotoSansSC-Regular.ttf deleted file mode 100644 index 176f1134..00000000 Binary files a/ZH/pdf-theme/fonts/NotoSansSC-Regular.ttf and /dev/null differ diff --git a/ZH/pdf-theme/fonts/NotoSansSC-SemiBold.ttf b/ZH/pdf-theme/fonts/NotoSansSC-SemiBold.ttf deleted file mode 100644 index 5e3a7d4f..00000000 Binary files a/ZH/pdf-theme/fonts/NotoSansSC-SemiBold.ttf and /dev/null differ diff --git a/ZH/pdf-theme/zh-theme.yml b/ZH/pdf-theme/zh-theme.yml deleted file mode 100644 index 2c692261..00000000 --- a/ZH/pdf-theme/zh-theme.yml +++ /dev/null @@ -1,13 +0,0 @@ -extends: default -font: - catalog: - merge: true - Noto Sans SC: - normal: NotoSansSC-Regular.ttf - bold: NotoSansSC-Bold.ttf - italic: NotoSansSC-SemiBold.ttf - bold_italic: NotoSansSC-SemiBold.ttf - fallbacks: - - Helvetica - - Noto Sans SC -base_font_family: Noto Sans SC \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 7ccdb3d5..00000000 --- a/build.gradle +++ /dev/null @@ -1,369 +0,0 @@ -plugins { - id 'org.asciidoctor.jvm.convert' version '4.0.5' - id 'org.asciidoctor.jvm.pdf' version '4.0.5' -} - -// Read language settings from gradle.properties -def languages = project.findProperty('languages')?.split(',')?.collect { it.trim() } ?: ['DE'] - -repositories { - mavenCentral() - gradlePluginPortal() -} - -asciidoctorj { - modules { - pdf.version = '2.3.19' - } -} - -tasks.withType(org.asciidoctor.gradle.jvm.AsciidoctorTask) { - // Set encoding through the asciidoctorj configuration instead - asciidoctorj { - options = [ - doctype: 'book' - ] - attributes = [ - 'encoding': 'UTF-8' - ] - } - - configure { - forkOptions { - jvmArgs( - '--add-opens=java.base/sun.nio.ch=ALL-UNNAMED', - '--add-opens=java.base/java.io=ALL-UNNAMED' - ) - } - } -} - -// Function to load version properties -def loadVersionProperties(language) { - def props = new Properties() - def propFile = file("${language}/version.properties") - if (!propFile.exists()) { - throw new GradleException("Version properties file not found for language ${language}: ${propFile}") - } - propFile.withInputStream { - props.load(new InputStreamReader(it, "UTF-8")) // Use UTF-8 when reading properties - } - return [ - 'revnumber': props.revnumber ?: 'UNKNOWN', - 'revdate': props.revdate ?: 'UNKNOWN', - 'revremark': props.revremark ?: '' - ] -} - -// Collect version info for all languages upfront -def allVersionInfo = languages.collectEntries { lang -> - [lang, loadVersionProperties(lang)] -} - -// Function to validate image references in AsciiDoc files -def validateImageReferences(String language, File sourceDir, File imagesDir) { - def results = [ - language: language, - missingImages: [], - totalChecked: 0 - ] - - // Find all .adoc files recursively - def adocFiles = fileTree(sourceDir) { - include '**/*.adoc' - } - - // Define regex patterns for image references - // Block images: image::filename[alt] - // Inline images: image:filename[alt] (but not image:: with double colon) - def blockPattern = ~/image::([^\[]+)\[/ - def inlinePattern = ~/(? - def lineNumber = 0 - file.eachLine('UTF-8') { line -> - lineNumber++ - - // Check for block images (image::) - def blockMatcher = line =~ blockPattern - blockMatcher.each { match -> - def imageName = match[1].trim() - checkImageExists(imageName, file, lineNumber, imagesDir, results) - } - - // Check for inline images (image:) - def inlineMatcher = line =~ inlinePattern - inlineMatcher.each { match -> - def imageName = match[1].trim() - checkImageExists(imageName, file, lineNumber, imagesDir, results) - } - } - } - - return results -} - -// Helper function to check if an image file exists -def checkImageExists(String imageName, File sourceFile, int lineNumber, File imagesDir, Map results) { - results.totalChecked++ - def imageFile = new File(imagesDir, imageName) - - if (!imageFile.exists()) { - results.missingImages << [ - file: sourceFile.path, - line: lineNumber, - imageName: imageName, - expectedPath: imageFile.absolutePath - ] - } -} - -// Configure common AsciiDoc attributes -ext { - asciidocAttributes = [ - 'source-highlighter': 'coderay', - 'toc': 'left', - 'toclevels': '3', - 'doctype': 'book', - 'encoding': 'UTF-8', - 'lang': 'en' // This will be overridden for each language - ] -} - -// Print version information at configuration phase -println "\nBuilding arc42 documentation with the following versions:" -allVersionInfo.each { lang, version -> - println " ${lang}: Version ${version.revnumber} (${version.revdate}) ${version.revremark}" -} -println "" - -// Create HTML and PDF tasks for each configured language -languages.each { language -> - def versionInfo = allVersionInfo[language] - - def sourceDirFile - def imagesDirAttr - def pdfThemeBaseDir - - if (language in ['DE', 'EN', 'CZ', 'ES', 'FR', 'HU', 'IT', 'NL', 'PT', 'RU', 'UKR', 'ZH']) { - sourceDirFile = file(language) - imagesDirAttr = file("${language}/images").absolutePath - pdfThemeBaseDir = file(language) - } else { - sourceDirFile = file("${language}/asciidoc") - imagesDirAttr = "${projectDir}/images" - pdfThemeBaseDir = file("${language}/asciidoc") - } - - // Register image validation task for this language - tasks.register("validateImages${language}") { - group = 'Verification' - description = "Validates that all image references in ${language} AsciiDoc files exist" - - doLast { - def results = validateImageReferences(language, sourceDirFile, file("${language}/images")) - - if (results.missingImages.isEmpty()) { - logger.lifecycle("✓ Image validation for ${language}: All ${results.totalChecked} image references are valid") - } else { - logger.warn("") - logger.warn("=" * 70) - logger.warn("⚠ Image Reference Validation: ${language}") - logger.warn("=" * 70) - logger.warn("") - logger.warn("WARNING: Missing image references found:") - logger.warn("") - - results.missingImages.each { missing -> - logger.warn(" File: ${missing.file}:${missing.line}") - logger.warn(" Missing: ${missing.imageName}") - logger.warn(" Expected: ${missing.expectedPath}") - logger.warn("") - } - - logger.warn("Summary: ${results.missingImages.size()} missing image(s) in ${language}") - logger.warn("Build will continue, but output may have broken image placeholders.") - logger.warn("=" * 70) - logger.warn("") - } - } - } - - // Define HTML conversion task for this language - tasks.register("asciidoctorHtml${language}", org.asciidoctor.gradle.jvm.AsciidoctorTask) { - dependsOn tasks.named("validateImages${language}") - sourceDir = sourceDirFile - sources { - include 'arc42-template.adoc' - } - outputDir = file("build/${language}/html") - baseDirFollowsSourceDir() - - attributes asciidocAttributes + [ - 'imagesdir': imagesDirAttr, - 'revnumber': versionInfo.revnumber, - 'revdate': versionInfo.revdate, - 'revremark': versionInfo.revremark, - 'lang': language.toLowerCase() // Set the language code - ] - - doLast { - def newName = "arc42-template-${language}.html" - file("${outputDir}/arc42-template.html").renameTo(file("${outputDir}/${newName}")) - println "HTML conversion completed for ${language} (v${versionInfo.revnumber})" - println " Output: ${outputDir}/${newName}" - } - } - - // Define PDF conversion task for this language - tasks.register("asciidoctorPdf${language}", org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfTask) { - dependsOn tasks.named("validateImages${language}") - sourceDir = sourceDirFile - sources { - include 'arc42-template.adoc' - } - outputDir = file("build/${language}/pdf") - baseDirFollowsSourceDir() - - attributes asciidocAttributes + [ - 'imagesdir': imagesDirAttr, - 'pdf-page-size': 'A4', - 'revnumber': versionInfo.revnumber, - 'revdate': versionInfo.revdate, - 'revremark': versionInfo.revremark, - 'lang': language.toLowerCase() // Set the language code - ] - - //load PDF theme YAML file (font files) to render non-Latin languages (like Chinese,Japanese,Korean) correctly in pdf - def pdfThemeYmlFile = file("${pdfThemeBaseDir}/pdf-theme/${language.toLowerCase()}-theme.yml") - if( pdfThemeYmlFile.exists()){ - println "load pdf theme from ${pdfThemeYmlFile.absolutePath}" - - attributes asciidocAttributes + [ - 'pdf-theme': pdfThemeYmlFile.absolutePath, - 'pdf-fontsdir': file("${pdfThemeBaseDir}/pdf-theme/fonts").absolutePath, - // Activates line break rules for CJK languages (specifically Chinese and Japanese). - 'script': 'cjk', - 'text-align': 'left' - ] - println "asciidocAttributes for ${language}: ${asciidocAttributes}" - } - - doLast { - def newName = "arc42-template-${language}.pdf" - file("${outputDir}/arc42-template.pdf").renameTo(file("${outputDir}/${newName}")) - println "PDF conversion completed for ${language} (v${versionInfo.revnumber})" - println " Output: ${outputDir}/${newName}" - } - } -} - -// Create aggregate tasks for all languages -tasks.register('asciidoctorHtmlAll') { - description = 'Builds HTML for all configured languages' - group = 'Documentation' - - doFirst { - println "\nStarting HTML generation for all languages" - } - - languages.each { language -> - dependsOn tasks.named("asciidoctorHtml${language}") - } - - doLast { - println "\nHTML generation completed for all languages" - } -} - -tasks.register('asciidoctorPdfAll') { - description = 'Builds PDF for all configured languages' - group = 'Documentation' - - doFirst { - println "\nStarting PDF generation for all languages" - } - - languages.each { language -> - dependsOn tasks.named("asciidoctorPdf${language}") - } - - doLast { - println "\nPDF generation completed for all languages" - } -} - -tasks.register('validateImagesAll') { - description = 'Validates image references for all configured languages' - group = 'Verification' - - languages.each { language -> - dependsOn tasks.named("validateImages${language}") - } - - doLast { - println "\nImage validation completed for all languages" - } -} - -// Synonym for validateImagesAll -tasks.register('validateImages') { - description = 'Validates image references for all configured languages (synonym for validateImagesAll)' - group = 'Verification' - - dependsOn tasks.named('validateImagesAll') -} - -// Short validation task -tasks.register('validate') { - description = 'Validates image references for all configured languages (short form)' - group = 'Verification' - - dependsOn tasks.named('validateImagesAll') -} - -tasks.register('asciidoctorAll') { - description = 'Builds HTML and PDF for all configured languages' - group = 'Documentation' - - dependsOn tasks.named('asciidoctorHtmlAll') - dependsOn tasks.named('asciidoctorPdfAll') - - doLast { - println "\nDocumentation build summary:" - allVersionInfo.each { lang, version -> - println " ${lang}: Version ${version.revnumber} built to build/${lang}/{html,pdf}" - } - } -} - -tasks.named('clean') { - description = 'Deletes the build directory' - group = 'Build' - - doLast { - delete 'build' - println "Build directory cleaned" - } -} - -defaultTasks 'asciidoctorAll' - -gradle.taskGraph.whenReady { taskGraph -> - if (taskGraph.hasTask(':asciidoctorAll') || - taskGraph.hasTask(':asciidoctorHtmlAll') || - taskGraph.hasTask(':asciidoctorPdfAll')) { - println "\nBuilding arc42 documentation with the following configuration:" - println " Languages: ${languages.join(', ')}" - def sourceDirs = languages.collect { lang -> - if (lang in ['DE', 'EN', 'CZ', 'ES', 'FR', 'HU', 'IT', 'NL', 'PT', 'RU', 'UKR', 'ZH']) { - return lang - } else { - return "${lang}/asciidoc" - } - } - println " Source directories: ${sourceDirs.join(', ')}" - println " Main file: arc42-template.adoc" - } -} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 8f3348a1..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,44 +0,0 @@ -services: - # Build service for documentation - build: - build: - context: . - dockerfile: Dockerfile.build - container_name: arc42-builder - volumes: - # Mount output directory to host for easy access - - ./build:/workspace/build - # Optional: Override language selection - # Uncomment and modify the environment section to build specific languages only - # environment: - # LANGUAGES: "DE,EN" - - # Optional: Simple HTTP server to view documentation - server: - image: nginx:alpine - container_name: arc42-server - ports: - - "8080:80" - volumes: - # Serve generated HTML documentation - - ./build:/usr/share/nginx/html:ro - # Optional: nginx config for better routing - # - ./nginx.conf:/etc/nginx/nginx.conf:ro - depends_on: - - build - # Only start server if build succeeds - - # Validation service (optional) - validate: - build: - context: . - dockerfile: Dockerfile - container_name: arc42-validator - command: bash -c "./gradlew validate" - volumes: - - ./build:/workspace/build - -# Optional: Named volume for build artifacts -volumes: - build-output: - driver: local diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index bc68c37d..00000000 --- a/gradle.properties +++ /dev/null @@ -1,13 +0,0 @@ -# Configure languages to be built -# Comma-separated list of language codes -languages=CZ,DE,EN,ES,FR,HU,IT,NL,PT,RU,UKR,ZH - - - -# JVM arguments for Gradle -#org.gradle.jvmargs=--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED -Dorg.asciidoctor.jvm.native=true -org.gradle.jvmargs=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED -Dorg.asciidoctor.jvm.native=true - -# Other Gradle settings -org.gradle.parallel=true -org.gradle.caching=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 1b33c55b..00000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index ca025c83..00000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew deleted file mode 100755 index 23d15a93..00000000 --- a/gradlew +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH="\\\"\\\"" - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 5eed7ee8..00000000 --- a/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH= - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index dd924763..00000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'arc42-template' \ No newline at end of file