# Citestore Plugin

**URL:** <https://meta.discourse.org/t/citestore-plugin/51620>\
**Category:** Development\
**Created:** [16 Ottobre 2016, 11:56pm UTC](https://meta.discourse.org/t/citestore-plugin/51620 "2016-10-16T23:56:42Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Silvanus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/silvanus/32/62831_2.png) [@Silvanus](https://meta.discourse.org/u/Silvanus)\
**Post date:** [16 Ottobre 2016, 11:56pm UTC](https://meta.discourse.org/t/citestore-plugin/51620/1 "2016-10-16T23:56:42Z")

</div>

I’m currently trying to make a plugin (`discourse-citestore`) that has the feature of storing data with a handle and a subhandle (locus), so that this data can be automatically accessed by users and pasted in their messages. For example, the plugin would take `[us-constitution 1]` and replace it with the first paragraph of the Constitution (which would be saved in the database). Here’s the repo:

[https://github.com/jsilvanus/discourse-citestore](https://github.com/jsilvanus/discourse-citestore)

I’ve gotten some way by simply reading other plugins and trying to adapt what is written in other places into my own needs. But right now I don’t know how to proceed…

As you can see, I have some functions in `plugin.rb` that deal with the storage creation and data insertion and retrieval. Example:

> <https://github.com/jsilvanus/discourse-citestore/blob/master/plugin.rb#L210-221>

However, I have no idea on how to access the functions I have set up in that file from the discourse-markdown file `citestore.js.es6`.

If someone could give me a few pointers, I would appreciate it immensely!

P.s. it may well be that my coding skillz are way too low for the project I have undertaken. I only hope that is not the case…

---

_[View the full topic](https://meta.discourse.org/t/citestore-plugin/51620)._
