Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: config value 'plugins': Plugin 'exporter' option 'formats': Unrecognised configuration name: formats #32

Open
stephffuller opened this issue Jul 31, 2024 · 12 comments

Comments

@stephffuller
Copy link

stephffuller commented Jul 31, 2024

I know this is probably something stupid like a missing space somewhere, but I've spent a couple of days banging my head against this and I cannot get this plugin to generate a pdf. I believe the error in the title above might be the culprit. I copied my config file directly from the docs for the plugin, and only changed the filenames and locations for the cover page and the output file. Please have a look and tell me what I'm doing wrong.

image

@stephffuller
Copy link
Author

@adrienbrignon any thoughts? Sorry to bug, but this is blocking me. I really need this plugin to work. Many thanks in advance for any suggestions.

@adrienbrignon
Copy link
Owner

adrienbrignon commented Aug 1, 2024

Hello @stephffuller,

Do you have a repository to share in order to reproduce the issue, please?
In the meantime, I'll investigate.

Thanks,


  • What version of the plugin are you using?

@stephffuller
Copy link
Author

Sadly, our repo is private so I cannot share. But I'm willing to make any changes you suggest and send the output.
image

@stephffuller
Copy link
Author

stephffuller commented Aug 1, 2024

Also I've pared down the config to only the necessary items that I would need, to reduce variables. Same results.
image

@adrienbrignon
Copy link
Owner

Thank you for the feedback @stephffuller.
I understand, no problem.

You are using the version 5 of the plugin, which is now outdated.
I guess that you could upgrade to the latest version (6.1.1) without any issue, that should solve the problem you are facing.

@stephffuller
Copy link
Author

Ok, upgrading got me some movement on this, but alas, no pdf yet. But at least now it is actually trying to generate one! I had to add download buttons, as apparently they're required now? It wouldn't execute the mkdocs build without them.

It seems like it's having trouble with links in the docs? All the links work in the html site, and mkdocs itself doesn't report any broken links, so I'm not sure why mkdocs-exporter is giving me hundreds of these, all for different files:

image

And then it errors out with this:
image

image

Also, I love your Rick Roll on the download buttons page chef's kiss.

I'll contribute some docs improvement PRs once I get this working as appreciation for the help!

@adrienbrignon
Copy link
Owner

Nice catch about the buttons, I accidentally made that option mandatory...
As a workaround, you can define the buttons option as an empty array, until I fix this issue in the next patch release.

Regarding the errors you are facing, it seems that there is something on your pages (maybe some JavaScript?) that is blocking the rendering, hence the timeout being reached.

You can try to disable the browser's headless mode (with the browser.headless option set to false) and inspect the browser's console for logs.

@stephffuller
Copy link
Author

Ok, I may know what is happening then. We have links to video tutorials hosted on Wistia in our docs. The plugin we were trying to use for PDFs, mkdocs-print-site-plugin, had an option to ignore those sections with the videos so that the pdf didn't contain those. You can see the options here. Does mkdocs-exporter have a similar option to ignore just a section or part of a page? I didn't see one. I can do a global find/replace if one does exist and it will probably fix this issue.

@adrienbrignon
Copy link
Owner

adrienbrignon commented Aug 1, 2024

Glad you found the root of the issue!

The plugin includes a similar feature that removes any HTML elements with the data-decompose attribute set to true (e.g., <div data-decompose="true">bye</div>). This feature is currently undocumented, as it is mainly used internally to remove cover pages once they've been rendered. However, you should be able to leverage it.

In the next release, I'll introduce a documented feature that offers similar functionality using a CSS class, such as mkdocs-exporter-ignore (#33) :)

@stephffuller
Copy link
Author

stephffuller commented Aug 5, 2024

@adrienbrignon so would I just add

<div class="mkdocs-exporter-ignore">
  <p>I wont appear in the document</p>
</div>

into my markdown files around those videos? Thanks so much for your help with this.

@adrienbrignon
Copy link
Owner

Yes, this should work as expected once this feature is shipped within the next release.
Any DOM element with the mkdocs-exporter-ignore class will be removed before printing the page.

@stephffuller
Copy link
Author

Hi @adrienbrignon . Wanted to let you know where we are. I was able to configure to ignore the videos, but ran into another similar issue, and these I cannot ignore for the output.

We are using the extra config option for mkdocs that allows us to set variables that are then replaced in the final output. To reference those variables, in the markdown files we use a syntax similar to what was used for the videos that mkdocs-exporter had a problem with:

...the upgrade process for {{ SAAP }} ...

So now it looks like mkdocs-exporter is not able to produce the pdf with those variables in place. Could you add support for the extra config in a future release? Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants