Code Monkey home page Code Monkey logo

vimwikigraph's Introduction

vimwikigraph

Go

vimwikigraph walks all files in a vimwiki directory and builds a graph between the encountered files and their internal references. The code supports vimwiki-style links [[link]], [[link|description]] and markdown-style links [description](link). The graph is converted to the DOT language using dot. The results can then be visualised with graphviz, e.g. using dot, neato, fdp, etc.

The graph visualises your notes and their connections, possibly providing new insights.

Usage

./vimwikigraph $HOME/vimwiki | dot -Tpng > test.png && open test.png

-diary: collapse all diary entries under a single node diary.wiki

-cluster: cluster subdirectories as subgraphs

-l: only nodes with at least l edges are inserted. The inserted nodes are inserted with all their edges. Thus, nodes with less than l edges can appear when they are connected to other nodes that do satisfy the requirement. For -l 0, all nodes are inserted.

--ignore REGEX: ignores any encountered path matching REGEX

Note: any trailing argument are considered directories to be skipped.

Examples

To illustrate /example/ contains some .wiki files and also a diary, /example/diary/*.wiki. Running vimwikigraph produces the following output. All diary files are collapse by default into a single node. Any connections to and from any diary files are simply an arrow point in to, or out of, the diary.

./vimwikigraph example | dot -Tpng > example.png

The -diary flag ensures all diary items are shown as nodes.

./vimwikigraph example -diary | dot -Tpng > example.png

The -cluster flag adds all diary items to a subgraph.

./vimwikigraph example -diary -cluster | dot -Tpng > example.png

The --ignore allows to filter files by the given regex, e.g. to ignore any matches with alice or bob

./vimwikigraph example -diary -cluster --ignore "alice|bob" | dot -Tpng > example.png

Installation

go get github.com/maxvdkolk/vimwikigraph

Change log

  • 2021/05/31: add --ignore flag to ignore any path that matches the provided regex.

vimwikigraph's People

Contributors

issyl0 avatar maxvdkolk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

kajigga iq-scm

vimwikigraph's Issues

Path walking fails due to file named .vim-template:project-*

Hi there, thanks for this tool!

When running it, pointing to the root of my vimwiki I get the following error:

✦ at 13:06:54 ➜ vimwikigraph . | dot -Tpng > example.png                                                             
2021/05/31 13:07:52 Error when walking directories: open software/.vim-template:project-*: no such file or directory 

This is because I have a file literally named .vim-template:project-* under certain directories directories, to use along with this plugin: https://github.com/tibabit/vim-templates

Is there a way to skip these files? For example pass a regex and have vimiwkigraph ignore them?

Support markdown syntax

Currently, only vimwiki syntax is considered. Add support for vimwiki's that use markdown syntax and markdown extensions.

[[link]]
[link](link)
[link](link.md)

Note, for markdown these might point towards external links. Need to make sure only local links are kept in the graph.

Collapse all encountered folders.

Currently, the diary folder is collapsed. For wikis that contain multiple folder structures, it might be better to detect the folders when walking and allow to collapse any folders into a single node in the graph.

Add single nodes to graph

Hello!

I would like to ask the following feature:
Add to graph nodes that don't have inbound and outbound edges.
Currenlty, the are omited.

Best regards,
Artem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.