Right now the workflow for converting a wordpress blog post that has already had simple code embed blocks is:
- Create a new github gist with a temporary file in it
- Clone the gist using ssh: https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/forking-and-cloning-gists
- Load the blog post in question
- Run the contents of
output-all-wp-code-blocks.js
in the browser console - Copy the console output (right click and select "Export visible messages to > clipboard")
cd
into your github gist repository- Run this in terminal session
pbpaste | ruby splitter.rb
to generate files from the clipboard - delete the temporary file
- Manually edit the files to make sure the file extensions are correct / review in general
- commit and push to the gist
- View the gist in the browser
- Run the contents of
copy-github-gist-link-on-click.js
- Click the anchor links of each code snippet to copy the url
- Paste the URL into the blog post above each code snippet to create a github gist embed
- Review and confirm each gist corresponds to the wp code block
- Delete the wp code blocks
...whew! Wtf that's what I did? Sigh