xiguaxigua / docusaurus-plugin-drawio

drawio render for docusaurus
https://xiguaxigua.com/docusaurus-plugin-drawio
MIT License
36 stars 10 forks source link

Is it possible to choose the page to show ? #3

Closed jguidoux closed 1 year ago

jguidoux commented 1 year ago

Hi, I have a draw.io diagram with many pages. Is it possible to indicate with your plugin the specific page we would like to show ? Thanks.

xiguaxigua commented 1 year ago

I don't quite understand what you mean. I want to confirm. Do you mean that after setting the page, only load the lib of drawio on the corresponding page, and not load it on other pages, so as to improve the access speed of other pages?

jguidoux commented 1 year ago

Sorry, I was probably not clear. I have a draw.io diagrams. On this diagram I have 2 "pages" (maybe "page" is not the best word), named "page-1" and "page-2" as shown in the picture below image

I would like in my Docusaurus document to display only the diagram of the "page-2". But I don't know how to do that.

In my Docusaurus mdx file, I have this content :

import Drawio from '@theme/Drawio'
import simpleGraph from '!!raw-loader!./draws/test-draw.io';

# Titre

<Drawio content={simpleGraph} />

The result of this piece of code is :  image

As you can see, Docusaurus does not show the diagram I wish. It shows the diagram of the "page-1". But I would like to show the diagram of the "page-2". This is a simple example. I have another draw.io diagram which is composed of more than 10 "pages". Is there a way to indicate to Docusaurus, using the plugin, which diagram, or which "page" of the draw.io diagram, we would like to show ?

xiguaxigua commented 1 year ago

Thank you for your supplementary instructions, now I have added the page props in v0.0.3 version, you can try it, and discuss it in time if you have any questions

jguidoux commented 1 year ago

I just tried the new version. That is perfect :). Thank you to be so reactive.