Add flag to remove the file.
I'd like an option to remove a file. If I have this in CI/CD, I'll end up with all of the deleted files just stagnating. Would you be able to add an option like -d/--delete which reads the header and removes the article at that place?
I'd like to do something like this:
$ git diff 931d9f~1..931d9f7 --name-only --diff-filter=D
test/alice.md
test/bob.md
and then loop over those deleted files and remove them from confluence:
for file in $(git diff 931d9f~1..931d9f7 --name-only --diff-filter=D); do
mark --delete -f $file
done
(Obviously accounting for spaces and such, it will look more complicated)
Hello, is there an ETA or plan to resolve this issue? I believe is important as it leaves sanitizing the Confluence space as a manual labor in case you want to move pages around.
We came up with this workaround: tag the pages manually that need to be deleted, then run this script. This calls the API to list the tagged pages (also filter for pages created by the bot account), and then calls the API again to delete the pages:
#!/bin/bash
set -euo pipefail
pages=$(curl -u "$CONFLUENCE_USERNAME:$CONFLUENCE_PASSWORD" -X GET "${CONFLUENCE_URL}rest/api/search?cql=contributor='${CONFLUENCE_USERNAME}'+and+label='delete_pls'")
echo "${pages}"
for row in $(echo "${pages}" | tr '\r\n' ' ' | jq -r '.results[] | @base64'); do
_jq() {
echo "${row}" | base64 --decode | jq -r "${1}"
}
echo "Deleting page: $(_jq '.title') from $(_jq '.url')"
curl -S --fail -u "$CONFLUENCE_USERNAME:$CONFLUENCE_PASSWORD" -X DELETE "${CONFLUENCE_URL}rest/api/content/$(_jq '.content.id')"
done
Hello, is there an ETA or plan to resolve this issue? I believe is important as it leaves sanitizing the Confluence space as a manual labor in case you want to move pages around.
I'm not providing any ETA for any features, if it's an important feature and you'd like to see it as part of mark, you can create a pull request with a feature implementation. I'll be glad to merge it and release a new version with it.