Skip to content

Commit 3d21b06

Browse files
jmooringbep
authored andcommitted
markup/asciidocext: Improve Asciidoctor integration
Fixes an issue where improper attribute derivation from the page's relative permalink caused failures with `outdir`, `imagesoutdir`, and `imagesdir` when `markup.asciidocext.workingFolderCurrent` is enabled. The updated logic now correctly handles: - Multi-byte characters - Multilingual multi-host sites - Site builds from a subdirectory - Pages using ugly URLs Supports diagram caching as implemented in v3.1.0 of the asciidoctor-diagram extension: - Enables caching by default - Sets default cache location to the compiled value of caches.misc.dir Reduces duration of integration tests by: - Generating GoAT diagrams instead of Ditaa diagrams - Taking advantage of asciidoctor-diagram caching Closes #9202 Closes #10183 Closes #10473 Closes #14160
1 parent 34b0c15 commit 3d21b06

File tree

17 files changed

+1947
-671
lines changed

17 files changed

+1947
-671
lines changed

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,12 @@ jobs:
4646
uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
4747
with:
4848
ruby-version: "3.4.5"
49-
- name: Install gems
49+
- name: Install Ruby gems
5050
run: |
5151
gem install asciidoctor -v "2.0.26"
5252
gem install asciidoctor-diagram -v "3.1.0"
53-
gem install asciidoctor-diagram-ditaamini -v "1.0.3"
5453
- name: Install GoAT
5554
run: go install github.com/blampe/goat/cmd/goat@177de93b192b8ffae608e5d9ec421cc99bf68402
56-
- name: Install Java # required by asciidoctor-diagram-ditaamini
57-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
58-
with:
59-
distribution: temurin
60-
java-version: "25"
61-
java-package: jre
6255
- name: Install Python
6356
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
6457
with:

‎cache/filecache/filecache_config.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,18 @@ const (
5151

5252
type Configs map[string]FileCacheConfig
5353

54+
// CacheDirModules returns the compiled path to the modules cache.
5455
// For internal use.
5556
func (c Configs) CacheDirModules() string {
5657
return c[CacheKeyModules].DirCompiled
5758
}
5859

60+
// CacheDirMisc returns the compiled path to the misc cache.
61+
// For internal use.
62+
func (c Configs) CacheDirMisc() string {
63+
return c[CacheKeyMisc].DirCompiled
64+
}
65+
5966
var defaultCacheConfigs = Configs{
6067
CacheKeyModules: {
6168
MaxAge: -1,

‎config/allconfig/configlanguage.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ func (c ConfigLanguage) WorkingDir() string {
135135
return c.m.Base.WorkingDir
136136
}
137137

138+
func (c ConfigLanguage) CacheDirMisc() string {
139+
return c.config.Caches.CacheDirMisc()
140+
}
141+
138142
func (c ConfigLanguage) Quiet() bool {
139143
return c.m.Base.Internal.Quiet
140144
}

‎config/configProvider.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ type AllProvider interface {
7979
WorkingDir() string
8080
EnableEmoji() bool
8181
ConfiguredDimensions() *sitesmatrix.ConfiguredDimensions
82+
CacheDirMisc() string
8283
}
8384

8485
// We cannot import the media package as that would create a circular dependency.

0 commit comments

Comments
 (0)