Skip to content

Conversation

@AntoineVDV
Copy link
Collaborator

@AntoineVDV AntoineVDV commented May 17, 2022

Since #903, the guideline for the location of new
resource (images, downloadable files, RST includes...) files is to place
those inside the directory of the RST page that references them.

For example, if doc1.rst has a reference to image.png and to
download.zip, the file structure should look like this:

├── parent_doc/
│ └── doc1/
│ │ └── image.png
│ │ └── download.zip
│ └── doc1.rst
│ └── doc2.rst
├── parent_doc.rst

Before this commit, most of the resource files were still located inside
'media' directories holding all the resource files referenced by RST
pages located at the same level as these directories. In the example
above, a single 'media' directory would hold all the resource files
referenced by both doc1.rst and doc2.rst. Doing so prevented us from
figuring out easily which resource file was referenced by which RST page
and, thus, lead to unused resource files piling up in the repository. It
also made it more complicated to define codeowners regex rules because a
team could not simply be assigned to /some_page.* but needed to be
assigned to both /some_page\.rst and to the location of 'media'.

In order to help new content writers figure out the guideline when
taking examples from other RST pages, this commit retroactively applies
the guideline to existing resource files and 'media' directories. The
left-over resource files that are not referenced by any RST page are
removed.

task-2497965

@robodoo
Copy link
Collaborator

robodoo commented May 17, 2022

@AntoineVDV AntoineVDV force-pushed the 13.0-rearrange_media_directories-anv branch 5 times, most recently from be3d81f to 171a4f0 Compare May 17, 2022 16:58
Since #903, the guideline for the location of new
resource (images, downloadable files, RST includes...) files is to place
those inside the directory of the RST page that references them.

For example, if `doc1.rst` has a reference to `image.png` and to
`download.zip`, the file structure should look like this:

├── parent_doc/
│     └── doc1/
│     │     └── image.png
│     │     └── download.zip
│     └── doc1.rst
│     └── doc2.rst
├── parent_doc.rst

Before this commit, most of the resource files were still located inside
'media' directories holding all the resource files referenced by RST
pages located at the same level as these directories. In the example
above, a single 'media' directory would hold all the resource files
referenced by both `doc1.rst` and `doc2.rst`. Doing so prevented us from
figuring out easily which resource file was referenced by which RST page
and, thus, lead to unused resource files piling up in the repository. It
also made it more complicated to define codeowners regex rules because a
team could not simply be assigned to `/some_page.*` but needed to be
assigned to both `/some_page\.rst` and to the location of 'media'.

In order to help new content writers figure out the guideline when
taking examples from other RST pages, this commit retroactively applies
the guideline to existing resource files and 'media' directories. The
left-over resource files that are not referenced by any RST page are
removed.

task-2497965
@AntoineVDV AntoineVDV force-pushed the 13.0-rearrange_media_directories-anv branch from 171a4f0 to 7023015 Compare May 18, 2022 07:54
@AntoineVDV AntoineVDV marked this pull request as ready for review May 18, 2022 08:17
@C3POdoo C3POdoo requested review from a team May 18, 2022 08:22
@AntoineVDV AntoineVDV removed the request for review from a team May 18, 2022 08:25
@LoredanaLrpz LoredanaLrpz removed the request for review from a team May 18, 2022 10:54
@jcs-odoo jcs-odoo removed request for a team May 18, 2022 12:14
Copy link
Contributor

@jcs-odoo jcs-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AntoineVDV !

Since this PR is to adapt the media filenames according to the guidelines, may I suggest...

  • replace underscores with hyphens
  • remove the common prefixes in the filenames that still had a numbering instead of meaningful names (example_doc01.png --> 01.png, maybe? Not too sure, and it doesn't matter that much tbh)

@AntoineVDV
Copy link
Collaborator Author

AntoineVDV commented May 18, 2022

That would fall quite out of the scope of this task and would require several changes in the script that allowed to generate this diff... I leave that to content writers 😅

@jcs-odoo
Copy link
Contributor

That would fall quite out of the scope of this task and would require several changes in the script that allowed to generate this diff... I leave that to content writers 😅

No problem. Thanks already for this colossal work.
I'd say: merge it asap so we can limit the number of branches that will be in conflict ^^

Good training to learn how to fix conflicts 😈

@AntoineVDV
Copy link
Collaborator Author

@robodoo r+

robodoo pushed a commit that referenced this pull request May 19, 2022
Since #903, the guideline for the location of new
resource (images, downloadable files, RST includes...) files is to place
those inside the directory of the RST page that references them.

For example, if `doc1.rst` has a reference to `image.png` and to
`download.zip`, the file structure should look like this:

├── parent_doc/
│     └── doc1/
│     │     └── image.png
│     │     └── download.zip
│     └── doc1.rst
│     └── doc2.rst
├── parent_doc.rst

Before this commit, most of the resource files were still located inside
'media' directories holding all the resource files referenced by RST
pages located at the same level as these directories. In the example
above, a single 'media' directory would hold all the resource files
referenced by both `doc1.rst` and `doc2.rst`. Doing so prevented us from
figuring out easily which resource file was referenced by which RST page
and, thus, lead to unused resource files piling up in the repository. It
also made it more complicated to define codeowners regex rules because a
team could not simply be assigned to `/some_page.*` but needed to be
assigned to both `/some_page\.rst` and to the location of 'media'.

In order to help new content writers figure out the guideline when
taking examples from other RST pages, this commit retroactively applies
the guideline to existing resource files and 'media' directories. The
left-over resource files that are not referenced by any RST page are
removed.

task-2497965

closes #2006

Signed-off-by: Antoine Vandevenne (anv) <[email protected]>
@AntoineVDV
Copy link
Collaborator Author

@fw-bot ignore

@fw-bot
Copy link
Collaborator

fw-bot commented May 19, 2022

Forward-port disabled.

@robodoo robodoo closed this May 19, 2022
@robodoo robodoo temporarily deployed to merge May 19, 2022 10:40 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants