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

How can I install this along with MkDocs? #10

Closed
happicamper opened this issue Mar 1, 2017 · 2 comments
Closed

How can I install this along with MkDocs? #10

happicamper opened this issue Mar 1, 2017 · 2 comments

Comments

@happicamper
Copy link

Hello! I'm confused with the instructions in the README, I'm able to include this extension in MkDocs:
markdown_extensions: [markdown_include.include]
Now, I don't have an idea how to use this extension, Here what I want to achieve is to create a file name file.md with a content of:

[URL1]: mydocs/file1.md
[URL2]: mydocs/file2.md
[URL3]: mydocs/file3.md

then calling these relative paths from other markdown files like this:

Here is the [link][URL1] 
Here is the [link][URL2] 
Here is the [link][URL3] 

Is it possible? thanks in advance!

@erilot
Copy link

erilot commented Apr 24, 2017

In case you're still watching this @happicamper --

I've gotten markdown-include to work with MkDocs by including the extension like this:

...
markdown_extensions:
  - markdown_include.include:
      base_path: docs
...

where docs is whatever your MkDocs base directory is ("docs" by default).

Then your includes are relative to the docs directory: {! ./file.md !} would inject the contents of /docs/file.md.

What you describe should work since this all happens before markdown processing.

@happicamper
Copy link
Author

I'm bad at watching my issues! Thanks @erilot I'm able to solve this a month ago and didn't close this issue, sorry! Horay! 🍕

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

No branches or pull requests

2 participants