You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include some files from other repo? set the base url? #575
I am playing with documenting some projects. But came to problem, where:
For example, I have documented modules like news, projects, navigation.
But now I need to write documentation for different websites for these modules. so actually only the 'base_url' which is mentioned in the pages will be used. is there a way to set it?
Other problem I see, is that, for example, I would like to make documentation of the news module in one place, navigation - other place.
And then, later, when I build the docs, I just link the external modules and compile them in...
That way, later, when news.md is updated on the main repo, I can rebuild every other page with it, just running the build command and it would fetch the updated repo, or something like that.
so in the markdown files, we could somehow use this variables. Maybe this is now possible? but I simply don't know how this is doable?
2 question is:
is there a way to build a markdown from external (i.e. git (gitlab), gist files)?
So for example, I keep the main navigation.md file updated, and the mkdocs build would just git clone/pull this file/repo or something like this... Maybe config could look like:
Anything in extra will get passed directly to the template. Of course, you will need to use a custom theme to make use of those variables.
Regarding your second question, that seems to me to be out of scope for MkDocs. You might want to look at git submodules or something similar. You would then need to run a git command to make sure everything it up-to-date before running mkdocs build.
Yup, extra is good for more flexible custom templates as @waylan said. There is no way to use these variables from within the markdown. I am not sure this is a case that we should support, I don't fully understand why you would want to do that.
Apparently I thought it would be useful in December, I can't remember why :) #304 (comment) ... I guess I can think of some use cases, but not that many are big issues for me.
Activity
d0ugal commentedon Jun 1, 2015
I'm not sure I fully understand. Is the main problem that you want to build markdown files across multiple repos?
huglester commentedon Jun 1, 2015
There are two problems I am facing,
1 question:
in the readme, I often link to the main site, like:
example.com/admin/pagesexample.com/admin/navigationbut using this, if I build readme for different pages, I need to find/replace
example.comwithnewdomain.comI think it would be good idea to add something like this in the config:
so in the markdown files, we could somehow use this variables. Maybe this is now possible? but I simply don't know how this is doable?
2 question is:
is there a way to build a markdown from external (i.e. git (gitlab), gist files)?
So for example, I keep the main navigation.md file updated, and the
mkdocs buildwould just git clone/pull this file/repo or something like this... Maybe config could look like:waylan commentedon Jun 1, 2015
Regarding your first question, you can assign your own variables to
extra:Anything in
extrawill get passed directly to the template. Of course, you will need to use a custom theme to make use of those variables.Regarding your second question, that seems to me to be out of scope for MkDocs. You might want to look at git submodules or something similar. You would then need to run a git command to make sure everything it up-to-date before running
mkdocs build.huglester commentedon Jun 1, 2015
Hello,
understood. ok when maybe I will write some script to pull the repos.
And returning to first question.
Actually I need those variables not in the template, but inside Markdown files. is this possible?
d0ugal commentedon Jun 1, 2015
Yup,
extrais good for more flexible custom templates as @waylan said. There is no way to use these variables from within the markdown. I am not sure this is a case that we should support, I don't fully understand why you would want to do that.waylan commentedon Jun 1, 2015
Regarding using YAML variables within Markdown see #304.
d0ugal commentedon Jun 1, 2015
Apparently I thought it would be useful in December, I can't remember why :) #304 (comment) ... I guess I can think of some use cases, but not that many are big issues for me.