Conversation
|
@renesat thanks for the PR! Could you please describe your use-case so I understand the context better? How exactly you plan to use the exported json? I would like to make sure that the export format makes sense, cause it a contract I will need to maintain over long period of time to make sure that we are not breaking integrations for the people who are using it. Also, since this is a new feature, it will require a test and docs update. |
|
Okay, I'll write the tests and fix the documentation. But I think I found a bug here. The test_export_dot_basic test creates two files: test.md and related.md. But only one is exported (I checked this on master, without my changes): digraph G {
rankdir=LR
fontname=Verdana
fontsize=13
nodesep=0.7
splines=polyline
pad="0.5,0.2"
ranksep=1.2
overlap=false
6[label="Test Document",fillcolor="#ffeee0",fontsize=16,fontname=Verdana,color="#b3b3b3",penwidth=1.5,shape=note,s
tyle=filled]
}There may be a mistake in creating GraphData or I'm missing something. I didn't dig deep, but it's strange that this is on master, where I just added the output of the resulting graph on the test data. |
|
I'm not sure, but the error is most likely somewhere in |
|
@renesat could you please explain what problem you are trying to solve? How you want to use json export, what is the use case? |
Well, I was thinking of using it for external visualization and statistical analysis. In general, JSON is the de facto standard for data transfer. You can transfer it to But here I found a problem that wasn't even in my PR. When I was writing the test, I noticed that the graph and dot_export weren't working correctly on the test example. Or should it only output It just seems more logical to me to export all data by default. And if you don't need everything, then use parameters. |
|
IWE build around the idea of MoC based documents hierarchy. The documents which are not part of any other documents considered roots. For example you can have Projects.md with all your projects referenced in it will make Projects.md a root and actual project leafs in the graph. The default export mode is - finding all the root documents and traversing the graph starting from them. You can read more here https://github.com/iwe-org/iwe/blob/master/docs/maps-of-content.md Could you please explain what type of processing you want to do with the JSON data and what structure of the JSON you would need? I can help you more with understanding of your intent. |
|
I would like to highlight as much information as possible, but as an example, I had the idea for myself to make a visualizer like org-roam-ui and export the information to my personal db. But how could anyone use this if they want to do something like plugins, additional analysis systems, and so on. Well, the main thing I need is nodes and metadata about them: file, id, title, etc. |
|
It would be awesome to have a visualizer for IWE. We can collaborate on this if you are interested. Are you thinking about using web stack? |
Added export to JSON. It is very useful if used for external tools. I just used the internal graph format. I can do something else, but I think it's a good option and there was almost nothing to refine.