Skip to content

Commit

Permalink
Merge pull request #388 from w3c/first-public-draft-release
Browse files Browse the repository at this point in the history
First public draft release
  • Loading branch information
gregoriopellegrino authored Aug 30, 2024
2 parents 3cc9735 + 6add073 commit 3f5bc0b
Show file tree
Hide file tree
Showing 10 changed files with 9,582 additions and 9 deletions.
1,469 changes: 1,466 additions & 3 deletions UX-Guide-Metadata/2.0/principles/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,466 changes: 1,466 additions & 0 deletions UX-Guide-Metadata/2.0/principles/principles-draft-note-20240830.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,659 changes: 1,656 additions & 3 deletions UX-Guide-Metadata/2.0/techniques/epub-metadata/index.html
100644 → 100755

Large diffs are not rendered by default.

1,630 changes: 1,627 additions & 3 deletions UX-Guide-Metadata/2.0/techniques/onix-metadata/index.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
84 changes: 84 additions & 0 deletions UX-Guide-Metadata/bin/publish-drafts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash

# Script for creating static version for the UX-Guide-Metadata documents
# It starts from the published draft (in the main branch): https://w3c.github.io/publ-a11y/UX-Guide-Metadata/draft/principles/
# It generates the static version
# It runs nuchecker and link checker
# The output is a zip folder that can be sent to W3C staff for publishing on the website

# pre-run: cleans and temporary directory...
basedir=$(readlink -f "$0")
basedir=$(dirname "$basedir")
documents=( "principles" "techniques/epub-metadata" "techniques/onix-metadata" )
bold=$(tput bold)
normal=$(tput sgr0)

# input
read -p 'Publishing date (format YYYY-MM-DD): ' publishDate
publishDateWithoutDashes=${publishDate//-/}

for document in "${documents[@]}"
do
printf "\n\nDocument ${bold}$document${normal}...\n"

# variables for document
tmpdir=$(mktemp -d)
filename=${document##*/}
versionFilename="$filename-draft-note-$publishDateWithoutDashes.html"
versionURL="https://w3c.github.io/publ-a11y/UX-Guide-Metadata/2.0/$document/$versionFilename"

# copies the content to the temporary directory
printf "\nCopying the content to the temporary directory..."
cp -a "$basedir/../draft/$document/." $tmpdir
rm $tmpdir/*.md

# generates the static version
printf "\nGenerating static version...\n"
curl \
-G \
--data-urlencode "type=respec" \
--data-urlencode "url=https://w3c.github.io/publ-a11y/UX-Guide-Metadata/draft/$document/?specStatus=CG-DRAFT&publishDate=$publishDate&thisVersion=$versionURL" \
https://labs.w3.org/spec-generator/ \
-o "$tmpdir/index.html"

# runs nuchecker
nuVersion=$(java -jar "$basedir/libs/vnu/vnu.jar" --version)
printf "\nRunning Nu Html Checker version $nuVersion...\n"
java -jar "$basedir/libs/vnu/vnu.jar" \
"$tmpdir/index.html"


# commenting while waiting for this issue to be fixed: https://github.com/validator/validator/issues/1745
# if [ $? -gt 0 ]
# then
# exit 1
# fi

# runs link checker
# installed via commands:
# cpan install App::cpanminus
# cpanm W3C::[email protected]
# cpan install Mozilla::CA
# tried to install version 5.0.0 on mac, but I got errors
checklinkVersion=$(checklink --version)
printf "\nRunning $checklinkVersion...\n"
checklink \
--summary \
--broken \
"https://w3c.github.io/publ-a11y/UX-Guide-Metadata/draft/$document/?specStatus=CG-DRAFT&publishDate=$publishDate"

# commenting while waiting for this issue to be fixed: https://github.com/w3c/publ-a11y/issues/386
# if [ $? -gt 0 ]
# then
# exit 1
# fi

printf "\nMoving temporary files to directory..."
mv $tmpdir/* "$basedir/../2.0/$document/"

printf "\nCopying for versioning..."
cp "$basedir/../2.0/$document/index.html" "$basedir/../2.0/$document/$versionFilename"

done

printf "\nDone"

0 comments on commit 3f5bc0b

Please sign in to comment.