Add utility method to skip code blocks in migrations
What does this MR do and why?
Adds a utility method to skip code blocks in migrations.
In content migrations, we only want to modify actual content, not examples of how to use different elements. Examples are are shown in code blocks and have different markup to print them literally rather than as their rendered elements.
We should just skip these because:
- Examples of the literal markup for Hugo shortcodes have slightly different markup in order for them to not render literally. Including handling for these cases would add significant complexity to our migration scripts.
- These examples will need to be manually updated regardless in order to ensure the surrounding context is still accurate. There is not a real benefit of programmatically updating these.
Screenshots, screen recordings, or links to review app
Alerts:
Before | After |
---|---|
Version history:
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md. -
Run a compile and view the site with updated content: REMOVE_BEFORE_CLONE=true make clone-docs-projects && make view
-
Verify the style guide no longer contains invalid markup/unclosed tags: http://localhost:1313/development/documentation/styleguide/#alert-boxes -
Verify alerts and version history still migrate by viewing pages with these, such as:
- Disclaimer: http://localhost:1313/user/organization/
- Flag: http://localhost:1313/ci/environments/kubernetes_dashboard/#detailed-dashboard
- Info: http://localhost:1313/ci/environments/#in-your-gitlab-ciyml-file
- Warning: http://localhost:1313/ci/cloud_services/google_cloud/
- Version history examples: http://localhost:1313/development/documentation/versions/#documenting-updates-to-a-feature
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.
Closes #73 (closed)
Edited by Sarah German