Skip to content

Commit add37b0

Browse files
committed
move deprecated load_html_import documentation to _ARCHIVED
1 parent 0579373 commit add37b0

File tree

2 files changed

+77
-79
lines changed

2 files changed

+77
-79
lines changed

README.md

-79
Original file line numberDiff line numberDiff line change
@@ -334,85 +334,6 @@ Documentation:
334334
[djangotemplates]: https://docs.djangoproject.com/en/4.2/topics/templates/
335335
336336
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-
416337
## Translation
417338
418339
To upload/download translation files to/from Transifex, you'll need an account

docs/_ARCHIVED/load_html_import.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
## Helper Scripts
2+
3+
Best run before every commit:
4+
- `./dev/20231009_concatenatemessages.sh` - Concatenate legacy ccEngine
5+
translations into cc-legal-tools-app
6+
7+
8+
## Importing the existing legal tool text
9+
10+
Note that once the site is up and running in production, the data in the site
11+
will become the canonical source, and the process described here should not
12+
need to be repeated after that.
13+
14+
The implementation is the Django management command
15+
`20231010_load_html_files.py`, which reads from the legacy HTML legal code
16+
files in the [creativecommons/cc-legal-tools-data][repodata] repository, and
17+
populates the database records and translation files.
18+
19+
`load_html_files` uses [BeautifulSoup4][bs4docs] to parse the legacy HTML legal
20+
code:
21+
1. `import_zero_license_html()` for CC0 Public Domain tool
22+
- HTML is handled specifically (using tag ids and classes) to populate
23+
translation strings and to be used with specific HTML formatting when
24+
displayed via template
25+
2. `import_by_40_license_html()` for 4.0 License tools
26+
- HTML is handled specifically (using tag ids and classes) to populate
27+
translation strings and to be used with specific HTML formatting when
28+
displayed via a template
29+
3. `import_by_30_unported_license_html()` for unported 3.0 License tools
30+
(English-only)
31+
- HTML is handled specifically to be used with specific HTML formatting
32+
when displayed via a template
33+
4. `simple_import_license_html()` for everything else
34+
- HTML is handled generically; only the title and license body are
35+
identified. The body is stored in the `html` field of the
36+
`LegalCode` model
37+
38+
[bs4docs]: https://www.crummy.com/software/BeautifulSoup/bs4/doc/
39+
[repodata]: https://github.com/creativecommons/cc-legal-tools-data
40+
41+
42+
### Import Process
43+
44+
This process will read the HTML files from the specified directory, populate
45+
`LegalCode` and `Tool` models, and create the `.po` portable object Gettext
46+
files in [creativecommons/cc-legal-tools-data][repodata].
47+
48+
1. Ensure the Data Repository (see [`../../README.md`](../../README.md) is in
49+
place
50+
2. Ensure Docker Compose Setup (see [`../../README.md`](../../README.md) is
51+
complete
52+
3. Clear data in the database
53+
```shell
54+
docker compose exec app ./manage.py clear_license_data
55+
```
56+
4. Load legacy HTML in the database
57+
```shell
58+
docker compose exec app ./manage.py load_html_files
59+
```
60+
5. Optionally (and only as appropriate):
61+
1. Commit the `.po` portable object Gettext file changes in
62+
[creativecommons/cc-legal-tools-data][repodata]
63+
2. Translation Update Process (see [`../translation.md`](../translation.md)
64+
3. Generate Static Files (see [`../../README.md`](../../README.md)
65+
66+
[repodata]:https://github.com/creativecommons/cc-legal-tools-data
67+
68+
69+
### Import Dependency Documentation
70+
71+
- [Beautiful Soup Documentation — Beautiful Soup 4 documentation][bs4docs]
72+
- [lxml - Processing XML and HTML with Python][lxml]
73+
- [Quick start guide — polib documentation][polibdocs]
74+
75+
[bs4docs]: https://www.crummy.com/software/BeautifulSoup/bs4/doc/
76+
[lxml]: https://lxml.de/
77+
[polibdocs]: https://polib.readthedocs.io/en/latest/quickstart.html

0 commit comments

Comments
 (0)