Skip to content

Commit

Permalink
fix: unterminated 's' command
Browse files Browse the repository at this point in the history
https://github.com/kingdonb/community/actions/runs/8068067412/job/22039967712

* Update KUBECON.md
* break out update-kubecon into script
* Strip image links to replace with shortcodes

Add a debug flag and test the script several more times

Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
  • Loading branch information
kingdonb committed Feb 27, 2024
1 parent 4ef4e3f commit 0dea274
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 12 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/update-kubecon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ jobs:
run: |
# go install github.com/suntong/html2md@latest
HTML2MD=html2md_1.5.0_linux_amd64
wget https://github.com/suntong/html2md/releases/download/v1.5.0/${HTML2MD}.tar.gz
tar xvf ${HTML2MD}.tar.gz
HTML2MD_VER=v1.5.0
HTML2MD_BIN="./${HTML2MD}/html2md"
SOURCE_SITE="https://sites.google.com/view/flux-kubecon-paris-2024/home"
export SOURCE_SITE HTML2MD_BIN HTML2MD_VER HTML2MD
./script/update-kubecon.sh
wget https://sites.google.com/view/flux-kubecon-paris-2024/home -O kubecon.html \
&& ${HTML2MD_BIN} -i kubecon.html |sed '1,6d'|head -n -13 \
| sed 's_# \[Copy heading link\](\\#h\.[a-z0-9]*)[[:space:]]*_# _' \
| sed 's_/view/flux-kubecon-paris-2024/home_/kubecon' \
> KUBECON.md \
&& rm kubecon.html && rm -rf ${HTML2MD}*
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
Expand Down
8 changes: 4 additions & 4 deletions KUBECON.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[![](https://lh3.googleusercontent.com/YyFFZKmhaF_tupq893gXB9QlI0sTIB_kKIWRQRKYkM4DM57NiWsA8-a3fdAsNfVSENMpmB8woL7ZoMxvz60QJ9E=w16383)Flux and Flagger @ KubeCon Paris 2024](/kubecon)
[Flux and Flagger @ KubeCon Paris 2024](/kubecon)

# KubeCon activities!

![](https://lh4.googleusercontent.com/Zs2nLOcdZduejxNPG1ggl7LC7LGW4e9ICzWj6PVeOvb3U4BA4VxylXIJbNIDUGB9K8lKVQrRhtJ8K7zc69cvVqggfFYepEqpA1c6-QQwZKfzzW6UT3P42uB9M6XpLk7eyA=w1280)
put-logo-shortcode-here

# KubeCon Paris 2024

March 19-22, 2024

![](https://lh5.googleusercontent.com/QSY9peqmDRMHJ48d6C39-WFTsXZmWchXFWGo-sLsPqQjWiYlwgifgBTnpYmmQKmQxAmHcgvCSNvYX4Hy8OY21OHqd7S-05iWaULoskrqSdmspuH4lj31FFOBmIcwQH02kw=w1280)
put-blob-shortcode-here

# Flux news!

[Flux General Availability announced in December 2024!](https://fluxcd.io/blog/2023/12/flux-v2.2.0/)

[Second Security audit: No CVEs!](https://fluxcd.io/blog/2023/11/flux-security-audit/)

![](https://lh6.googleusercontent.com/kN2ZY5XrU7NJ6OLB6NIZn7m6eXLvhLKieXpvQ4jYhSoffmNMb4civCKYSQGhZ6MNewO2L0RJxhiiGFkmzIsUgzFYEQ4uao2zxwJV07qZ6XQ15m06KkRFdyp09sN1-dbuMg=w1280)
put-stickers-shortcode-here

# Flux Booth fun!

Expand Down
38 changes: 38 additions & 0 deletions script/update-kubecon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
# Define and export these (ahead of the script):
#
# HTML2MD=html2md_1.5.0_linux_amd64
# HTML2MD_VER=v1.5.0
# HTML2MD_BIN="./${HTML2MD}/html2md"
# SOURCE_SITE="https://sites.google.com/view/flux-kubecon-paris-2024/home"
# export SOURCE_SITE HTML2MD_BIN HTML2MD_VER HTML2MD

TEMP_FILE=kubecon.html
OUT_FILE=KUBECON.md

if [[ -z "$DEBUG" ]]; then
wget https://github.com/suntong/html2md/releases/download/${HTML2MD_VER}/${HTML2MD}.tar.gz -O ${HTML2MD}.tar.gz
tar xvf ${HTML2MD}.tar.gz
else
HTML2MD_BIN=`which html2md`
fi

# sed 1: Remove "Copy heading link" text, which is inserted by Google Site
# sed 2: make site top-link self-referential, it should point at /kubecon
# sed 3: remove empty image alt ref with no significance (branding logo)
wget ${SOURCE_SITE} -O ${TEMP_FILE} \
&& ${HTML2MD_BIN} -i ${TEMP_FILE} |sed '1,6d'|head -n -13 \
| sed 's_# \[Copy heading link\](\\#h\.[a-z0-9]*)[[:space:]]*_# _' \
| sed 's_/view/flux-kubecon-paris-2024/home_/kubecon_' \
| sed -E 's_\[!\[\]\([^)]+\)_[_g' \
| sed -E 's_!\[flux-logo-inner-header-left[^)]+\)_put-logo-shortcode-here_g' \
| sed -E 's_!\[inner-header-right-align[^)]+\)_put-blob-shortcode-here_g' \
| sed -E 's_!\[stickers-float-left[^)]+\)_put-stickers-shortcode-here_g' \
> ${OUT_FILE}

# TODO: The remaining images all have alt-text which can be further
# re-processed into CSS selectors? or maybe short codes, I think 😵

if [[ -z "$DEBUG" ]]; then
rm ${TEMP_FILE} && rm -rf ${HTML2MD}*
fi

0 comments on commit 0dea274

Please sign in to comment.