-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Markdown Export #308
Comments
Here we go. :)
Integrating with mkdocs is definitely a bit quirky at the moment. Not sure if you have seen https://github.com/mitmproxy/pdoc/tree/main/examples/mkdocs, there are a few mkdocs-specific comments in the README. Whatsoever, I agree that a direct Markdown export would work better here. If you are interested in building out Jinja2 templates for Markdown output I can rebase the markdown branch onto main, let me know what you think! 😃 |
This is great, thank you! I have looked at the mkdocs example and have something half-working using similar setups. But I switched to the mkdocs material theme and things fell apart pretty quickly. It's just not something I want to continue hacking my way around but I would love to help contribute to this markdown export option. If you can rebase the old branch, I can continue digging. I'm also new to jinja2 templates so progress has been a bit slow but if you could point me in the right direction as to how I can help get a markdown template going, I'd love to give it a shot. Do you think the easiest thing for now would be to simply keep using your latest release and use the |
Excellent.
Yes, exactly. The best way to start is probably to tinker with
If you replace the default templates and polish them to a nice Markdown output I can take care of everything else. :) |
I think I'm making some good progress on this but would love answers to a couple confusing bits. Could you help me understand what
Similarly, I'm not sure how |
created a PR in my project with the latest version of my templates here: codeghetti/seagulls-py#39 Would love some initial review and feedback :) Some notes:
Are things moving in the right direction? Is this too tightly coupled to certain things? |
Lines 135 to 175 in fd890b6
Lines 178 to 202 in fd890b6
You can probably change those to emit Markdown instead and then add a
Thanks, this looks good overall! I feel the "View Source" part is probably a bit too much for a default template, but maybe we can convert We probably also want to share |
I can give this some more attention after work tonight. |
I just pushed a version of the markdown template that I am actually decently happy with. I know it's very specific to mkdocs and my theme so maybe we can figure out what I can do to abstract it a bit more or give folks control over some of these as options? |
Thanks! The pdoc bits look great here. I think we fundamentally need to answer who the pdoc output is for. Is it for human consumption, or is it for other tools like mkdocs? For now I would be fine with declaring mkdocs as the primary target, so the specializations here (admonitions, code blocks for highlighting) are fine with me. We should tackle link/Linkify though, that is a major usability improvement for API consumers :) |
@zeelot made some great progress in codeghetti/seagulls-py#39 - I think we have a reasonable template to start with. 🥳 I have a PhD thesis to write at the moment, so it will take me a while to do the rest of the pdoc lifting. If someone needs this urgently, @zeelot's project has the relevant template files which you can just drop in for the HTML one to get Markdown output. :) |
I have pondered on this for a quite a bit over the last few months and have come to the conclusion that I'd like to declare pure Markdown export as out of scope for the time being. Here's my reasoning:
Long story short, as a maintainer I have the unfortunate duty of making some hard calls, and not adding Markdown output is one of them. @zeelot's template will continue to function for those who want this functionality, but it's not becoming part of pdoc itself. |
@mhils thanks for the update! |
hey any chance we can create a ticket for the markdown output support? I saw there is one that was closed but the markdown branch is over a hundred commits behind and I would love to track it properly :)
there's quite a bit wrong with simply renaming html files to md files right now. I am using mkdocs but, for example, the search feature of mkdocs will pick up on the html and show a lot of nonsense in the results because of it. I'm also struggling with links not working because of differences in how mkdocs treats files as directories in the URL but pdoc links to html files (that do not exist). I think proper markdown output support would make this challenge at least a tiny bit easier since the jinja templates should be simpler to modify to fit any weird mkdocs→pdoc linking issues.
thanks for the work!
Originally posted by @zeelot in #203 (comment)
The text was updated successfully, but these errors were encountered: