Skip to content

Commit

Permalink
chore: drop pdf using wkhtmltopdf
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih committed Dec 20, 2023
1 parent 6cb29c4 commit eff2e0d
Show file tree
Hide file tree
Showing 61 changed files with 1 addition and 4,213 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
shell: bash
working-directory: templates

- run: choco install wkhtmltopdf
if: matrix.os == 'windows-latest'

- run: dotnet test -c Release -f net8.0 --no-build --collect:"XPlat Code Coverage"

- run: dotnet test -c Release -f net7.0 --no-build --collect:"XPlat Code Coverage"
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ We welcome code contributions through pull requests, issues tagged as **[`help-w
- Install [Visual Studio 2022 (Community or higher)](https://www.visualstudio.com/) and make sure you have the latest updates.
- Install [.NET SDK](https://dotnet.microsoft.com/download/dotnet) 6.x, 7.x and 8.x.
- Install NodeJS (18.x.x).
- Optional: Install wkhtmltopdf on Windows to test PDF using `choco install wkhtmltopdf`.

### Build and Test

Expand Down
15 changes: 0 additions & 15 deletions docfx.sln
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Docfx.Build.ManagedReferenc
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Docfx.Build.UniversalReference.Tests", "test\Docfx.Build.UniversalReference.Tests\Docfx.Build.UniversalReference.Tests.csproj", "{E9795C9A-1F98-4716-A0FC-843C6B000BE5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Docfx.HtmlToPdf", "src\Docfx.HtmlToPdf\Docfx.HtmlToPdf.csproj", "{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Docfx.Tests.Common", "test\Docfx.Tests.Common\Docfx.Tests.Common.csproj", "{1D2D316B-4C70-4410-817A-DEDB5B0072A5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Docfx.Build.RestApi.WithPlugins.Tests", "test\Docfx.Build.RestApi.WithPlugins.Tests\Docfx.Build.RestApi.WithPlugins.Tests.csproj", "{63266510-C4BF-44E0-AF76-B01BA47019B2}"
Expand Down Expand Up @@ -325,18 +323,6 @@ Global
{E9795C9A-1F98-4716-A0FC-843C6B000BE5}.Release|x64.Build.0 = Release|Any CPU
{E9795C9A-1F98-4716-A0FC-843C6B000BE5}.Release|x86.ActiveCfg = Release|Any CPU
{E9795C9A-1F98-4716-A0FC-843C6B000BE5}.Release|x86.Build.0 = Release|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Debug|x64.ActiveCfg = Debug|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Debug|x64.Build.0 = Debug|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Debug|x86.ActiveCfg = Debug|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Debug|x86.Build.0 = Debug|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Release|Any CPU.Build.0 = Release|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Release|x64.ActiveCfg = Release|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Release|x64.Build.0 = Release|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Release|x86.ActiveCfg = Release|Any CPU
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72}.Release|x86.Build.0 = Release|Any CPU
{1D2D316B-4C70-4410-817A-DEDB5B0072A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D2D316B-4C70-4410-817A-DEDB5B0072A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D2D316B-4C70-4410-817A-DEDB5B0072A5}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -590,7 +576,6 @@ Global
{A95C5BAE-1D0D-44FD-A984-7CBF055A62E2} = {926A0726-B806-4215-82EF-AF8E22D0FACF}
{958DF90F-0528-4C50-9AC2-E86C60971B7D} = {49A27FCE-C434-4318-8EEC-1E4CDC192778}
{E9795C9A-1F98-4716-A0FC-843C6B000BE5} = {49A27FCE-C434-4318-8EEC-1E4CDC192778}
{FF8D61D0-01C9-44B9-98F9-37FCBF20CD72} = {6A65A769-DAC3-4E99-96F9-991F4CE8D164}
{1D2D316B-4C70-4410-817A-DEDB5B0072A5} = {926A0726-B806-4215-82EF-AF8E22D0FACF}
{63266510-C4BF-44E0-AF76-B01BA47019B2} = {49A27FCE-C434-4318-8EEC-1E4CDC192778}
{2978E4CC-7D67-43DA-B6C9-09559C530EFC} = {F922E543-9AD4-4031-8BD1-8A7AA9771D1E}
Expand Down
15 changes: 0 additions & 15 deletions docs/reference/docfx-cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,3 @@ homepage | The default content shown when no article is selected.
|-- favicon.ico
|-- logo.ico
```
### Generate PDF documentation command `docfx pdf`
**Syntax**
```
docfx pdf [<config_file_path>] [-o:<output_path>]
```
`docfx pdf` generates PDF for the files defined in config file, if config file is not specified, `docfx` tries to find and use `docfx.json` file under current folder.
> [!NOTE]
> Prerequisite: We leverage [wkhtmltopdf](https://wkhtmltopdf.org/) to generate PDF. [Download wkhtmltopdf](https://wkhtmltopdf.org/downloads.html) and save the executable folder path to **%PATH%**. Or just install wkhtmltopdf using chocolatey: `choco install wkhtmltopdf`
Current design is that each TOC file generates a corresponding PDF file. Walk through [Walkthrough: Generate PDF Files](../tutorial/walkthrough/walkthrough_generate_pdf.md) to get start.
If `cover.md` is found in a folder, it will be rendered as the cover page.
51 changes: 1 addition & 50 deletions docs/reference/docfx-json-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Templates are used to transform YAML files generated by `docfx` to human-readabl
```

> [!NOTE]
> Docfx provides several builtin has embedded templates: `default`, `default(zh-cn)`, `pdf.default`, `statictoc` and `common`.
> Docfx provides several builtin has embedded templates: `default`, `default(zh-cn)`, `statictoc` and `common`.
> Please avoid using these as template folder name.
### `theme`
Expand Down Expand Up @@ -387,55 +387,6 @@ Specifies whether private or internal APIs are included in the generated docs. T

Specifies whether explicit interface implementations are included in the generated docs. The default value is `false`.

## `pdf`

Configuration options that are applied for `docfx pdf` command:

### `name`

Specifies the prefix of the generated PDF files, e.g. PDF generated from `testproject\toc.yml` is named as `{name}.pdf`, `testproject\api\toc.yml` is named as `{name}_api.pdf`. If not specified, the value of `name` is the folder name `testproject`.

### `generatesAppendices`

If specified, an `appendices.pdf` file is generated containing all the not-in-TOC articles.

### `keepRawFiles`

If specified, the intermediate html files used to generate the PDF are not deleted after the PDF has been generated.

### `wkhtmltopdf`

Contains additional options specific to wkhtmltopdf which is used internally to generate the PDF files.

### `filePath`

The path and file name of a wkhtmltopdf.exe compatible executable.

### `additionalArguments`

Additional arguments that should be passed to the wkhtmltopdf executable. For example, pass `--enable-local-file-access` if you are building on a local file system. This will ensure that the supporting *.js and *.css files are loaded when rendering the HTML being converted to PDF.

### `coverTitle`

The name of the bookmark to use for the cover page. If omitted, "Cover Page" will be used.

### `tocTitle`

The name of the bookmark to use for the "Table of Contents". If omitted, "Table of Contents" will be used.

### `outline`

The type of outline to use. Valid values are `NoOutline`, `DefaultOutline`, `WkDefaultOutline`. If not specified, the default value is `DefaultOutline`. If `WkDefaultOutline` is specified, `--outline` is passed to wkhtmltopdf; otherwise `--no-outline` is passed to wkhtmltopdf.

### `noStdin`

Do not use `--read-args-from-stdin` for the wkhtmltopdf. Html input file names are set using the command line. It has been introduced to use in the Azure pipeline build. Can cause maximum allowed arguments length overflow if too many input parts (like Appendices, TocTitle, CoverPageTitle) were set for certain html source file.

### `excludeDefaultToc`

If true, excludes the table of contents (generated by DocFX) in the PDF file.


## File Mappings

In the short-hand form, these filenames are resolved relative to the directory containing the `docfx.json` file:
Expand Down
2 changes: 0 additions & 2 deletions src/Docfx.App/Config/DocfxConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ class DocfxConfig

public BuildJsonConfig? build { get; init; }

public PdfJsonConfig? pdf { get; init; }

public Dictionary<string, LogLevel>? rules { get; init; }
}
137 changes: 0 additions & 137 deletions src/Docfx.App/Config/PdfJsonConfig.cs

This file was deleted.

27 changes: 0 additions & 27 deletions src/Docfx.App/Config/WkhtmltopdfJsonConfig.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/Docfx.App/Docfx.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<ProjectReference Include="..\Docfx.Build.SchemaDriven\Docfx.Build.SchemaDriven.csproj" />
<ProjectReference Include="..\Docfx.Build.UniversalReference\Docfx.Build.UniversalReference.csproj" />
<ProjectReference Include="..\Docfx.Common\Docfx.Common.csproj" />
<ProjectReference Include="..\Docfx.HtmlToPdf\Docfx.HtmlToPdf.csproj" />
<ProjectReference Include="..\Docfx.MarkdigEngine\Docfx.MarkdigEngine.csproj" />
<ProjectReference Include="..\Docfx.Plugins\Docfx.Plugins.csproj" />
<ProjectReference Include="..\Docfx.Glob\Docfx.Glob.csproj" />
Expand Down
3 changes: 0 additions & 3 deletions src/Docfx.App/Docset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ public static Task Pdf(string configPath, BuildOptions options)
{
if (config.build is not null)
await PdfBuilder.Run(config.build, configDirectory);
if (config.pdf is not null)
RunPdf.Exec(config.pdf, options, configDirectory);
});
}

Expand Down
Loading

0 comments on commit eff2e0d

Please sign in to comment.