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
Add ability to render documentation from multiple repositories #1469
Comments
The |
yea, u can do the trick. |
Thanks, this works great for single markdown files! I even managed to redirect to a few of my gists. Although if markdown you redirect to links to other markdown files, those are not automatically propagated and a separate route must be created. This will not scale if more markdown files are added to a folder. Could |
I think you could use the '/awesome/(.*)': 'https://another/docs/$1' |
This doesn't seem to work. This is my config: alias: {
'.*?/k8scommands':
'https://gist.githubusercontent.com/Piotr1215/443fb83c89958139f0c67ec70b111da2/raw/2f36aa704a73d92db6b420f7369c3f3d99a88380/kubectl-commands.md',
'.*?/k8snetworking':
'https://gist.githubusercontent.com/Piotr1215/23cf678d74079f98dc7be731e6a3f1d1/raw/b25fcb9054ab15b8f59253620e8dab8d33e52912/CKA-networking-commands.md',
'.*?/azure301': 'https://raw.githubusercontent.com/Piotr1215/az-301-prep-kit/master/README.md',
'/azure301/(.*)': 'https://github.com/Piotr1215/az-301-prep-kit/$1'
}, all routes except /azure301/(.*) work and I've tried to point it directly to raw link or as in example. Maybe it's because the other repo is not docsify but just bunch of markdown files in different folders. Thanks for your help |
we render markdown files no matter if it in docsify. I think it should work. - [1-workload-requirements](/azure301/1-workload-requirements/README)
...
- [6-infrastructure](/azure301/6-infrastructure/README) and the '/azure301/(.*)':'https://raw.githubusercontent.com/Piotr1215/az-301-prep-kit/master/$1' |
Hmm, doesn't work for me. Shows I'm looking for a functionality that would render another repo and all its linked markdown files automatically, is this possible? The scenario I think of:
|
oof, I tested them and seems works here. I think this can be achieved like this. main repo:
In
In other repo folder :
it should render the |
I have rearranged my repo and flattened the files structure, but still 404 for all other files than Some more info to help you reproduce the issue:
Expected behavior Test1 Actual behavior Test1 Expected behavior Test2 Actual behavior Test2 |
Although the I guess you still need specific the router in |
Thank you for your help :) Maybe this can be added as a feature to next docsify releases. I think it's a good idea to be able to render documentation from other repositories. |
np. |
Hi @Koooooo-7 , it has been a while since this issue was opened and I wanted to ask if there was any work done to enhance the I'm trying to render remote documentation on an on-prem GitLab instance, but it redirects me to the login page instead of re-using the existing token. If I try to log in, I get: '.*?/alias_name': 'https://gitlabaddress.com/project/repo/-/raw/master/README.md' |
Hi, I wonder if I fully understand what you did on the Basically, The IMO, I think you may try to custom plugin to do it .
FYI. I will try to solve it as well :) |
Thank you for your quick reply. My use case is that I want to render a markdown file from a remote URL that is in a GitLab project (repo). This works for my repo on GitHub, which you can see here; a bunch of aliases to various Gists. They render as expected on the page: this link for example renders a remote Gist with Kubernetes commands. When I try to do the same on our on-prem GitLab instance, instead of page render, I'm redirected to a login page. The expected behaviour is that the page should just render. If the EDIT: Somehow I missed the part about the custom plugin. I found one plugin https://github.com/JerryC8080, but it also has the same error. I don't trust my JavaScript skills enough to put together a plugin, but I can try if there is no other way Thank you for your help :) |
Hi , Thanks |
@Piotr1215 I reviewed that plugin, there is no place to pass the token in request either. window.$docsify = {
requestHeaders: {
'Authorization: 'Basic XXXXX',
},
}; Yet I hvnt found a good solution. |
Hi. I guess It should depend on the CSP settings of ur server. |
Hi When I try to have the above alias, the value is getting resolved tohttps://raw.github.com/atom-db/main//main/README.md?token= Mytoken.md. The result is suffixing with".md" . Please help me resolve this issue. |
Thank you for quick response. We have configured CORS, so there are no errors. I think it will not be possible to provide a static auth token, everyone will have a different one in their browsers. This might be a long shot, but I'm wondering if maybe Backstage TechDocs could give us an idea? I think what they are doing is putting together docs in a pipeline, so probably not a remote render. If the remote rendering will not work, I have to change my whole architecture |
I am trying to figure out the regex issue ,md extension which is getting added at the end, if I get correct regex rule. I can try it out and we can document as workaround. |
Hi. |
@Koooooo-7 |
What means the
It is a different way to render docs. Docsify renders docs in real time. it seems there should enhance |
I am. Interested to know about the extra hook to remove the .md in the end if there is a token. Query string, please share the sample code do that . I can test and see that works. |
Yet there hasn't a custom way to modify ext for now. window.$docsify = {
ext: '.md',
};
I m not sure what caused the |
I was thinking about reusing the same JWT token that an authenticated user already has, but this might be tricky. This is the same domain after all, with CORS set correctly there should be no XSS risk.
Indeed, Backstage renders docs in real time, but still serves up static content. This can be another idea, to use CI/CD pipelines and gather up all the READMEs, but I don't think docsify could work like that. Whatever solution we can find, the less I need to change the better :). |
If you could support enhanced alias with more control of passing the querystring and not having arbitrary extension at the end would be great . |
Hmmmm, I think If we include CICD into Docsify or extra building steps, it seems make things tough. |
@sy-records @trusktr Wdyt ? |
Feature request
Apologies if this is already a thing, but I couldn't find any information. The feature I'm looking for would enable rendering documentation from multiple repositories under the same menu.
What problem does this feature solve?
This feature would enable pulling documentation from multiple git repos with "docs" folder and adding/managing it in an automated manner. Something similar to how Backstage TechDocs work.
So instead of having documentation generated per repo, a centralized documentation for all repos would be possible.
What does the proposed API look like?
Maybe docsify window object could contain array of repos?
How should this be implemented in your opinion?
There should be one "main" repo that dictates central settings and all other repos get their own placeholder in menu (or on the page). Search and other plugins would have to work as it's only one repo.
Are you willing to work on this yourself?
I can help with documentation and testing.
The text was updated successfully, but these errors were encountered: