rosscdh / mkdocs-markdownextradata-plugin

A MkDocs plugin that injects the mkdocs.yml extra variables into the markdown template
MIT License
83 stars 18 forks source link

External yml files? #4

Closed wilhelmer closed 5 years ago

wilhelmer commented 5 years ago

It would be nice if we could specify external file(s) where the extra variables are stored, similar to extra_css and extra_javascript:

mkdocs.yml

extra_yml:
    - data.yml

data.yml

customer:
    name: Your name here
    web: www.example.com
    salt: salt.example.com

Or is there already a way to parse external files?

wilhelmer commented 5 years ago

Nevermind, I just realized that the extra variable functionality is already implemented in mkdocs and your plugin is only an extension. So I better ask the mkdocs team. Issue can be closed.

rosscdh commented 5 years ago

Hey there, thanks for the request and resolution. Just the kind of item I like on my feed :)

retorquere commented 5 years ago

How does this work? I'm also looking to load data from external yaml files.

rosscdh commented 5 years ago

@retorquere please read the README.md its pretty clear

retorquere commented 5 years ago

I've read the readme (and it's clear) but that loads data from the mkdocs.yml file. I don't see how I can read data from other yml files in there.

rosscdh commented 5 years ago

Its not built to do that. as you are entering the realms of using something a little more substantial for static site generation like maybe gohugo.com

but you could fork it (as you have) and then modify the loader so that it then reads a particular directory and if files exist then load them and inject the data.

On Thu, Jun 20, 2019 at 6:52 PM Emiliano Heyns notifications@github.com wrote:

I've read the readme (and it's clear) but that loads data from the mkdocs.yml file. I don't see how I can read data from other yml files in there.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/rosscdh/mkdocs-markdownextradata-plugin/issues/4?email_source=notifications&email_token=AADA6MVDGJZINCH7JZL7QILP3OYWPA5CNFSM4GJMWM6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYF7YAY#issuecomment-504101891, or mute the thread https://github.com/notifications/unsubscribe-auth/AADA6MXSZGTG44MRDCTGZLLP3OYWPANCNFSM4GJMWM6A .

retorquere commented 5 years ago

I just figured I must have missed something and I was doing the fork for nothing.

Interested in a pull request to add this? Otherwise I'm happy to leave the fork as a companion plugin to this one.

I've looked at gohugo but that seems more complicated than mkdocs. I'm pretty happy with mkdocs + this plugin, I just need external data loading and I'm done.

rosscdh commented 5 years ago

sure feel free to make a PR happy to review it thanks for making the effort :)

gohugo is more complicated but very powerful

On Thu, Jun 20, 2019 at 6:59 PM Emiliano Heyns notifications@github.com wrote:

I just figured I must have missed something and I was doing the fork for nothing.

Interested in a pull request to add this? Otherwise I'm happy to leave the fork as a companion plugin to this one.

I've looked at gohugo but that seems more complicated than mkdocs. I'm pretty happy with mkdocs + this plugin, I just need external data loading and I'm done.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/rosscdh/mkdocs-markdownextradata-plugin/issues/4?email_source=notifications&email_token=AADA6MT4ETFU4KYBJS4BWGDP3OZOFA5CNFSM4GJMWM6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYGAI2A#issuecomment-504104040, or mute the thread https://github.com/notifications/unsubscribe-auth/AADA6MSKW55QVDTYMSXUDO3P3OZOFANCNFSM4GJMWM6A .

retorquere commented 5 years ago

I've tried gohugo and got it to work, but it feels a little like a dead end to me without a facility for plugins.