// TODO: move to antora.yml once supported

// the following attributes must be updated immediately before a release

// pkl version corresponding to current git commit without -dev suffix or git hash
:pkl-version-no-suffix: 0.32.0
// tells whether pkl version corresponding to current git commit
// is a release version (:is-release-version: '') or dev version (:!is-release-version:)
:!is-release-version:

// the remaining attributes do not need to be updated regularly

:pkl-version: {pkl-version-no-suffix}-dev
ifdef::is-release-version[]
:pkl-version: {pkl-version-no-suffix}
endif::[]

// use non-unique snapshot version because we have no way to determine unique snapshot version here
:pkl-artifact-version: {pkl-version-no-suffix}-SNAPSHOT
ifdef::is-release-version[]
:pkl-artifact-version: {pkl-version}
endif::[]

:uri-maven-docsite: https://central.sonatype.com

:uri-snapshot-repo: https://central.sonatype.com/repository/maven-snapshots

:uri-maven-repo: https://central.sonatype.com/repository/maven-snapshots
ifdef::is-release-version[]
:uri-maven-repo: https://repo1.maven.org/maven2
endif::[]

:symbolic-version-name: latest
ifdef::is-release-version[]
:symbolic-version-name: current
endif::[]
:uri-pkl-docs-base: https://pkl-lang.org/package-docs
:uri-pkl-stdlib-docs-base: {uri-pkl-docs-base}/pkl
:uri-pkl-stdlib-docs: {uri-pkl-stdlib-docs-base}/{pkl-version}
:uri-pkl-stdlib-docs-index: {uri-pkl-stdlib-docs}/

:github-branch: main
ifdef::is-release-version[]
:github-branch: {pkl-version-no-suffix}
endif::[]
:uri-github-tree: https://github.com/apple/pkl/tree/{github-branch}
:uri-pkl-stdlib-sources: {uri-github-tree}/stdlib

:github-releases-base: https://github.com/apple/pkl/releases
:github-releases: {github-releases-base}/download/{pkl-artifact-version}

:uri-pkl-core-main-sources: {uri-github-tree}/pkl-core/src/main/java/org/pkl/core
:uri-pkl-cli-main-sources: {uri-github-tree}/pkl-cli/src/main/kotlin/org/pkl/cli
:uri-pkl-doc-main-sources: {uri-github-tree}/pkl-doc/src/main/kotlin/org/pkl/doc

// This attribute is used as language for Pkl code blocks.
// It can then be mapped to different languages in different environments (e.g., IntelliJ vs. Antora).
:pkl: pkl
:pkl-expr: pkl expression

:uri-pkl-examples-repo: https://github.com/apple/pkl-jvm-examples
:uri-pkl-examples-tree: {uri-pkl-examples-repo}/tree/main
:uri-build-eval-example: {uri-pkl-examples-tree}/build-eval
:uri-codegen-java-example: {uri-pkl-examples-tree}/codegen-java
:uri-codegen-kotlin-example: {uri-pkl-examples-tree}/codegen-kotlin
:uri-config-java-example: {uri-pkl-examples-tree}/config-java
:uri-config-kotlin-example: {uri-pkl-examples-tree}/config-kotlin
:uri-pkldoc-example: {uri-pkl-examples-tree}/pkldoc

