-
Notifications
You must be signed in to change notification settings - Fork 166
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
Ability to have nested file structure #345
Comments
Not quite sure what you mean — what is a nested markdown file? |
Hi @lord Instead of having everything compiled into a single documentation page can Slate be altered to support multiple pages? |
You can currently have multiple pages if you create multiple |
Maybe he didn't know 'includes:' directive. I did came he because of the 'nested' keyword :) I would like to have structured(nested) format, as I find it more maintainable and also gives me better visual experience when adding/changing methods (think about lot of json examples) . I am thinking about structure like this: index.md and then in the in the includes file structure like this /includes foo.md would have another 'includes:' directive What do you think? Would it be possible somehow? Thanks a lot for any comment |
Ah, like nested |
I want to be able to nest includes too. I tried the partial syntax referenced above and it rendered as is within the file. It looks like that's primarily for folks writing directly in HTML or inside Ruby code. Is there a solution that works from within Markdown files? |
Rendered as-is? Did you change your file type to |
The partial files I'm referencing using that syntax are using .md.erb extensions. I did not alter the file name of the top-level include file listed from the index.html.md file where the references to the partials live. To see if location or file name was the problem, I've tried using a separate directory with relative paths and using the include directory with and without a leading _ for the file names. This is the reference to the partials inside an _foo.md file in my includes: <%= partial "../partials/partial1" %> Inside the source/partials directory I have the following files: partial1.md.erb Inside the source/includes directory I have the following files: _foo.md See the attached screenshot to see it rendered in my local Middleman instance: ETA: I also just tried and got the same results with "includes/partialK" for files with and without the _ inside the includes directory in case the path needs to be from the source directory. |
Hmmm, it looks like in the rendered output the quotes around the file names are curly quotes but I have straight quotes in my source file. |
Is your index file called |
No. I didn't rename the file from the sample/getting started project so it's index.html.md and the top level includes are foo.md as indicated above. I only used .md.erb for the partial files. |
Ah, try that! Renaming the index. |
It didn't help :( |
I don't have time to look now since I'm preparing for a new term of school to start, but I'm reopening this so I can take a look later. |
Hi Everyone, Just wondering if there was ever a working solution to partials within Slate found? Thanks, |
Just want to second this discussion. I have over 300 API calls divided into a dozen categories. Would love to include master category files that each include the appropriate set of API calls named as individual files. This would make them much easier to find and maintain over time. Currently I have to combine all the calls within each category into a single file. Can still include the separate categories as individual includes, but each has 30+ calls in it. |
Hi, I took a look at this issue and found that partials work and are a good solution for multi-file documentation. To put it simply, you need to do the following to use partials:
This will essentially import the contents of file.md.erb to index.html.md.erb, which will be rendered and presented in Slate as usual. Also, I've found partials to be pretty flexible with filenames; I could simply say If you take a look at my forked repo here, you'll find that I made a commit to enable this feature. In there, I made a nested file structure in Hope this helps! Edit: @janicecmt, if I understand your comments correctly, you:
If all of that is true, then this is what you would need to do in order to use partials in your working copy of Slate:
It's obviously been a few years since you've come across this problem. Hope this helps you tie up some loose ends. Edit 2: @nzkozar Thank you for pointing that out, totally missed that. Fixed :) |
@aarif4 You have a typo in your post, which just led me on a 30min debugging adventure. |
The actual text could use a better wording (so there would be no ambiguity about this from platforms) so please comment on the PR with propositions. Use `partial includes` which allows to reuse a snippet of text from a file. Docs about the feature https://github.com/slatedocs/slate/wiki/Using-Includes This comment explains it how to use partial includes with "includes" slatedocs#345 (comment)
We need the ability to retain our repository's nested markdown file structure. Users may either read documentation in our repository or on the doc site. Links and images will not work properly in this case with slate at the moment. Even if I am able to get slate to automatically render nested markdown files the links are still not going to work.
Do you have any tips/suggestions for this problem or would you be willing to support this in slate? Please let me know if you need further explanation of the issue.
The text was updated successfully, but these errors were encountered: