1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/docs/docsite/helper/replace_keys
patchback[bot] 3a01ceb355
[PR #8482/caecb229 backport][stable-9] Feature. Add chapter 'Lists of dictionaries' to docsite (#8582)
Feature. Add chapter 'Lists of dictionaries' to docsite (#8482)

* Feature. Add chapter 'Lists of dictionaries'

* Fix copyright and licensing.

* Add maintainers for docsite chapter 'Lists of dictionaries'.

* Generate docs keep_keys and remove_keys

* Update integration tests of keep_keys and remove_keys
* Update docs helpers of keep_keys and remove_keys

* Fix copyright and licensing.

* Fix remove license from templates. Cleanup.

* Add docs helper replace_keys

* Update integration test filter_replace_keys
* Generate and update:
  filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst

* Formatting improved.

* Fix results Jinja quotation marks.

* Update docs/docsite/helper/keep_keys/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst.j2

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update docs/docsite/helper/keep_keys/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst.j2

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fix references.

* Updated helpers.

* Fix licenses. Simplified templates.

* Fix licenses.

* Fix README.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit caecb2297f)

Co-authored-by: Vladimir Botka <vbotka@gmail.com>
2024-07-05 08:53:55 +02:00
..
filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst.j2 [PR #8482/caecb229 backport][stable-9] Feature. Add chapter 'Lists of dictionaries' to docsite (#8582) 2024-07-05 08:53:55 +02:00
playbook.yml [PR #8482/caecb229 backport][stable-9] Feature. Add chapter 'Lists of dictionaries' to docsite (#8582) 2024-07-05 08:53:55 +02:00
README.md [PR #8482/caecb229 backport][stable-9] Feature. Add chapter 'Lists of dictionaries' to docsite (#8582) 2024-07-05 08:53:55 +02:00
replace_keys.rst.sha1 [PR #8482/caecb229 backport][stable-9] Feature. Add chapter 'Lists of dictionaries' to docsite (#8582) 2024-07-05 08:53:55 +02:00
replace_keys.rst.sha1.license [PR #8482/caecb229 backport][stable-9] Feature. Add chapter 'Lists of dictionaries' to docsite (#8582) 2024-07-05 08:53:55 +02:00
tests.yml.sha1 [PR #8482/caecb229 backport][stable-9] Feature. Add chapter 'Lists of dictionaries' to docsite (#8582) 2024-07-05 08:53:55 +02:00
tests.yml.sha1.license [PR #8482/caecb229 backport][stable-9] Feature. Add chapter 'Lists of dictionaries' to docsite (#8582) 2024-07-05 08:53:55 +02:00

Docs helper. Create RST file.

The playbook playbook.yml writes a RST file that can be used in docs/docsite/rst. The usage of this helper is recommended but not mandatory. You can stop reading here and update the RST file manually if you don't want to use this helper.

Run the playbook

If you want to generate the RST file by this helper fit the variables in the playbook and the template to your needs. Then, run the play

shell> ansible-playbook playbook.yml

Copy RST to docs/docsite/rst

Copy the RST file to docs/docsite/rst and remove it from this directory.

Update the checksums

Substitute the variables and run the below commands

shell> sha1sum {{ target_vars }} > {{ target_sha1 }}
shell> sha1sum {{ file_rst }} > {{ file_sha1 }}

Playbook explained

The playbook includes the variable tests from the integration tests and creates the RST file from the template. The playbook will terminate if:

  • The file with the variable tests was changed
  • The RST file was changed

This means that this helper is probably not up to date.

The file with the variable tests was changed

This means that somebody updated the integration tests. Review the changes and update the template if needed. Update the checksum to pass the integrity test. The playbook message provides you with the command.

The RST file was changed

This means that somebody updated the RST file manually. Review the changes and update the template. Update the checksum to pass the integrity test. The playbook message provides you with the command. Make sure that the updated template will create identical RST file. Only then apply your changes.