diff --git a/scripts/generate_specTypeExt_docs.ps1 b/scripts/generate_specTypeExt_docs.ps1 new file mode 100644 index 0000000..c52487a --- /dev/null +++ b/scripts/generate_specTypeExt_docs.ps1 @@ -0,0 +1,21 @@ +Write-Host "start" +$SCRIPT_FOLDER = (Get-Item $MyInvocation.MyCommand.Path).Directory.FullName +$SOURCE_BASE = "../../../iSamples/metadata_profile_earth_science/vocabulary/" +$SOURCES = @("earthenv_specimen_type.ttl") +$DEST_FOLDER = "../../../iSamples/metadata_profile_earth_science/docs/" + +# Create destination folder if it doesn't exist +New-Item -ItemType Directory -Force -Path $DEST_FOLDER | Out-Null + +foreach ($src in $SOURCES) { + $fname = [System.IO.Path]::ChangeExtension($src, "md") + Write-Host ("Generating {0}..." -f $fname) + # call via conda to get the correct python env + & "C:\Users\smrTu\miniconda3\Scripts\conda.exe" run -n quarto python ("{0}\vocab2md.py" -f $SCRIPT_FOLDER) ("{0}{1}" -f $SOURCE_BASE, $src) | Out-File -FilePath ("{0}{1}" -f $DEST_FOLDER, $fname) + # Assuming quarto is in the system PATH + quarto render ("{0}{1}" -f $DEST_FOLDER, $fname) --to html +} + +Write-Host "Done. " +# run in the C:\Users\smrTu\OneDrive\Documents\GithubC\smrgeoinfo\vocabulary\scripts directory +# powershell generate_specTypeExt_docs.ps1 diff --git a/scripts/generate_specTypeExt_docs.sh b/scripts/generate_specTypeExt_docs.sh index eb4baf1..8677676 100644 --- a/scripts/generate_specTypeExt_docs.sh +++ b/scripts/generate_specTypeExt_docs.sh @@ -4,11 +4,10 @@ # # echo "start" - SCRIPT_FOLDER="$(dirname ${0})" -SOURCE_BASE="../../../iSamples/vocabularies/src/extensions/" -SOURCES=( "specimenTypeExtension.ttl" ) -DEST_FOLDER="../../../iSamples/vocabularies/src/extensions/html/" +SOURCE_BASE="../../../iSamples/metadata_profile_earth_science/vocabulary/" +SOURCES=( "earthenv_specimen_type.ttl" ) +DEST_FOLDER="../../../iSamples/metadata_profile_earth_science/docs/" mkdir -p "${DEST_FOLDER}" for src in ${SOURCES[@]}; do fname="${src%%.*}.md" @@ -16,8 +15,6 @@ for src in ${SOURCES[@]}; do python "${SCRIPT_FOLDER}/vocab2md.py" "${SOURCE_BASE}${src}" > "${DEST_FOLDER}${fname}" quarto render "${DEST_FOLDER}${fname}" --to html done - echo "Done. Type 'exit' to close window. " - # this is just to keep the window open to see the console output and any error messages powershell