Plugin for Search #109
-
I'm building an editor extension for Standard Notes called the Append Editor (Source). It makes heavy use of Remark and Rehype plugins to parse Markdown into React, so I'm very thankful for everything that the Remark and Rehype plugins already do. I would like to build a feature to search within the editor, which is sometimes embedded within an I thought a potential solution would be to have a plugin for Remark, or probably Rehype, to allow for searching a keyword within the parsed/rendered html. For example, Remark and Rehype would parse the following Markdown text into the following html: Markdown: # Title
We want to search for a keyword within this text. HTML: <h1>Title</h1>
<p>We want to search for a keyword within this text.</p> With this potential plugin, I am imagining that we would specify a keyword, such as <h1>Title</h1>
<p>We want to search for a <span class="searchMatch">keyword</span> within this text.</p> Is something like this possible and/or feasible with Remark/Rehype plugins? Would the plugin be more feasible as a Remark or Rehype plugin? Or is this outside the scope of what Unified tries to accomplish? Thanks for taking the time to consider this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
@TheodoreChu can you expand on two things:
Broadly when I hear search I tend to think of Solr, ElastiSearch, Sphinx, MeiliSearch, etc. Full featured search engines, which have support for structured documents like Markdown or HTML, that have been processed with Unified. Unified does have some single document search capabilities https://github.com/syntax-tree/nlcst-search for example. Which may work for some use-cases, but generally Unified is more focused on transforming a single document, than advanced cross document search. |
Beta Was this translation helpful? Give feedback.
@TheodoreChu can you expand on two things:
Broadly when I hear search I tend to think of Solr, ElastiSearch, Sphinx, MeiliSearch, etc. Full featured search engines, which have support for structured documents like Markdown or HTML, that have been processed with Unified.
Unified does have some single document search capabilities https://github.com/syntax-tree/nlcst-search for example. Which may work for some use-cases, but generally Unified is more focused on transform…