diff --git a/static/meeting-template.md b/static/meeting-template.md index ffdb54a..6bcd207 100644 --- a/static/meeting-template.md +++ b/static/meeting-template.md @@ -120,22 +120,39 @@ At least 5 people must vote, or 51% of the WG membership, whichever is less. Vot - [ ] category: `Project Discussion` - [ ] tags: `coreos-wg` - [ ] In the terminal Copy and paste the following - ```bash - fcosmeetinghtml() { - local url=$1 - # we'll substitute in using the non-raw url for nice highlighting of line numbers - local baseurl=$(dirname $url) - if [[ ! $url =~ raw ]]; then - url=$(echo "$url" | sed "s|meetbot.fedoraproject.org|meetbot-raw.fedoraproject.org|") - fi - # Take the html and delete the contents (doesn't render correctly) - # and also substitute in the base url to make relative URLs absolute. - curl --silent $url | \ - sed -z 's|.*||' | \ - sed "s|href='fedora|href='${baseurl}/fedora|" | \ - sed "s|href=\"fedora|href=\"${baseurl}/fedora|" - } + fcosmeetinghtml() { + SUMMARY_URL="$1" + LOG_URL="$2" + + # Extract line numbers and timestamps from the log file + timestamps_and_lines=$(curl -s "$LOG_URL" | grep -Eo '
|
[0-9]{2}:[0-9]{2}:[0-9]{2}
') + + # Generate sed commands to replace timestamps with hyperlinks including line numbers + sed_commands="" + current_line="" + while read -r line; do + if [[ "$line" =~ '
' ]]; then + timestamp=$(echo "$line" | grep -Eo '[0-9]{2}:[0-9]{2}:[0-9]{2}') + line_number=$(echo "$current_line" | grep -Eo '[0-9]+') + sed_commands+="s@.*.*($timestamp).*<\/span>@&<\/a>@;" + fi + done <<< "$timestamps_and_lines" + + # Apply sed commands to the summary file, delete contents, and echo the result + curl -s "$SUMMARY_URL" | sed -E -e "$sed_commands" | sed '//,/<\/head>/d' | sed 's/TOPIC://g' + } + + # Example usage + BASE_URL="https://meetbot-raw.fedoraproject.org/meeting-1_matrix_fedoraproject-org/2024-01-10/" + SUMMARY_URL="${BASE_URL}fedora-coreos-meeting.2024-01-10-16.35.html" + LOG_URL="${BASE_URL}fedora-coreos-meeting.2024-01-10-16.35.log.html" + + # Generate HTML with hyperlinks, delete contents, and echo the result + fcosmeetinghtml "$SUMMARY_URL" "$LOG_URL" + ``` - [ ] In the terminal run `fcosmeetinghtml .html`