:uri-stdlib-baseModule: {uri-pkl-stdlib-docs}/base
:uri-stdlib-CommandModule: {uri-pkl-stdlib-docs}/Command
:uri-stdlib-refModule: {uri-pkl-stdlib-docs}/ref
:uri-stdlib-analyzeModule: {uri-pkl-stdlib-docs}/analyze
:uri-stdlib-jsonnetModule: {uri-pkl-stdlib-docs}/jsonnet
:uri-stdlib-reflectModule: {uri-pkl-stdlib-docs}/reflect
:uri-stdlib-mathModule: {uri-pkl-stdlib-docs}/math
:uri-stdlib-xmlModule: {uri-pkl-stdlib-docs}/xml
:uri-stdlib-protobufModule: {uri-pkl-stdlib-docs}/protobuf
:uri-stdlib-pklbinaryModule: {uri-pkl-stdlib-docs}/pklbinary
:uri-stdlib-yamlModule: {uri-pkl-stdlib-docs}/yaml
:uri-stdlib-YamlParser: {uri-stdlib-yamlModule}/Parser
:uri-stdlib-projectModule: {uri-pkl-stdlib-docs}/Project
:uri-stdlib-evaluatorSettingsModule: {uri-pkl-stdlib-docs}/EvaluatorSettings
:uri-stdlib-evaluatorSettingsHttpClass: {uri-stdlib-evaluatorSettingsModule}/Http
:uri-stdlib-evaluatorSettingsExternalReaderClass: {uri-stdlib-evaluatorSettingsModule}/ExternalReader
:uri-stdlib-Boolean: {uri-stdlib-baseModule}/Boolean
:uri-stdlib-xor: {uri-stdlib-baseModule}/Boolean#xor()
:uri-stdlib-implies: {uri-stdlib-baseModule}/Boolean#implies()
:uri-stdlib-Any: {uri-stdlib-baseModule}/Any
:uri-stdlib-String: {uri-stdlib-baseModule}/String
:uri-stdlib-Collection: {uri-stdlib-baseModule}/Collection
:uri-stdlib-StringToInt: {uri-stdlib-baseModule}/String#toInt()
:uri-stdlib-Int: {uri-stdlib-baseModule}/Int
:uri-stdlib-Float: {uri-stdlib-baseModule}/Float
:uri-stdlib-Number: {uri-stdlib-baseModule}/Number
:uri-stdlib-NaN: {uri-stdlib-baseModule}/#NaN
:uri-stdlib-Infinity: {uri-stdlib-baseModule}/#Infinity
:uri-stdlib-isBetween: {uri-stdlib-baseModule}/Number#isBetween
:uri-stdlib-isFinite: {uri-stdlib-baseModule}/Number#isFinite
:uri-stdlib-Int8: {uri-stdlib-baseModule}/#Int8
:uri-stdlib-Int16: {uri-stdlib-baseModule}/#Int16
:uri-stdlib-Int32: {uri-stdlib-baseModule}/#Int32
:uri-stdlib-UInt8: {uri-stdlib-baseModule}/#UInt8
:uri-stdlib-UInt16: {uri-stdlib-baseModule}/#UInt16
:uri-stdlib-UInt32: {uri-stdlib-baseModule}/#UInt32
:uri-stdlib-UInt: {uri-stdlib-baseModule}/#UInt
:uri-stdlib-Uri: {uri-stdlib-baseModule}/#Uri
:uri-stdlib-matches: {uri-stdlib-baseModule}/String#matches()
:uri-stdlib-Null: {uri-stdlib-baseModule}/Null
:uri-stdlib-ifNonNull: {uri-stdlib-baseModule}/Null#ifNonNull()
:uri-stdlib-List: {uri-stdlib-baseModule}/List
:uri-stdlib-Set: {uri-stdlib-baseModule}/Set
:uri-stdlib-Map: {uri-stdlib-baseModule}/Map
:uri-stdlib-Listing: {uri-stdlib-baseModule}/Listing
:uri-stdlib-Listing-default: {uri-stdlib-baseModule}/Listing#default
:uri-stdlib-Listing-isDistinct: {uri-stdlib-baseModule}/Listing#isDistinct
:uri-stdlib-Listing-isDistinctBy: {uri-stdlib-baseModule}/Listing#isDistinctBy()
:uri-stdlib-Mapping: {uri-stdlib-baseModule}/Mapping
:uri-stdlib-Mapping-default: {uri-stdlib-baseModule}/Mapping#default
:uri-stdlib-Duration: {uri-stdlib-baseModule}/Duration
:uri-stdlib-Duration-value: {uri-stdlib-baseModule}/Duration#value
:uri-stdlib-Duration-unit: {uri-stdlib-baseModule}/Duration#unit
:uri-stdlib-DurationUnit: {uri-stdlib-baseModule}/#DurationUnit
:uri-stdlib-DataSize: {uri-stdlib-baseModule}/DataSize
:uri-stdlib-DataSize-value: {uri-stdlib-baseModule}/DataSize#value
:uri-stdlib-DataSize-unit: {uri-stdlib-baseModule}/DataSize#unit
:uri-stdlib-DataSizeUnit: {uri-stdlib-baseModule}/#DataSizeUnit
:uri-stdlib-Dynamic: {uri-stdlib-baseModule}/Dynamic
:uri-stdlib-Dynamic-toTyped: {uri-stdlib-baseModule}/Dynamic#toTyped()
:uri-stdlib-Typed: {uri-stdlib-baseModule}/Typed
:uri-stdlib-Regex: {uri-stdlib-baseModule}/Regex
:uri-stdlib-Regex-method: {uri-stdlib-baseModule}/#Regex()
:uri-stdlib-Regex-match: {uri-stdlib-baseModule}/Regex#match
:uri-stdlib-RegexMatch: {uri-stdlib-baseModule}/RegexMatch
:uri-stdlib-Pair: {uri-stdlib-baseModule}/Pair
:uri-stdlib-IntSeq: {uri-stdlib-baseModule}/IntSeq
:uri-stdlib-Class: {uri-stdlib-baseModule}/Class
:uri-stdlib-TypeAlias: {uri-stdlib-baseModule}/TypeAlias
:uri-stdlib-Deprecated: {uri-stdlib-baseModule}/Deprecated
:uri-stdlib-BaseValueRenderer: {uri-stdlib-baseModule}/BaseValueRenderer
:uri-stdlib-ValueRenderer: {uri-stdlib-baseModule}/ValueRenderer
:uri-stdlib-BytesRenderer: {uri-stdlib-baseModule}/BytesRenderer
:uri-stdlib-YamlRenderer: {uri-stdlib-baseModule}/YamlRenderer
:uri-stdlib-PcfRenderer-converters: {uri-stdlib-baseModule}/PcfRenderer#converters
:uri-stdlib-Function: {uri-stdlib-baseModule}/Function
:uri-stdlib-Function0: {uri-stdlib-baseModule}/Function0
:uri-stdlib-Function1: {uri-stdlib-baseModule}/Function1
:uri-stdlib-Function1-apply: {uri-stdlib-baseModule}/Function1#apply()
:uri-stdlib-Function2: {uri-stdlib-baseModule}/Function2
:uri-stdlib-Function3: {uri-stdlib-baseModule}/Function3
:uri-stdlib-Function4: {uri-stdlib-baseModule}/Function4
:uri-stdlib-Function5: {uri-stdlib-baseModule}/Function5
:uri-stdlib-Bytes: {uri-stdlib-baseModule}/Bytes
:uri-stdlib-Resource: {uri-stdlib-baseModule}/Resource
:uri-stdlib-outputFiles: {uri-stdlib-baseModule}/ModuleOutput#files
:uri-stdlib-FileOutput: {uri-stdlib-baseModule}/FileOutput
:uri-stdlib-Annotation: {uri-stdlib-baseModule}/Annotation
:uri-stdlib-ConvertProperty: {uri-stdlib-baseModule}/ConvertProperty
:uri-stdlib-Command-Flag: {uri-stdlib-CommandModule}/Flag
:uri-stdlib-Command-BooleanFlag: {uri-stdlib-CommandModule}/BooleanFlag
:uri-stdlib-Command-CountedFlag: {uri-stdlib-CommandModule}/CountedFlag
:uri-stdlib-Command-Argument: {uri-stdlib-CommandModule}/Argument
:uri-stdlib-Command-Import: {uri-stdlib-CommandModule}/Import
:uri-stdlib-ref-Reference: {uri-stdlib-baseModule}/Reference
:uri-stdlib-ref-Access: {uri-stdlib-baseModule}/Access

:uri-messagepack: https://msgpack.org/index.html
:uri-messagepack-spec: https://github.com/msgpack/msgpack/blob/master/spec.md

:uri-pkl-roadmap: https://github.com/orgs/apple/projects/12/views/1

// TODO: figure out what the correct URL should be
:uri-sonatype-snapshot-download: https://s01.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.pkl-lang&v={pkl-artifact-version}
