orzih / mkdocs-with-pdf

Generate a single PDF file from MkDocs repository.
MIT License
325 stars 76 forks source link

Exclude a single page? #69

Closed jimlyas closed 3 years ago

jimlyas commented 3 years ago

How to exclude a single page?

For example, i have a landing page in my docs folder with directory docs/index.md.

And i want to exlude that in my generated PDF? How to do that?

The sample only show us how to exclude folder.

Thanks in advance @orzih

orzih commented 3 years ago

Hi @jimlyas.

Try it with a regular expression pattern: e.g.

jimlyas commented 3 years ago

Still not working: image the landing page still included in the pdf file

my configuration:

with-pdf:
      cover: true
      back_cover: true
      cover_subtitle: A guideline for developing Android Application in Telkom DEV
      cover_logo: assets/icon/512.png
      toc_level: 3
      exclude_pages:
        - 'javadocs/'
        - 'snippets/'
        - '^index.html$'
      output_path: guideline.pdf
orzih commented 3 years ago

Please check use_directory_urls option.

use_directory_urls: true

plugins:
  - with-pdf:
      exclude_pages:
        - ^$
use_directory_urls: false

plugins:
  - with-pdf:
      exclude_pages:
        - ^index.html$
jimlyas commented 3 years ago

It works, wow.

should add it the documentation, thanks btw