Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
Expand All @@ -23,6 +17,10 @@
hs_err_pid*

.gradle/
.idea/
build/
gradle.properties
*.orig
/.idea/compiler.xml
/.idea/misc.xml
/.idea/vcs.xml
/.idea/workspace.xml
15 changes: 15 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

The MIT License (MIT)

Copyright (c) 2023 alkoleft
Expand Down
96 changes: 95 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,95 @@
# bsldoc
# BSL-Doc

BSL-Doc — это инструмент для автоматической генерации документации на основе исходных кодов конфигурации 1С:Предприятие.
Он поддерживает работу с исходниками как в формате **конфигуратора**, так и в формате **EDT**.
Для анализа исходных кодов используются компоненты [bsl-language-server](https://github.com/1c-syntax/bsl-language-server), включая [bsl-parser](https://github.com/1c-syntax/bsl-parser) для работы с модулями и [mdclasses](https://github.com/1c-syntax/mdclasses) для чтения дерева метаданных.

## Возможности

- Генерация документации в форматах Markdown, ConfluenceMarkdown и Docusaurus.
- Поддержка фильтрации по подсистемам и регионам.
- Возможность объединения с ручной документацией.
- Гибкая настройка иерархии и структуры выходной документации.

## Требования

* java version 17

## Установка

* Скачайте jar файл со страницы [релизов](https://github.com/1CDevFlow/BSL-Doc/releases)

## Запуск

### Параметры запуска

```bash
bsldoc --format=<Docusaurus, Markdown> --only-subsystems=<root subsystems list> --regions=<regions filter> source destination
```

| Параметр | Описание | Доступные значения | Значение по умолчанию | Файл | Cli |
|-----------------|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|------------------------------|---------------|-------------------|
| format | Формат генерируемой документации | Markdown, ConfluenceMarkdown, Docusaurus | Markdown | format | --format |
| hierarchy | Формат иерархии генерируемой документации — плоский список или иерархия по подсистемам | FLAT, SUBSYSTEM | FLAT | hierarchy | --hierarchy |
| subsystems | Подсистемы верхнего уровня, по которым строится документация. Если не указано, то по всем. | | | subsystems | --only-subsystems |
| regions | Список областей модулей, по которым строится документация. Если не указано, то по всем экспортным методам | | ПрограммныйИнтерфейс, Public | regions | --regions |
| manualDocs | Путь к каталогу с ручной документацией | | | manualDocs | --manual-docs |
| mergeStrategy | Способ объединения ручной и сгенерированной документации | APPEND, REPLACE, MERGE | APPEND | mergeStrategy | --merge-strategy |
| childLayout | Расположение файла описания групп | SUB_DIRECTORY, SAME_DIRECTORY | SAME_DIRECTORY | childLayout | --child-layout |
| header | Шаблон, добавляется в начало каждого сгенерированного файла `{path: '', content: ''}`. Либо сам шаблон, либо путь к файлу шаблона. | | | header | |
| footer | Шаблон, добавляется в конец каждого сгенерированного файла `{path: '', content: ''}`. Либо сам шаблон, либо путь к файлу шаблона. | | | footer | |

### Пример запуска

```bash
bsldoc --format=Markdown --only-subsystems="ОбщегоНазначения, Администрирование" --regions="ПрограммныйИнтерфейс" source_directory output_directory
```

## Настройка `childLayout`

Определяет расположение описаний групп (подсистем).

### Пример структуры файлов

Предположим, конфигурация имеет общий модуль `СтроковыеФункции`, который относится к подсистеме `ОбщегоНазначения`.

#### Для настройки `SAME_DIRECTORY`

```tree
└── ОбщегоНазначения // Каталог с описанием элементов подсистемы
├── index.md // Описание подсистемы
└── СтроковыеФункции.md // Описание общего модуля
```

#### Для настройки `SUB_DIRECTORY`

```tree
├── ОбщегоНазначения.md // Описание подсистемы
└── ОбщегоНазначения // Каталог с описанием элементов подсистемы
└── СтроковыеФункции.md // Описание общего модуля
```

## Ручная документация

BSL-Doc поддерживает работу с ручной документацией, что позволяет:

- Совмещать ручные и сгенерированные статьи.
- Окружать сгенерированную документацию ручной в одной статье.
- Заменять сгенерированные страницы ручным вариантом.

### Процесс публикации документации

1. В каталог назначения копируется ручная документация.
2. На основании исходников генерируется документация в тот же каталог назначения.
3. При генерации проверяется существование "ручной" статьи. Если она найдена, то в зависимости от настройки `mergeStrategy`:
- `APPEND` — соответствующее описание не генерируется, существующая страница остается неизменной.
- `REPLACE` — страница заменяется сгенерированной.
- `MERGE` — описания объединяются. Страница с ручной документацией может содержать маркер `generated_content`, который заменяется сгенерированным описанием. При отсутствии маркера страница остается неизменной.

## Лицензия

BSL-Doc распространяется под лицензией MIT. Подробности смотрите в файле [LICENSE](LICENSE).

## Поддержка и обратная связь

Если у вас есть вопросы, предложения или вы нашли ошибку, пожалуйста, создайте issue на [GitHub](https://github.com/1CDevFlow/BSL-Doc).
107 changes: 46 additions & 61 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,62 +1,74 @@
plugins {
java
application
id("io.freefair.lombok") version "6.6.1"
id("me.qoomon.git-versioning") version "6.4.3"
id("com.gorylenko.gradle-git-properties") version "2.4.1"
id("io.freefair.lombok") version "8.4"
id("maven-publish")
id("org.springframework.boot") version "2.7.10"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Spring Boot 2.7 end of life support date

💡 Result:

  • Community (open-source) end-of-life / end of community support for Spring Boot 2.7: November 24, 2023. [1][2]

  • Commercial (paid) support window was extended to August 2025 (previously scheduled to end February 2025). [3][4]

Sources:
[1] Spring Boot blog (2.6.14 post noting 2.7 OSS support extension to Nov 2023).
[2] Spring Boot GitHub / project notes confirming 2.7 OSS end-of-support date (Nov 24, 2023).
[3] Spring blog — "Spring Commercial Support Extension" (announces commercial support extension to August 2025).
[4] Spring blog — "Updates to Spring Support Policy" (policy / support timeline context).


Consider upgrading from Spring Boot 2.7.10, which reached end of community support in November 2023.

Spring Boot 2.7.x no longer receives security patches or bug fixes in the open-source track. Your project already has Java 17 configured, so you can upgrade to Spring Boot 3.x. Be aware that this requires updating imports to Jakarta EE namespaces and will need dependency adjustments, but the upgrade path is well-documented and you have the Java version prerequisite in place.

🤖 Prompt for AI Agents
In `@build.gradle.kts` at line 8, The project is using Spring Boot 2.7.10
(id("org.springframework.boot") version "2.7.10"), which is EOL; update the
plugin version to a Spring Boot 3.x release compatible with Java 17 and then
migrate code and dependencies to Jakarta EE namespaces (javax -> jakarta) and
any updated dependency coordinates; specifically change the Gradle plugin
version, update Spring-related dependencies (starter artifacts,
spring-boot-starter-*, spring-boot-gradle-plugin usages), run the Spring Boot 3
migration checklist (API changes, actuator, security, test libs), and adjust
imports/usages across classes (controllers, filters, config classes) to
jakarta.* to resolve compilation and runtime issues.

id("io.spring.dependency-management") version "1.1.0"
id("org.sonarqube") version "6.1.0.5360"
}

group = "ru.alkoleft.bsl.doc"
version = "0.1.0-SNAPSHOT"
gitVersioning.apply {
refs {
considerTagsOnBranches = true
tag("v(?<tagVersion>[0-9].*)") {
version = "\${ref.tagVersion}\${dirty}"
}
branch(".+") {
version = "\${ref}-\${commit.short}\${dirty}"
}
}

rev {
version = "\${commit.short}\${dirty}"
}
}

val JUINT_VERSION = "5.8.2"
val junitVersion = "5.8.2"
val jacksonVersion = "2.19.0"

repositories {
mavenLocal()
mavenCentral()
maven(url = "https://jitpack.io")
maven("https://central.sonatype.com/repository/maven-snapshots")
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

java.sourceSets["main"].java {
srcDir("src/main/java")
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

dependencies {
// spring
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-websocket")
implementation("info.picocli:picocli-spring-boot-starter:4.7.1")

implementation("com.github.1c-syntax", "bsl-language-server", "0.20.0")
// CLI
implementation("info.picocli", "picocli", "4.7.5")

implementation("com.github.1c-syntax", "mdclasses", "0.10.3")
implementation("io.github.1c-syntax", "bsl-common-library", "f6714e4e")
implementation("io.github.1c-syntax", "supportconf", "0.1.1") {
exclude("io.github.1c-syntax", "bsl-common-library")
}
implementation("com.github.1c-syntax", "bsl-parser", "167aaad827322e09ccde4658a71152dad234de4b") {
exclude("com.tunnelvisionlabs", "antlr4-annotations")
exclude("com.ibm.icu", "*")
exclude("org.antlr", "ST4")
exclude("org.abego.treelayout", "org.abego.treelayout.core")
exclude("org.antlr", "antlr-runtime")
exclude("org.glassfish", "javax.json")
}
// 1c-syntax
implementation("io.github.1c-syntax", "mdclasses", "0.17.3")
implementation("io.github.1c-syntax", "utils", "0.6.8")
implementation("io.github.1c-syntax", "bsl-common-library", "0.9.2")
implementation("io.github.1c-syntax", "bsl-parser", "0.30.0")
// logging
implementation("org.slf4j", "slf4j-api", "2.1.0-alpha1")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

slf4j latest stable version release 2025

💡 Result:

The latest stable SLF4J release is 2.0.17, published February 25, 2025. [1][2]

Sources:

  • SLF4J download page (stable version 2.0.17). [1]
  • SLF4J news: "Release of SLF4J 2.0.17" (2025-02-25). [2]

Use stable version of slf4j instead of alpha release.

slf4j-api:2.1.0-alpha1 is an alpha release and unsuitable for production. Use the latest stable version 2.0.17 instead.

🤖 Prompt for AI Agents
In `@build.gradle.kts` at line 55, Replace the alpha SLF4J dependency version with
the stable release: locate the dependency declaration
implementation("org.slf4j", "slf4j-api", "2.1.0-alpha1") in the build.gradle.kts
and change the version string to "2.0.17" so the project uses the stable
slf4j-api 2.0.17 release.


// config load
implementation("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
implementation("com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion")

// template engine
implementation("com.github.jknack:handlebars:4.3.1")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for Maven Central repository info on jknack handlebars
curl -s "https://api.github.com/repos/jknack/handlebars.java/releases" | head -50

Repository: 1CDevFlow/BSL-Doc

Length of output: 178


🌐 Web query:

Handlebars jknack 4.3.1 security vulnerabilities CVE

💡 Result:

Handlebars (jknack) 4.3.1 is reported by package trackers to be affected by multiple CVEs. Notable entries include CVE-2019-19919 (prototype‑pollution → RCE in Handlebars.js family) and more recent component CVEs reported against dependencies (e.g., CVE-2025-48924). For references and full lists see:

  • Handlebars.java 4.3.1 package page (vulnerability summary). [1]
  • NVD entry for CVE-2019-19919 (prototype pollution / RCE). [2]
  • Advisory/details for CVE-2025-48924 (dependency issue cited against builds using 4.3.1). [3]

If you want, I can enumerate every CVE shown for 4.3.1 (with dates, severity and remediation for each) and suggest the minimum safe upgrade.

Sources:
[1] https://mvnrepository.com/artifact/com.github.jknack/handlebars.java/4.3.1
[2] https://nvd.nist.gov/vuln/detail/CVE-2019-19919
[3] https://www.tenable.com/cve/CVE-2025-48924


🌐 Web query:

handlebars.java latest version 2025 Maven Central

💡 Result:

Latest Maven Central version: com.github.jknack:handlebars.java 4.5.0 (released Aug 7, 2025). [1][2]

Maven dependency:

com.github.jknack
handlebars.java
4.5.0

Sources: [1] mvnrepository listing for handlebars.java 4.5.0. [2] GitHub release v4.5.0.


Upgrade Handlebars to 4.5.0 — security vulnerabilities in 4.3.1.

Version 4.3.1 has known security vulnerabilities, including CVE-2019-19919 (prototype-pollution/RCE) and CVE-2025-48924. Upgrade to 4.5.0 (latest available version as of August 2025).

🤖 Prompt for AI Agents
In `@build.gradle.kts` at line 63, The Handlebars dependency uses an insecure
version string implementation("com.github.jknack:handlebars:4.3.1"); update that
dependency declaration to use version 4.5.0
(implementation("com.github.jknack:handlebars:4.5.0")), then refresh/update
Gradle dependencies (re-run dependency resolution/refresh or update lockfiles)
and rebuild to ensure the new version is picked up and tests pass.

implementation("org.apache.velocity:velocity-engine-core:2.3")
implementation("org.apache.velocity:velocity-tools:2.0")

testImplementation("org.junit.jupiter:junit-jupiter:$JUINT_VERSION")
testImplementation("org.junit.jupiter:junit-jupiter-api:$JUINT_VERSION")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$JUINT_VERSION")
implementation("commons-io", "commons-io", "2.18.0")

// tests
testImplementation("org.slf4j", "slf4j-reload4j", "2.1.0-alpha1")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Test dependency also uses alpha slf4j version.

slf4j-reload4j:2.1.0-alpha1 should match the stable version chosen for the main slf4j-api dependency to ensure consistency.

🤖 Prompt for AI Agents
In `@build.gradle.kts` at line 68, The test dependency declares slf4j-reload4j
with an alpha version ("slf4j-reload4j", "2.1.0-alpha1"); update this to the
same stable version used for the main slf4j-api dependency (replace
"2.1.0-alpha1" with the project's chosen stable slf4j version) so both main and
test dependencies match and avoid mixing alpha/stable artifacts.

testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}

tasks.test {
Expand All @@ -74,41 +86,14 @@ tasks.withType<JavaCompile> {
}

tasks.jar {
// manifest {
// attributes["Main-Class"] = "ru.alkoleft.bsl.doc.Main"
// }
enabled = true
archiveClassifier.set("")
}

tasks.bootJar {
// manifest {
// attributes["Main-Class"] = "ru.alkoleft.bsl.doc.Main"
// }
archiveClassifier.set("exec")
}

tasks {
val fatJar = register<Jar>("fatJar") {
dependsOn.addAll(listOf("compileJava", "processResources")) // We need this for Gradle optimization to work
archiveClassifier.set("standalone") // Naming the jar
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest { attributes(mapOf("Main-Class" to application.mainClass)) } // Provided we set it up in the application plugin configuration
val sourcesMain = sourceSets.main.get()
val contents = configurations.runtimeClasspath.get()
.map { if (it.isDirectory) it else zipTree(it) } +
sourcesMain.output
from(contents)
}
build {
dependsOn(fatJar) // Trigger fat jar creation during build
}

group = "build"
}



publishing {
repositories {
maven {
Expand All @@ -125,4 +110,4 @@ publishing {
from(components["java"])
}
}
}
}
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading