lsegal / yard

YARD is a Ruby Documentation tool. The Y stands for "Yay!"
http://yardoc.org
MIT License
1.94k stars 397 forks source link

Dump .yardoc db in JSON #886

Closed shreyankg closed 8 years ago

shreyankg commented 9 years ago

I'm working on a fork of yard which would take an option to dump the .yardoc database into JSON instead of Marshal. I'll be pushing commits to my fork in sometime, but before I do that, I wanted to understand if adding such functionality is part of yard's roadmap or is there a possibility of it's inclusion ?

lsegal commented 9 years ago

Sorry for the lack of response on this.

There have been efforts to dump to JSON in the past, specifically when working on refactors of the templating engine to work more like a single page app. The biggest issue was speed and size, because a single JSON document is actually pretty hefty and slow to load. If performance benchmarks showed that JSON was similar in speed and size, it would be on the roadmap, but if it's significantly slower or larger I don't know that it would be part of core.

Note that you can always write these things as plugins. The Registry has a RegistryStore backend which actually manages the data on disk, and that can be swapped out (or should be swappable).

lsegal commented 8 years ago

Closing as an answered question. Patches would be looked at for a YARD Registry to json exporter option, though as suggested, starting it as a plugin and opening a PR only after it is stable is the better path, I believe. I'm open to accepting PRs that fix any roadblocks in making this a plugin, if there are any.