-
I am trying to render md files that are located in the root directory of where the docs folder is located. The build is run succesfully but I get a 404 not found error on the pages where I locate outside of docs. Can someone help me?
|
Beta Was this translation helpful? Give feedback.
Replies: 14 comments · 7 replies
-
Try the snippets extension: https://facelessuser.github.io/pymdown-extensions/extensions/snippets/#snippets-notation |
Beta Was this translation helpful? Give feedback.
-
@pawamoy not sure how this would help? I just want to use md files outside of the docs folder within my mkdocs-site. Is this possible? |
Beta Was this translation helpful? Give feedback.
-
Yes, that's what the snippets extension allows to do (among other things). I've found it to be the most reliable way to include files that are outside of the docs directory. For example, my Before that I was using symlinks, which didn't work well between different platforms, and after that I was using the |
Beta Was this translation helpful? Give feedback.
-
Ahh, I see, but its a python extension, and Im not using Python?? |
Beta Was this translation helpful? Give feedback.
-
You definitely are using Python since MkDocs is written in Python 😉 |
Beta Was this translation helpful? Give feedback.
-
I'm trying to do a pip install but 1. I dont have pip 2. I wouldnt know where in my project to download pymdown-extensions :/ |
Beta Was this translation helpful? Give feedback.
-
I'm familiar with npm and understand that you need to download in a directory where package.json is located, but I dont have any experience with pip |
Beta Was this translation helpful? Give feedback.
-
You need to learn about pip and how to use it. If you installed MkDocs with another package manager (for example your OS package manager), then you should try to install pymdownx using this same package manager. MkDocs bugtracker is not the right place for this unfortunately. But there are plenty resources on the internet, I'm sure you'll quickly find how to handle this. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your help :) |
Beta Was this translation helpful? Give feedback.
-
@pawamoy Okay, I've now got the extension I think. If I understand the example correctly. If I have a root directory and within this root directory I have my docs folder which mkdocs reads from. If I wanted the introduction navigation to point to the README.md which is also located in the root directory (not within docs folder), would I do it like this?
|
Beta Was this translation helpful? Give feedback.
-
Thank you for the help, @pawamoy! @awallemo it took me some time to figure this out (stalked @pawamoy's repositories 😆) - the For example, see -
This will render |
Beta Was this translation helpful? Give feedback.
-
found this discussion on a GG Search.. the only missing code snippet appears to be markdown_extensions:
- pymdownx.snippets:
check_paths: true which should be placed in |
Beta Was this translation helpful? Give feedback.
-
you can also do this:
|
Beta Was this translation helpful? Give feedback.
-
This thread is a bit old but I had the same problems and none of the solutions worked super well so I made this: https://pypi.org/project/mkdocs-include-files/ |
Beta Was this translation helpful? Give feedback.
Try the snippets extension: https://facelessuser.github.io/pymdown-extensions/extensions/snippets/#snippets-notation