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

credits page #24

Merged
merged 14 commits into from
Dec 27, 2021
Merged

Conversation

rachmadaniHaryono
Copy link
Contributor

resolves #22

- dev_dependencies variables
- send all package info for further usage
- use local jinja template
Copy link
Owner

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! Just a few quality things to fix (see CI)

@rachmadaniHaryono rachmadaniHaryono marked this pull request as draft December 19, 2021 21:20
@rachmadaniHaryono rachmadaniHaryono marked this pull request as ready for review December 19, 2021 21:44
@rachmadaniHaryono
Copy link
Contributor Author

i think i misunderstand jinja and copier.
i thought file with jinja suffix on docs folder will generate new file when run make docs or make docs-serve

@pawamoy
Copy link
Owner

pawamoy commented Dec 20, 2021

So, credits must be generated each time we build the docs (because dependencies can change regularly).
Without specific plugins, Markdown pages are not rendered through Jinja by MkDocs. That's what the macros plugin does.
But in our case, the credits template needs specific context, that MkDocs itself (or even macros) is not aware of.
That is why we used macros to "inject" the get_credits function into the global context, function that returns the contents of credits.

You tried to use a shortcut: that's a nice idea. But in your changes macros is injecting get_credits_data, while the credits template is trying to access the return value of get_credits_data. Maybe you could add a {% set data = get_credits_data() %} at the top of the template, and then prefix each Jinja variable with data..

Or you could refactor to use the same logic as in the copier-pdm template, i.e. stop using macros and replace it with mkdocs-gen-files.

@rachmadaniHaryono
Copy link
Contributor Author

Maybe you could add a {% set data = get_credits_data() %} at the top of the template, and then prefix each Jinja variable with data..

i think i will choose this one

@rachmadaniHaryono rachmadaniHaryono marked this pull request as draft December 20, 2021 13:18
@rachmadaniHaryono rachmadaniHaryono marked this pull request as ready for review December 20, 2021 13:35
@pawamoy pawamoy merged commit 6b42eef into pawamoy:master Dec 27, 2021
@rachmadaniHaryono rachmadaniHaryono deleted the feature/credits-upstream branch December 27, 2021 22:29
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

Successfully merging this pull request may close these issues.

type error on macros
2 participants