Skip to content

Commit

Permalink
Merge pull request #1593 from EnterpriseDB/release/2021-07-22
Browse files Browse the repository at this point in the history
Release: 2021-07-22
Former-commit-id: 48cdaba
  • Loading branch information
josh-heyer authored Jul 23, 2021
2 parents aaf7121 + 7d436e2 commit 478603f
Show file tree
Hide file tree
Showing 58 changed files with 716 additions and 205 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ yarn-error.log
__pycache__

# Project specific
.project
advocacy_docs/kubernetes/cloud_native_postgresql/*.md.in
dev-sources.json
product_docs/content/
product_docs/content_build/
static/nginx_redirects.generated
temp_kubernetes/
advocacy_docs/kubernetes/cloud_native_postgresql/*.md.in
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
minversion = 6.0
testpaths =
scripts
3 changes: 3 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pdftotext
pip-tools
pytest
38 changes: 38 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile
#
attrs==21.2.0
# via pytest
click==8.0.1
# via pip-tools
iniconfig==1.1.1
# via pytest
packaging==21.0
# via pytest
pdftotext==2.1.6
# via -r requirements.in
pep517==0.11.0
# via pip-tools
pip-tools==6.2.0
# via -r requirements.in
pluggy==0.13.1
# via pytest
py==1.10.0
# via pytest
pyparsing==2.4.7
# via packaging
pytest==6.2.4
# via -r requirements.in
toml==0.10.2
# via pytest
tomli==1.0.4
# via pep517
wheel==0.36.2
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
Empty file added scripts/pdf/__init__.py
Empty file.
Empty file.
Empty file.
29 changes: 29 additions & 0 deletions scripts/pdf/__tests__/combine_mdx/expected.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
1          Title for 1.mdx
---

1.mdx content

## Heading 1

### Heading 2

### Heading 3

#### Heading 4


---
2          Title for 2.mdx
---

2.mdx content

## Heading 1

### Heading 2

### Heading 3

#### Heading 4

37 changes: 37 additions & 0 deletions scripts/pdf/__tests__/combine_mdx/src/1.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
Something to be ignored
title: Title for 1.mdx
Some other thing to be ignored
---

1.mdx content

# Heading 1

## Heading 2

### Heading 3

#### Heading 4

<div class="toctree">
introduction alter_directory alter_index alter_procedure alter_profile
alter_queue alter_queue_table alter_role_identified_by
alter_role_managing_database_link_and_dbms_rls_privileges alter_sequence
alter_session alter_table alter_trigger alter_tablespace
alter_user_identified_by alter_user_role_profile_management_clauses call
comment commit create_database create_public_database_link create_directory
create_function create_index create_materialized_view create_package
create_package_body create_procedure create_profile create_queue
create_queue_table create_role create_schema create_sequence create_synonym
create_table create_table_as create_trigger create_type create_type_body
create_user create_user_role_profile_management_clauses create_view delete
drop_public_database_link drop_directory drop_function drop_index drop_package
drop_procedure drop_profile drop_queue drop_queue_table drop_synonym drop_role
drop_sequence drop_table drop_tablespace drop_trigger drop_type drop_user
drop_view exec grant insert lock revoke rollback rollback_to_savepoint
savepoint select set_constraints set_role set_transaction truncate update
conclusion
</div>

This is ignored as well.
15 changes: 15 additions & 0 deletions scripts/pdf/__tests__/combine_mdx/src/2.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
Something to be ignored
title: Title for 2.mdx
Some other thing to be ignored
---

2.mdx content

# Heading 1

## Heading 2

### Heading 3

#### Heading 4
15 changes: 15 additions & 0 deletions scripts/pdf/__tests__/combine_mdx/test_generate_pdf_combin_mdx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from io import StringIO
from pathlib import Path

from ...generate_pdf import TocItem, combine_mdx

base = Path(__file__).parent


def test_combine_mdx():
src = base / "src"
files = [TocItem(p, [i]) for i, p in enumerate((src).glob("**/*.mdx"), start=1)]
output = StringIO()
resource_search_paths = combine_mdx(files, output)
assert output.getvalue() == (base / "expected.mdx").read_text()
assert resource_search_paths == {src}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from pathlib import Path

from .....generate_pdf import TocItem

expected = [
TocItem(filename=Path(__file__).parent / "1/index.mdx", chapter=[1]),
TocItem(filename=Path(__file__).parent / "1/1.1.mdx", chapter=[1, 1]),
TocItem(filename=Path(__file__).parent / "1/1.2/index.mdx", chapter=[1, 2]),
TocItem(filename=Path(__file__).parent / "1/1.2/1.2.1.mdx", chapter=[1, 2, 1]),
TocItem(filename=Path(__file__).parent / "2/index.mdx", chapter=[2]),
TocItem(filename=Path(__file__).parent / "2/2.1.mdx", chapter=[2, 1]),
TocItem(filename=Path(__file__).parent / "3.mdx", chapter=[3]),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: 'Title'
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from pathlib import Path

from .....generate_pdf import TocItem

expected = [
TocItem(filename=Path(__file__).parent / "1.mdx", chapter=[1]),
TocItem(filename=Path(__file__).parent / "2/index.mdx", chapter=[2]),
TocItem(filename=Path(__file__).parent / "2/2.1.mdx", chapter=[2, 1]),
TocItem(filename=Path(__file__).parent / "3.mdx", chapter=[3]),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: 'Title'
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: 'Title'
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from pathlib import Path

from .....generate_pdf import TocItem

expected = [
TocItem(filename=Path(__file__).parent / "index.mdx", chapter=[1]),
TocItem(filename=Path(__file__).parent / "1/0.mdx", chapter=[2]),
TocItem(filename=Path(__file__).parent / "1/1.1.mdx", chapter=[2, 1]),
TocItem(filename=Path(__file__).parent / "1/1.2.mdx", chapter=[2, 2]),
TocItem(filename=Path(__file__).parent / "2.mdx", chapter=[3]),
TocItem(filename=Path(__file__).parent / "3/index.mdx", chapter=[4]),
TocItem(filename=Path(__file__).parent / "3/3.1.mdx", chapter=[4, 1]),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
expected = []
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: 'Title'
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pathlib import Path

from .....generate_pdf import TocItem

expected = [
TocItem(filename=Path(__file__).parent / "index.mdx", chapter=[1]),
TocItem(filename=Path(__file__).parent / "1.mdx", chapter=[2]),
TocItem(filename=Path(__file__).parent / "2/index.mdx", chapter=[3]),
TocItem(filename=Path(__file__).parent / "2/2.1.mdx", chapter=[3, 1]),
TocItem(filename=Path(__file__).parent / "3.mdx", chapter=[4]),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Title'
---

# Title
Loading

0 comments on commit 478603f

Please sign in to comment.