-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removed ruby/gem dependencies in env.ps1 and updated the docs, added markdownlint-hook.ps1, docs.ps1, and docker.ps1 #636
base: feature/distributed-demo
Are you sure you want to change the base?
Changes from 3 commits
ed76aaa
44b1a36
99f157e
7fe0795
f460288
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Get the version | ||
if ($args) { | ||
$Version = $args[0] | ||
} else { | ||
$Version = "development" | ||
} | ||
|
||
# Set environment variables | ||
$env:VERSION = $Version | ||
$env:COMMIT_HASH = (git rev-parse --short HEAD) | ||
$env:MKDOCS_ENABLE_PDF_EXPORT = 1 | ||
|
||
Write-Output "Version: $Version" | ||
|
||
# Remove the site directory if it exists | ||
if (Test-Path "site") { | ||
Remove-Item "site" -Recurse -Force | ||
} | ||
|
||
# Generate and publish documents | ||
Write-Output "Generate and publish documents..." | ||
& mkdocs build --config-file mkdocs.yml --site-dir "site/online/$Version" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the |
||
|
||
# Copy redirect page | ||
Copy-Item "docs/redirect-page.html" "site/index.html" | ||
|
||
# Checkout webpage-docs branch | ||
git checkout webpage-docs | ||
|
||
# Clean up irrelevant files | ||
if (Test-Path "$Version") { | ||
Remove-Item "$Version" -Recurse -Force | ||
} | ||
|
||
# Move PDF file to top directory | ||
if (Test-Path "site/online/$Version") { | ||
Move-Item "site/online/$Version/pdf/DTaaS-docs.pdf" ".\DTaaS-$Version.pdf" | ||
Move-Item "site/online/$Version" ".\$Version" | ||
} | ||
|
||
# Move index.html to top directory and remove site directory | ||
Move-Item "site/index.html" "." | ||
Remove-Item "site" -Recurse -Force | ||
|
||
# Commit changes | ||
git add . | ||
git commit --no-verify -m "docs for $env:COMMIT_HASH commit" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,17 +24,8 @@ if (-not ([Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarg | |
# Install mkdocs | ||
pip install mkdocs | ||
|
||
# Install Ruby: https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.2-1/rubyinstaller-devkit-3.1.2-1-x64.exe | ||
choco install -y ruby | ||
|
||
# Ensure Ruby scripts directory is added to PATH | ||
if (-not ([Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) -like "*Ruby*")) { | ||
Write-Host "Adding Ruby scripts to PATH..." | ||
[Environment]::SetEnvironmentVariable("Path", "$env:Path;$(Get-Command ruby | Select-Object -ExpandProperty Directory)", [EnvironmentVariableTarget]::Machine) | ||
} | ||
|
||
# Install markdownlint | ||
gem install mdl | ||
choco install markdownlint-cli | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The markdownlint-cli package is related to markdownlint by David Anson. This package is good but is different from the markdownlint package used by codeclimate. So unfortunately we have to keep the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Oh okay, so should i revoke the changes and make it like it was before with the ruby and gem install? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
|
||
# Install mkdocs plugins | ||
pip install mkdocs-material python-markdown-math mkdocs-open-in-new-tab mkdocs-with-pdf qrcode | ||
|
@@ -49,4 +40,4 @@ if (-not ([Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarg | |
choco install -y shellcheck | ||
|
||
# Install madge for generating dependency graphs of typescript projects | ||
npm install -g madge | ||
npm install -g madge |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This script is used by the pre-commit hook to check the markdown files without exiting the commit process. | ||
|
||
# Invoke markdownlint and capture the output | ||
$output = markdownlint $args | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a mistake in the existing bash script. Even though we are installing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
okay got it |
||
|
||
# Print the output | ||
Write-Output $output | ||
|
||
# Exit with code 0 to indicate success | ||
Exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update the instructions in
docs/PUBLISH.md
as well