Skip to content

Commit 3d5cada

Browse files
Merge pull request #46 from gradle/pdf
Add Gradle Cookbook PDF generator
2 parents efe7197 + 3bdbad1 commit 3d5cada

File tree

7 files changed

+88
-9
lines changed

7 files changed

+88
-9
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM python:3.10.4-slim-buster
22

33
RUN apt-get update
4-
RUN apt-get install -y libsass-dev build-essential libcairo2 git
5-
4+
RUN apt-get install -y libsass-dev build-essential libcairo2 git libpango-1.0-0 libpangoft2-1.0-0 pangocairo-1.0

.devcontainer/requirements.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ mkdocs-material[imaging]==9.5.17
99
mkdocs-multirepo-plugin==0.6.3
1010
mkdocs-redirects==1.2.1
1111
mkdocs-extra-sass-plugin==0.1.0
12-
mkdocs-render-swagger-plugin===0.1.1
12+
mkdocs-render-swagger-plugin==0.1.1
1313
mkdocs-pdf==0.1.1
14+
mkdocs-with-pdf==0.9.3
1415
livereload==2.6.3
1516
lxml==4.9.3
1617
click==8.1.7
@@ -23,10 +24,13 @@ pathspec==0.11.2
2324
platformdirs==3.11.0
2425
python-dateutil==2.8.2
2526
python-slugify==8.0.1
27+
pypng==0.20220715.0
2628
pyyaml==6.0.1
2729
pyyaml-env-tag==0.1
30+
qrcode==7.4.2
2831
six==1.16.0
2932
text-unidecode==1.3
3033
typing-extensions==4.8.0
3134
typing-inspect==0.8.0
3235
watchdog==3.0.0
36+
weasyprint==52.5

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish the Release
2+
on:
3+
release:
4+
types: [published]
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
cookbook-pdf:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
submodules: "true"
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.10"
22+
23+
- name: Install dependencies
24+
run: pip install -r .devcontainer/requirements.txt
25+
26+
- name: Build the docs and the PDF
27+
run: BUILD_PDF=1 mkdocs build
28+
29+
- name: Upload Release Asset
30+
id: upload-release-asset
31+
uses: actions/upload-release-asset@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
upload_url: ${{ github.event.release.upload_url }}
36+
asset_path: _site/pdf/cookbook.pdf
37+
asset_name: cookbook.pdf
38+
asset_content_type: application/pdf

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ temp_dir
66
/.idea/misc.xml
77
/.idea/modules.xml
88
/.idea/vcs.xml
9+
10+
.DS_Store

docs/CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ you can run the `build` and the `serve` commands with the `FULL_BUILD=false` var
8787
FULL_BUILD=false mkdocs serve
8888
```
8989

90+
### Building the Cookbook PDF
91+
92+
Run `BUILD_PDF=1 mkdocs build` to generate the PDF file in [_site/pdf/cookbook.pdf](./../_site/pdf/cookbook.pdf).
93+
9094
## CI/CD
9195

9296
This site is built and deployed by GitHub Actions.

docs/cookbook/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CI/CD tools, IDEs,
1414
support for languages and frameworks,
1515
and various peripheral tools.
1616

17-
In this document, _Gradle Build Tool_ is abbreviated _Gradle_.
17+
In the Gradle Cookbook, _Gradle Build Tool_ is abbreviated _Gradle_.
1818

1919
!!! note
2020
The Gradle Cookbook is under active development (see the roadmap item [here](https://github.com/gradle/community/issues/42)).
@@ -55,6 +55,15 @@ You can extend the Cookbook by adding new recipes, updating the existing ones,
5555
or even creating whole new sections.
5656
Check out the [Contributor Guide](./CONTRIBUTING.md) for more information.
5757

58+
## Trademark Notice
59+
60+
Gradle and the Gradlephant logo (the "Gradle Marks") are registered trademarks of Gradle, Inc. and/or its subsidiaries.
61+
Use of the Gradle Marks the Gradle Cookbook pages is for identification purposes only and does not imply sponsorship or endorsement by Gradle, Inc.
62+
In the Gradle Cookbook, "Gradle" typically means "Gradle Build Tool" and does not reference Gradle Inc. and/or its subsidiaries.
63+
64+
See the [Gradle Branding Guidelines](https://gradle.com/brand/) for more information about
65+
trademark usage and the approval process.
66+
5867
## References
5968

6069
- [Gradle User Manual](https://docs.gradle.org/current/userguide/userguide.html)

mkdocs.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
site_name: Gradle Community Site
2+
site_author: Gradle Contributors
23
site_description: >-
34
This is an open-source site for all Gradle community matters,
45
including governance, artwork, events, and public infrastructure.
56
copyright: >
6-
For content - Copyright © 2024 - All contributors to the repository and included components.
7+
Copyright © 2024 - All contributors to the repository and included components.
78
The original content licenses and copyrights from the included repositories are preserved,
89
you can find them in the linked repositories.
910
10-
The GRADLE trademark is the property of Gradle, Inc.
11-
Use of the term GRADLE on this website and any content and/or materials available through this website is
12-
for identification purposes only and does not imply sponsorship or endorsement by Gradle, Inc.
11+
Gradle and the Gradlephant logo (the "Gradle Marks") are registered trademarks of Gradle, Inc. and/or its subsidiaries.
12+
Use of the Gradle Marks the Gradle Cookbook pages is for identification purposes only and does not imply sponsorship or endorsement by Gradle, Inc.
13+
In the Gradle Cookbook, "Gradle" typically means "Gradle Build Tool" and does not reference Gradle Inc. and/or its subsidiaries.
1314
docs_dir: docs
1415
repo_url: https://github.com/gradle/community
1516
repo_name: Gradle Community repo
@@ -84,7 +85,7 @@ extra:
8485
social:
8586
- icon: fontawesome/brands/slack
8687
link: https://gradle.org/slack-invite
87-
name: Slack
88+
name: Slack
8889
- icon: fontawesome/brands/github
8990
link: https://github.com/gradle
9091
name: GitHub
@@ -180,6 +181,28 @@ plugins:
180181
import_url: 'https://github.com/gradle/actions?branch=main&edit_uri=/blob/main/'
181182
imports: [ "README.md", "*" ]
182183

184+
- with-pdf:
185+
enabled_if_env: BUILD_PDF
186+
output_path: pdf/cookbook.pdf
187+
author: Gradle Contributors
188+
# FIXME: Needs rendering style to include the trademark notice & Co into the header
189+
copyright: >
190+
Copyright © 2024 - All contributors to the repository and included components.
191+
cover: true
192+
cover_title: The Gradle Cookbook
193+
cover_subtitle: Open Source Recipes for Gradle Build Tool
194+
cover_logo: https://gradle.com/wp-content/themes/fuel/assets/img/branding/gradle-elephant-icon-gradient.svg
195+
back_cover: true
196+
toc_title: Table of Contents
197+
toc_level: 3
198+
show_anchors: true
199+
exclude_pages:
200+
- ^$
201+
- 'CONTRIBUTING'
202+
- 'events/'
203+
- 'contributing/'
204+
- 'projects/'
205+
183206
- redirects:
184207
redirect_maps:
185208

0 commit comments

Comments
 (0)