
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Convert the DocC source for The Swift Programming Language book into a print-ready PDF document. The final document follows the DocC rendering style and retains all internal references and external links.
Preview Books | ||
Light Mode | ||
Dark Mode |
pip install swift-book-pdf
Call swift_book_pdf
without any arguments to save the resulting PDF as swift_book.pdf
in the current directory. The package defaults to the digital rendering mode in Letter paper size.
$ swift_book_pdf
[INFO]: Downloading TSPL files...
[INFO]: Creating PDF in digital (light) mode...
[INFO]: PDF saved to ./swift-book.pdf
When invoked, swift_book_pdf
will:
swift-book
repository[!NOTE] swift_book_pdf will create a temporary directory to store the swift-book repository, LaTeX file and intermediate files produced during typesetting. This temporary directory is removed after the PDF is generated.
You can specify an output path:
swift_book_pdf /path/to/output.pdf
Use the --input-path
/-i
option to specify a path to the root of a local copy of the swift-book repository. If not provided, the repository will be cloned from GitHub.
swift_book_pdf -i /path/to/swift-book/
swift_book_pdf
supports two rendering modes:
digital
(default): Best for browsing The Swift Programming Language book as a PDF, the digital
mode renders internal references and external links in blue hyperlinks.print
: Best for reading through The Swift Programming Language book in print, the print
mode includes page numbers for all internal references and complete URLs in footnotes for external links.Use the --mode
option to set your preferred rendering option:
swift_book_pdf /path/to/output.pdf --mode print
swift_book_pdf
supports three paper sizes:
letter
(default)legal
A4
Use the --paper
option to set your preferred paper size:
swift_book_pdf --paper legal
swift_book_pdf
renders The Swift Programming Language book in light mode by default. To render the book in dark mode, use the --dark
flag.
swift_book_pdf --dark
swift_book_pdf
renders The Swift Programming Language book with a book gutter by default. To render the book without a gutter, use the --no-gutter
flag.
swift_book_pdf --no-gutter
swift-book-pdf requires a set of fonts to typeset The Swift Programming Language book. You can use any of the available default options, or specify your own fonts. To learn more about fonts and available configuration options, see this article.
This package uses LaTeX to typeset the TSPL book. LaTeX arranges page elements dynamically, so references added in the second pass may shift the page content, and alter the placement of headers and footers. To ensure everything is properly rendered, swift_book_pdf typesets the document four times.
If needed, you can adjust the number of typesets:
swift_book_pdf /path/to/output.pdf --typesets 5
[!CAUTION] Only increase the number of typesets if the document has missing references or misaligned headers or footers.
Do not decrease the number of typesets. Given the document's complexity (650+ pages with relative anchors), the extra typesets ensure proper rendering of headers and footers.
Always run at least two typesets. Skipping this may break internal references to other sections.
At runtime, the swift-book repository is temporarily cloned for processing, but no part of the repository is directly redistributed here.
chapter-icon.png
is derived from the ArticleIcon.vue
component in the swift-docc-render repository.
The swift-book and swift-docc-render repositories are part of the Swift.org open source project, which is licensed under the Apache License v2.0 with Runtime Library Exception. See https://swift.org/LICENSE.txt for more details. The Swift project authors are credited at https://swift.org/CONTRIBUTORS.txt.
The Swift logo is a trademark of Apple Inc.
FAQs
A tool to generate a PDF version of The Swift Programming Language book.
We found that swift-book-pdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.