Skip to content

Commit

Permalink
Merge pull request #46 from gradle/pdf
Browse files Browse the repository at this point in the history
Add Gradle Cookbook PDF generator
  • Loading branch information
oleg-nenashev authored Jun 13, 2024
2 parents efe7197 + 3bdbad1 commit 3d5cada
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM python:3.10.4-slim-buster

RUN apt-get update
RUN apt-get install -y libsass-dev build-essential libcairo2 git

RUN apt-get install -y libsass-dev build-essential libcairo2 git libpango-1.0-0 libpangoft2-1.0-0 pangocairo-1.0
6 changes: 5 additions & 1 deletion .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ mkdocs-material[imaging]==9.5.17
mkdocs-multirepo-plugin==0.6.3
mkdocs-redirects==1.2.1
mkdocs-extra-sass-plugin==0.1.0
mkdocs-render-swagger-plugin===0.1.1
mkdocs-render-swagger-plugin==0.1.1
mkdocs-pdf==0.1.1
mkdocs-with-pdf==0.9.3
livereload==2.6.3
lxml==4.9.3
click==8.1.7
Expand All @@ -23,10 +24,13 @@ pathspec==0.11.2
platformdirs==3.11.0
python-dateutil==2.8.2
python-slugify==8.0.1
pypng==0.20220715.0
pyyaml==6.0.1
pyyaml-env-tag==0.1
qrcode==7.4.2
six==1.16.0
text-unidecode==1.3
typing-extensions==4.8.0
typing-inspect==0.8.0
watchdog==3.0.0
weasyprint==52.5
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish the Release
on:
release:
types: [published]

permissions:
contents: write

jobs:
cookbook-pdf:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "true"

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: pip install -r .devcontainer/requirements.txt

- name: Build the docs and the PDF
run: BUILD_PDF=1 mkdocs build

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: _site/pdf/cookbook.pdf
asset_name: cookbook.pdf
asset_content_type: application/pdf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ temp_dir
/.idea/misc.xml
/.idea/modules.xml
/.idea/vcs.xml

.DS_Store
4 changes: 4 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ you can run the `build` and the `serve` commands with the `FULL_BUILD=false` var
FULL_BUILD=false mkdocs serve
```

### Building the Cookbook PDF

Run `BUILD_PDF=1 mkdocs build` to generate the PDF file in [_site/pdf/cookbook.pdf](./../_site/pdf/cookbook.pdf).

## CI/CD

This site is built and deployed by GitHub Actions.
Expand Down
11 changes: 10 additions & 1 deletion docs/cookbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CI/CD tools, IDEs,
support for languages and frameworks,
and various peripheral tools.

In this document, _Gradle Build Tool_ is abbreviated _Gradle_.
In the Gradle Cookbook, _Gradle Build Tool_ is abbreviated _Gradle_.

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

## Trademark Notice

Gradle and the Gradlephant logo (the "Gradle Marks") are registered trademarks of Gradle, Inc. and/or its subsidiaries.
Use of the Gradle Marks the Gradle Cookbook pages is for identification purposes only and does not imply sponsorship or endorsement by Gradle, Inc.
In the Gradle Cookbook, "Gradle" typically means "Gradle Build Tool" and does not reference Gradle Inc. and/or its subsidiaries.

See the [Gradle Branding Guidelines](https://gradle.com/brand/) for more information about
trademark usage and the approval process.

## References

- [Gradle User Manual](https://docs.gradle.org/current/userguide/userguide.html)
Expand Down
33 changes: 28 additions & 5 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
site_name: Gradle Community Site
site_author: Gradle Contributors
site_description: >-
This is an open-source site for all Gradle community matters,
including governance, artwork, events, and public infrastructure.
copyright: >
For content - Copyright © 2024 - All contributors to the repository and included components.
Copyright © 2024 - All contributors to the repository and included components.
The original content licenses and copyrights from the included repositories are preserved,
you can find them in the linked repositories.
The GRADLE trademark is the property of Gradle, Inc.
Use of the term GRADLE on this website and any content and/or materials available through this website is
for identification purposes only and does not imply sponsorship or endorsement by Gradle, Inc.
Gradle and the Gradlephant logo (the "Gradle Marks") are registered trademarks of Gradle, Inc. and/or its subsidiaries.
Use of the Gradle Marks the Gradle Cookbook pages is for identification purposes only and does not imply sponsorship or endorsement by Gradle, Inc.
In the Gradle Cookbook, "Gradle" typically means "Gradle Build Tool" and does not reference Gradle Inc. and/or its subsidiaries.
docs_dir: docs
repo_url: https://github.com/gradle/community
repo_name: Gradle Community repo
Expand Down Expand Up @@ -84,7 +85,7 @@ extra:
social:
- icon: fontawesome/brands/slack
link: https://gradle.org/slack-invite
name: Slack
name: Slack
- icon: fontawesome/brands/github
link: https://github.com/gradle
name: GitHub
Expand Down Expand Up @@ -180,6 +181,28 @@ plugins:
import_url: 'https://github.com/gradle/actions?branch=main&edit_uri=/blob/main/'
imports: [ "README.md", "*" ]

- with-pdf:
enabled_if_env: BUILD_PDF
output_path: pdf/cookbook.pdf
author: Gradle Contributors
# FIXME: Needs rendering style to include the trademark notice & Co into the header
copyright: >
Copyright © 2024 - All contributors to the repository and included components.
cover: true
cover_title: The Gradle Cookbook
cover_subtitle: Open Source Recipes for Gradle Build Tool
cover_logo: https://gradle.com/wp-content/themes/fuel/assets/img/branding/gradle-elephant-icon-gradient.svg
back_cover: true
toc_title: Table of Contents
toc_level: 3
show_anchors: true
exclude_pages:
- ^$
- 'CONTRIBUTING'
- 'events/'
- 'contributing/'
- 'projects/'

- redirects:
redirect_maps:

Expand Down

0 comments on commit 3d5cada

Please sign in to comment.