Skip to content

[Feature request] embed docsify on third party site #799

Closed
@dur41d

Description

@dur41d

Docsify is great but I find I can only use it in a dedicated website. It would be more flexible if docsify can be embedded on other sites. Although it's possible in theory but in practice I found that it doesn't work well.

For example: I wanted to use docsify to generate the documentation on this site:

https://uis-azr-test-fusionapi-eus1.portal.azure-api.net/user-guide-2

When I embedded docsify into the html if found that it completely changed the layout of my website. I think one of the reasons is that it modified the nav of the website.

I ended up using flatdoc which doesn't have the same features but it's less intrusive on the host website.

Activity

trusktr

trusktr commented on Jun 21, 2020

@trusktr
Member

This would be great to make this easier (f.e. not overriding existing <nav>)

trusktr

trusktr commented on Jun 21, 2020

@trusktr
Member

With the refactors that I recently did to move Docsify into its own file that has no side-effect of automatically loading Docsify into the DOM (see src/core/Docsify.js), I can imagine a simple way to do this initially as a non-breaking change (no custom element in this case), so I'll put it in 4.x.

Basically, we just tell Rollup to compile an additional bundle using src/core/Docsify.js as the entry point. In this case, the user can place a script tag pointing to this new bundle and manually instantiate new Docsify, while the previous bundle will still exist so all existing sites work the same way.

Users of the new bundle will be able to do this:

new Docsify({
  el: '#somewhere',
})

This will be very handy for integrating into existing websites while keeping them single-page apps, for example.

pauldraper

pauldraper commented on Sep 26, 2021

@pauldraper

Any hope for this?

pauldraper

pauldraper commented on Sep 26, 2021

@pauldraper

There are a number of issues with using docsify as a component.

For example, it registers global handlers when setting up routing.

That is, teardown will be a problem. (And I think it might even interfere with existing <a> on the page.)

trusktr

trusktr commented on Jan 12, 2022

@trusktr
Member

Let's list the things we need to fix right now to get this is good enough shape with minimal changes (bigger changes for later):

it registers global handlers when setting up routing.

@pauldraper Can you expand on this? Would you like Docsify to perform routing internally without modifying the URL path (because the outer application is doing that)? Or you still want the same behavior, but with ability to teardown when switching away from a docsify-containing view?

pauldraper

pauldraper commented on Jan 12, 2022

@pauldraper

Modifying the URL path is fine (for me at least).

But I do need to teardown listeners, or at least not cause a memory leak by double registering them.

I haven't looked at the implementation.

paulhibbitts

paulhibbitts commented on Mar 16, 2024

@paulhibbitts
Collaborator

This is now possible with https://Docsify-This.net which is open source and can be further customized including hosting your own instance, so closing this issue.

onionhammer

onionhammer commented on Mar 17, 2024

@onionhammer

Docsify-this, unless I'm misunderstanding what "docsify-this" does (generate a complete public website based on public markdown files), feels somewhat like the opposite of what this issue is requesting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      [Feature request] embed docsify on third party site · Issue #799 · docsifyjs/docsify