| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
fix the linting issues
Sorry, something went wrong.
I didnt get this !! |
Sorry, something went wrong.
|
Hello @anikethsaha Thanks :) |
Sorry, something went wrong.
|
the behavior of docsify will change as the links wont be the same here. currently docsify works like this. docs/ - index.html --> /#/ - first.md --> /#/first - second.md --> /#/second Now if we divide w.r.t folders like this, /md
README.md
/html
/assets
/plugins
index.html
package.json
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 |
Sorry, something went wrong.
There was a problem hiding this comment.
Good idea 👏
Sorry, something went wrong.
|
In fact, the behavior of docsify will not change. md1/ - index.html --> / (loading) --> /#/ (render) - first.md --> /first.md (loading) --> /#/first (render) - second.md --> /second.md (loading) --> /#/second (render) md2/ - third.md --> /third.md (loading) --> /#/third (render) The folders in path parameter will be reachable from the same "/" url, even if they are served from several folders. |
Sorry, something went wrong.
I meant for the docs/index.html , not for the docs/md1/index.html |
Sorry, something went wrong.
|
If your path is ./docs, so the index path will be docs/index.html. If your path is ./docs1,./docs2 my code will search an index.html in docs1 and docs2. So indeed, if index.html in docs/md, path should be ./docs/md (same behavior that actually where path can have just one value). |
Sorry, something went wrong.
docs/ - index.html --> /#/ - md/ - first.md --> /#/md/first - second.md --> /#/md/second but docs/ - index.html --> /#/ md/ - first.md --> ? - second.md --> ? I agree, its not a breaking change but we should cover all the cases before considering this. |
Sorry, something went wrong.
|
In your example, that will be : With path=docs,md : docs/ - index.html --> /#/ md/ - first.md --> /#/first - second.md --> /#/second But we can do it also : With path=html,docs: html/ - index.html --> /#/ docs/md/ - first.md --> /#/md/first - second.md --> /#/md/second ;) |
Sorry, something went wrong.
|
Is this totally backwards compatible with the current functionality (it behaves just like any other static server)? |
Sorry, something went wrong.
|
Yes, there will be no changes if you use a single path value. The current behavior will be remained. |
Sorry, something went wrong.
|
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 serve, live-server, http-server, etc). |
Sorry, something went wrong.
|
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 😉 |
Sorry, something went wrong.
|
Hello, can I have some news about this PR? ;) |
Sorry, something went wrong.
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 / of the domain. So if I understand correctly, you want a filesystem structure like /md
README.md
/html
/assets
/plugins
index.html
but you want to be able to load your-domain.com/README.md and you-domain.com/index.html as if they were served from the same root folder, right? 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). |
Sorry, something went wrong.
|
Hi everyone, It is possible to have a status about this PR? Thanks, |
Sorry, something went wrong.
|
hey! @gigaga , Just one note ! even if this CLI is serving like this /md
README.md // localhost.com/README.md
/html
/assets
/plugins
index.html // localhost.com/indexhtml
This will work fine with docsify-cli but when we host the same site in some hosting service like netlify which I guess allows only one folder to serve, then it would break that. |
Sorry, something went wrong.
|
Hi @anikethsaha, Probably, I don't know netlify! But it still is usable with heroku. Thanks |
Sorry, something went wrong.
|
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 ? |
Sorry, something went wrong.
|
Yes we can. |
Sorry, something went wrong.
|
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 concurrently, http-server and docsify-cli (serve). For example: concurrently \
'docsify serve src --port 4001' \
'http-server --proxy http://localhost:4001 -d false -i false -p 4000' dist
(the src directory would contain index.html, all the .md files. The dist folder would contain bundled .js and .css which is referenced from index.html). |
Sorry, something went wrong.
|
@gigaga Apologies for the delay here. Could you just try to host a sample site in netlify or vercel` using this command? or @hiddewie even you can volunteer here to move this. If this is working fine with it we are good to go. Other wise we need to fix that. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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:
/md README.md /html /assets /plugins index.html package.jsonAnd 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.