Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to export current content (automated or manual) #160

Open
lb- opened this issue Oct 20, 2022 · 4 comments
Open

Add ability to export current content (automated or manual) #160

lb- opened this issue Oct 20, 2022 · 4 comments
Assignees
Milestone

Comments

@lb-
Copy link
Member

lb- commented Oct 20, 2022

With the removal of the versioning solution (see #62 & #143 ) we will lose the ability to have a historic record of the Guide.

This will be a reasonably but downgrade from the current RTD solution where anyone can link to the guide for any older version. This is particularly useful for those who only use the LTS versions.

It would be good to be able to provide some kind of future proofing of this loss of detail via a way to export the current site.

This way we can store these somehow and when we do add versioning back we can import this content.

Proposed solution idea 1 - nightly JSON dump to this repo

We automatically use the Django dump data feature and get the CI to commit to this repo - replacing one large JSON file each day.

This would need to be sanitized somewhat (user emails / names) but could be a quick way to resolve this.

Proposed solution idea 2 - Static html export

Similar to above but we have a manual or automatic way to export a static html build of the entire guide. This could be good for those that want to host the content locally/ offline or even remix it.

Could be extended to an epub and even markdown export in the future.

This could also save the html to the rpo. But maybe a seperate isloated branch to avoid too much noise.

This could use bakery or Wagtail freeze.

@saevarom
Copy link
Contributor

@thibaudcolas I'm guessing this is not relevant after yesterday's discussion and decisions?

@lb-
Copy link
Member Author

lb- commented Oct 20, 2022

I still think there's a case for this feature - being able to remix / reuse the content (similar to how current docs explort pdf/epub).

But as per Slack - if we will have versioning still within the CMS (via translations) - it's probably lower priority.

@saevarom
Copy link
Contributor

Yes, I agree that a historic record is very useful.

@thibaudcolas thibaudcolas added this to the Nice-to-have milestone Nov 4, 2022
@allcaps
Copy link
Member

allcaps commented Nov 7, 2022

Other reasons to provide a 'dump of the contents' are:

  • Development of this project, devs might want to work with realistic data to reproduce bugs and create additional features.
  • Self hosting, Wagtail shops might want to take the Guide (code and contents) as a starting point to provide project specific guides.
  • Backup for partial restores (by hand)

Brain dump

A management command that:

  1. Runs dumpdata to output a YYYMMDD-data.json
  2. Automatically create a Wagtail Document for that dump
  3. ZIP the relevant parts of the media folder (documents and original images).
  4. Create a Wagtail Document for the media zip

A periodic task could call this management command.
Snapshots can be presented on a download page.

Example of a dumpdata command:

./manage.py dumpdata --natural-foreign --indent 2 \
    -e contenttypes -e auth.permission -e postgres_search.indexentry \
    -e wagtailcore.groupcollectionpermission \
    -e wagtailcore.grouppagepermission -e wagtailimages.rendition \
    -e sessions > YYYMMDD-data.json

The -e excludes tables that we don't want to share. We should exclude users, comments, feedback, etc.

To load the dump./manage.py loaddata data.json and unzip the media into the correct directory.

@allcaps allcaps self-assigned this Nov 12, 2022
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

No branches or pull requests

4 participants