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

Way to add external Markdown file #683

Open
kidpixo opened this issue Apr 18, 2024 · 2 comments
Open

Way to add external Markdown file #683

kidpixo opened this issue Apr 18, 2024 · 2 comments

Comments

@kidpixo
Copy link

kidpixo commented Apr 18, 2024

first of all, thanks, pdoc is amazing!

Problem Description

I have a CHANGELOG.md file that doesn't fit to any particular function documentation.
I want to create an extra page in the main index listing to show this file.
Any Idea?

Proposal

No concrete ideas, maybe we can add the markdown files in the tree and add them as a "fake module" at that level?

Alternatives

Additional context

I'm documenting several packages, because this is only one project.
I extended the default template index to have a generic landing page.
I also changed the modules listing to make the top level bold (code here below, maybe useful to other).

Project structure :

project/
├── CHANGELOG.md
├── README.md
├── package2/
├── package2/
└─── doc
    ├── MERTIS.png
    ├── custom-template
    │   ├── index.html.jinja2
    │   └── module.html.jinja2
    ├── index.html
    ├── package
    ├── package.html
    ├── search.js
    ├── package2
    └── package2.html

Extra

this is my index.html.jinja2 , this overwrites the nav block entirely.

{% block nav %}
    <h2>Available Modules</h2>
    <ul>
        {% for submodule in all_modules if "._" not in submodule and not submodule.startswith("_") %}
            <li><a href="{{ submodule.replace(".","/") }}.html">
            {% if  "." not in submodule %}
                <span style="font-weight:bold">{{ submodule }} (top level)</span>
            {% else %}
                {{ submodule }}
            {% endif %}
            </a></li>
        {% endfor %}
    </ul>
{% endblock %}
@mhils
Copy link
Member

mhils commented May 14, 2024

I have a CHANGELOG.md file that doesn't fit to any particular function documentation. I want to create an extra page in the main index listing to show this file. Any Idea?

I'd just link to GitHub/... for the changelog. Alternatively, you can create a CHANGELOG.py file and include that in your pdoc invocation (pdoc your_module ./CHANGELOG.py). That feels a bit messy, but may be what you are after.

@kidpixo
Copy link
Author

kidpixo commented May 15, 2024

Thanks for the answer @mhils.
Your way is nice, but my project is not on github, and probably will never be (internal gitlab at work, internal bitbucket at ESA etc).
The "fake" CHANGELOG.py approach hit me too, I didn't know I can include a file like this, I'll give it a try.

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

No branches or pull requests

2 participants