@@ -334,85 +334,6 @@ Documentation:
334
334
[djangotemplates]: https://docs.djangoproject.com/en/4.2/topics/templates/
335
335
336
336
337
- ## Importing the existing legal tool text
338
-
339
- > :warning: **This section should no longer be required and will eventually be
340
- > moved to a better location.**
341
-
342
- Note that once the site is up and running in production, the data in the site
343
- will become the canonical source, and the process described here should not
344
- need to be repeated after that.
345
-
346
- The implementation is the Django management command `load_html_files`, which
347
- reads from the legacy HTML legal code files in the
348
- [creativecommons/cc-legal-tools-data][repodata] repository, and populates the
349
- database records and translation files.
350
-
351
- `load_html_files` uses [BeautifulSoup4][bs4docs] to parse the legacy HTML legal
352
- code:
353
- 1. `import_zero_license_html()` for CC0 Public Domain tool
354
- - HTML is handled specifically (using tag ids and classes) to populate
355
- translation strings and to be used with specific HTML formatting when
356
- displayed via template
357
- 2. `import_by_40_license_html()` for 4.0 License tools
358
- - HTML is handled specifically (using tag ids and classes) to populate
359
- translation strings and to be used with specific HTML formatting when
360
- displayed via a template
361
- 3. `import_by_30_unported_license_html()` for unported 3.0 License tools
362
- (English-only)
363
- - HTML is handled specifically to be used with specific HTML formatting
364
- when displayed via a template
365
- 4. `simple_import_license_html()` for everything else
366
- - HTML is handled generically; only the title and license body are
367
- identified. The body is stored in the `html` field of the
368
- `LegalCode` model
369
-
370
- [bs4docs]: https://www.crummy.com/software/BeautifulSoup/bs4/doc/
371
- [repodata]: https://github.com/creativecommons/cc-legal-tools-data
372
-
373
-
374
- ### Import Process
375
-
376
- > :warning: **This section should no longer be required and will eventually be
377
- > moved to a better location.**
378
-
379
- This process will read the HTML files from the specified directory, populate
380
- `LegalCode` and `Tool` models, and create the `.po` portable object Gettext
381
- files in [creativecommons/cc-legal-tools-data][repodata].
382
-
383
- 1. Ensure the [Data Repository](#data-repository), above, is in place
384
- 2. Ensure [Docker Compose Setup](#docker-compose-setup), above, is complete
385
- 3. Clear data in the database
386
- ```shell
387
- docker compose exec app ./manage.py clear_license_data
388
- ```
389
- 4. Load legacy HTML in the database
390
- ```shell
391
- docker compose exec app ./manage.py load_html_files
392
- ```
393
- 5. Optionally (and only as appropriate):
394
- 1. Commit the `.po` portable object Gettext file changes in
395
- [creativecommons/cc-legal-tools-data][repodata]
396
- 2. [Translation Update Process](#translation-update-process), below
397
- 3. [Generate Static Files](#generate-static-files), below
398
-
399
- [repodata]:https://github.com/creativecommons/cc-legal-tools-data
400
-
401
-
402
- ### Import Dependency Documentation
403
-
404
- > :warning: **This section should no longer be required and will eventually be
405
- > moved to a better location.**
406
-
407
- - [Beautiful Soup Documentation — Beautiful Soup 4 documentation][bs4docs]
408
- - [lxml - Processing XML and HTML with Python][lxml]
409
- - [Quick start guide — polib documentation][polibdocs]
410
-
411
- [bs4docs]: https://www.crummy.com/software/BeautifulSoup/bs4/doc/
412
- [lxml]: https://lxml.de/
413
- [polibdocs]: https://polib.readthedocs.io/en/latest/quickstart.html
414
-
415
-
416
337
## Translation
417
338
418
339
To upload/download translation files to/from Transifex, you' ll need an account
0 commit comments