22
33VERSION=" ${1:- latest} "
44
5- # Function to generate download links for a specific version
6- generate_download_links () {
7- local version=" $1 "
8- # Remove 'v' prefix from version for artifact names
9- local version_no_v=" ${version# v} "
10-
11- if [ " $version " = " latest" ]; then
12- cat << EOF
13- !!! info "Development Version"
14- This is the latest development version of the documentation. For stable releases, please check the version selector above.
15-
16- [📋 View all releases](https://github.com/mvach/ctRestClient/releases)
17- EOF
18- else
19- cat << EOF
20- !!! success "Release ${version} "
21- This documentation is for release version ${version} .
22-
23- ## Downloads for ${version}
24-
25- The following binaries are available for this version:
5+ # Remove 'v' prefix from version for artifact names
6+ VERSION_NO_V=" ${VERSION# v} "
267
27- | Platform | Architecture | Download Link |
28- |----------|--------------|---------------|
29- | 🐧 Linux | x86_64 | [ctRestClient_${version_no_v} _linux_x86_64.tar.gz](https://github.com/mvach/ctRestClient/releases/download/${version} /ctRestClient_${version_no_v} _linux_x86_64.tar.gz) |
30- | 🍎 macOS | Intel (x86_64) | [ctRestClient_${version_no_v} _darwin_x86_64.tar.gz](https://github.com/mvach/ctRestClient/releases/download/${version} /ctRestClient_${version_no_v} _darwin_x86_64.tar.gz) |
31- | 🍎 macOS | Apple Silicon (ARM64) | [ctRestClient_${version_no_v} _darwin_arm64.tar.gz](https://github.com/mvach/ctRestClient/releases/download/${version} /ctRestClient_${version_no_v} _darwin_arm64.tar.gz) |
32- | 🪟 Windows | x86_64 | [ctRestClient_${version_no_v} _windows_x86_64.tar.gz](https://github.com/mvach/ctRestClient/releases/download/${version} /ctRestClient_${version_no_v} _windows_x86_64.tar.gz) |
33-
34- [📋 View all release assets](https://github.com/mvach/ctRestClient/releases/tag/${version} )
35- EOF
36- fi
37- }
8+ echo " Processing documentation for version: $VERSION "
389
3910# Create mkdocs.yml file with version-specific content
11+ echo " Creating mkdocs.yml for version: $VERSION ..."
4012cat > mkdocs.yml << EOF
4113site_name: ctRestClient
4214site_description: Documentation for ctRestClient
@@ -47,13 +19,13 @@ theme:
4719 primary: indigo
4820 accent: indigo
4921 features:
50- - navigation.tabs # This moves the navigation to the top as tabs
51- - navigation.tabs.sticky # Makes the tabs sticky at the top
52- - navigation.sections # Renders sections as groups in the sidebar
53- - navigation.expand # Expands all collapsible sections
54- - toc.follow # Automatically follows the table of contents on the right
55- - content.code.copy # Add copy button to code blocks
56- - navigation.top # Add back to top button
22+ - navigation.tabs
23+ - navigation.tabs.sticky
24+ - navigation.sections
25+ - navigation.expand
26+ - toc.follow
27+ - content.code.copy
28+ - navigation.top
5729use_directory_urls: true
5830plugins:
5931 - search
@@ -62,8 +34,8 @@ markdown_extensions:
6234 - pymdownx.details
6335 - pymdownx.superfences
6436 - pymdownx.emoji:
65- emoji_index: !!python/name:materialx .emoji.twemoji
66- emoji_generator: !!python/name:materialx .emoji.to_svg
37+ emoji_index: !!python/name:material.extensions .emoji.twemoji
38+ emoji_generator: !!python/name:material.extensions .emoji.to_svg
6739 - toc:
6840 permalink: true
6941nav:
@@ -75,35 +47,19 @@ extra:
7547 default: latest
7648EOF
7749
78- # Prepare documentation files with version-specific content
79- # Create a temporary docs directory for processing
50+ # Process template files (*.md.tmp) to create versioned documentation
8051if [ -d " docs" ]; then
81- # Create version info to prepend to documentation files
82- VERSION_INFO=" $( generate_download_links " $VERSION " ) "
83-
84- # Process German manual
85- if [ -f " docs/manual-de.md" ]; then
86- {
87- echo " # ctRestClient - Benutzerhandbuch"
88- echo " "
89- echo " $VERSION_INFO "
90- echo " "
91- # Skip the first line (title) from original file and add the rest
92- tail -n +2 " docs/manual-de.md"
93- } > " docs/manual-de.md.tmp" && mv " docs/manual-de.md.tmp" " docs/manual-de.md"
52+ # Process German manual template
53+ if [ -f " docs/manual-de.md.tmp" ]; then
54+ echo " Processing docs/manual-de.md.tmp -> docs/manual-de.md..."
55+ sed -e " s/\$ {version}/$VERSION /g" -e " s/\$ {version_no_v}/$VERSION_NO_V /g" " docs/manual-de.md.tmp" > " docs/manual-de.md"
9456 fi
9557
96- # Process English manual
97- if [ -f " docs/manual-en.md" ]; then
98- {
99- echo " # ctRestClient - User Manual"
100- echo " "
101- echo " $VERSION_INFO "
102- echo " "
103- # Skip the first line (title) from original file and add the rest
104- tail -n +2 " docs/manual-en.md"
105- } > " docs/manual-en.md.tmp" && mv " docs/manual-en.md.tmp" " docs/manual-en.md"
58+ # Process English manual template
59+ if [ -f " docs/manual-en.md.tmp" ]; then
60+ echo " Processing docs/manual-en.md.tmp -> docs/manual-en.md..."
61+ sed -e " s/\$ {version}/$VERSION /g" -e " s/\$ {version_no_v}/$VERSION_NO_V /g" " docs/manual-en.md.tmp" > " docs/manual-en.md"
10662 fi
10763fi
10864
109- echo " MkDocs configuration created for version: $VERSION "
65+ echo " Template variables replaced successfully for version: $VERSION "
0 commit comments