-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
[Enhancement] : Serve several static paths #89
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix the linting issues
I didnt get this !! |
Hello @anikethsaha Thanks :) |
the behavior of currently docsify works like this.
Now if we divide w.r.t folders like this,
I have to check whether docsify will render the path like these. cause its one dir back and changed dir. I will take a look at this. Else I think this is a good enhancement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea 👏
In fact, the behavior of docsify will not change.
The folders in |
I meant for the |
If your path is If your path is |
but
I agree, its not a breaking change but we should cover all the cases before considering this. |
In your example, that will be : With path=docs,md :
But we can do it also : With path=html,docs:
;) |
Is this totally backwards compatible with the current functionality (it behaves just like any other static server)? |
Yes, there will be no changes if you use a single path value. The current behavior will be remained. |
LGTM then. Note, I personally am not in favor of the feature, as it diverges from standard expected static serve behavior (for example, your project's file structure (if using this new feature) may become incompatible with standard tools from NPM like |
That may be not the default behavior. Serving static from several paths is a real need. With it, it is possible to separate the static resources by their natures. The main tools serve the same type of resources, html files, but it is not the case for docsify where there are the files for the content (md) and the files for the presentation (html). It is my motivation 😉 |
Hello, can I have some news about this PR? ;) |
The main tools just serve files, doesn't matter what format they are in. You could still serve markdown files from one folder, html from another, and js from another. If I read correctly, what you want is to merge the folders together when they are served from the root
but you want to be able to load Also based on reading your comments, it seems like you want to map certain folders to certain Router paths. Would it be better to have a runtime option that tells Docsify runtime where to look for files and how to map those to the Router paths, and leave the server as a regular static server in which actual HTTP request paths match the file-system paths? If we can achieve what you want as a runtime option, then it means anyone can achieve the same regardless of which static server they use (in the case of the majority of static servers that simply mirror the file system structure). |
Hi everyone, It is possible to have a status about this PR? Thanks, |
hey! @gigaga , Just one note ! even if this CLI is serving like this
This will work fine with |
Hi @anikethsaha, Probably, I don't know Thanks |
I think with heroku you get a VM or container where you can customize a lot. in heroku are you using docsify-cli to serve the content ? |
Yes we can. |
Is there an update on this PR? This feature solves problems with serving Docsify with auto-reload where the directory structure is split into multiple directories per concern (source files, static files, documentation files). Especially when other libraries are bundled (using Rollup for example), the output ends up in another directory than the static/source files. It is not possible to serve Docsify documentation combined with bundling source files. There is one workaround, which is concurrently serving two directories, using
(the |
Goal
The goal of this PR is to allow to serve several static paths to be able to seperate easily the HTML elements of docsify (css, index.html, so on) with the md files folder.
For example, by using this feature, it is possible to organize our code like this:
And serve it by using the following command
docsify serve html,md --port 3001
./md
contains only the whole of md files without any files required by Docsify.It is now possible to separate the real documentation resources files and the files needed by the engine Docsify.
Syntax
docsify serve html,md --port 3001
path
can have several paths coma separated.