mkdocs-with-pdf icon indicating copy to clipboard operation
mkdocs-with-pdf copied to clipboard

How to exclude pages

Open capono opened this issue 5 years ago • 3 comments

First of all, thank you very much for the plugin, it's fantastic.

I'm not sure if I did it right, I was not able to exclude pages from the pdf as described in the documentation. Also in the sample pdf it seems that it did not work?

How to use "excludes_children:" correctly?

capono avatar Jul 20 '20 12:07 capono

excludes_children: option only affects Heading and TOC. This option is used when the TOC is too large due to many h2, h3 content, such as "mkdocs-material v4 docs".

I added a new exclude_pages: option. Try this out.

orzih avatar Jul 24 '20 07:07 orzih

Hi, sorry for the late answer, I was on vocation and could not try it yet.

I think excluding pages feature could be very useful.

Thanks for adding this.

I tried it myself, but it didn't quite work out, do you have a concrete example, perhaps based on the material design?

capono avatar Aug 11 '20 10:08 capono

  1. enables verbose mode.

    - with-pdf:
        verbose: true
    
  2. run build and check log

    $ mkdocs build
    INFO    -  Cleaning site directory 
    INFO    -  Building documentation to directory: ...
    DEBUG   -  theme: <module 'mkdocs_with_pdf.themes.material' from ...> 
    DEBUG   -   (post: [Welcome]() 
    DEBUG   -   (post: [TEST1](test/) 
    DEBUG   -   (post: [TEST2](test2/) 
    DEBUG   -   (post: [path1/1/index](path1/1/) 
    DEBUG   -   (post: [path1/1/content](path1/1/content/) 
    DEBUG   -   (post: [Index](path2/) 
        ...
    
  3. edit exclude_pages: option. eg:

    - with-pdf:
        verbose: true
        exclude_pages:
            - test2/
    
  4. run build again, it will be shown INFO - Page skipped: lines.

    $ mkdocs build
    INFO    -  Cleaning site directory 
    INFO    -  Building documentation to directory: ...
    DEBUG   -  theme: <module 'mkdocs_with_pdf.themes.material' from ...> 
    DEBUG   -   (post: [Welcome]() 
    DEBUG   -   (post: [TEST1](test/) 
    INFO    -  Page skipped: [TEST2](test2/) 
    DEBUG   -   (post: [path1/1/index](path1/1/) 
    DEBUG   -   (post: [path1/1/content](path1/1/content/) 
    DEBUG   -   (post: [Index](path2/) 
        ...
    

orzih avatar Aug 20 '20 10:08 orzih