Tiddlywiki Indexer: Create Subject/Author Indexes

Demo link says 404 There isn’t a GitHub Pages site here.

@DaveGifford - I corrected the links!

Docs and tutorial will come in beta 0.2.0

1 Like

Wow, this is looking great! Beautiful work! Two questions:

  1. How do I select the fields that I want it to search?
  2. Could this accomodate entries that begin with numerals?

Blessings.

  1. open $:/plugins/kookma/indexer/ui/subject-index
  2. look at the code
<$macrocall 
  $name="wiki-indexer" 
	fields="title, tags, caption, text"
	indexEntries="$:/indexer/data/subject"
/>

See the fields, customize as you like.

NOTE: The subject index is default index which shipped with plugin, create your own for example, an index for places, objects, animals, …

aaaaaaand there it is! Eliminating ‘text’ eliminated a lot of unwanted results. This is brilliant, thanks a bunch for this plugin!

1 Like

Yes, you may like to index a Chinese or Japanese, or perhaps Persian wiki, so you need to to add numbers or other alphabets, normally indexes are used for alphabet.

Open

  1. $:/plugins/kookma/indexer/macros/index
  2. $:/plugins/kookma/indexer/macros/add-entries

extend the two variables alphabet and letters to cover your needs.

Kookma plugins are modular and very hackable!!! :rofl: :sweat_smile: :heart_eyes:

Enjoy hacking Indexer!

One thought to consider:

A

Action

Search results for Action

1 Like

I figured it out myself

In $:/plugins/kookma/indexer/macros/index

<!-- generate output -->
<article>
<$list filter="[<indexTiddler>get[text]enlist-input[]sort[title]]  :filter[subfilter<listfilter>] :filter[subfilter<sfilter>limit[1]]" >
<dl class="kk-indexer-list">
<details><summary><dt><$text text=<<currentTiddler>> /></dt></summary>
<$list filter=<<sfilter>> >
<dd><span title={{{[<livepreviewTid>get[text]match[yes]then{!!text}] }}}><$link/></span></dd>
</$list></details>
</dl>

Share your public wiki with hacked indexer when you could! Let’s learn from your showcase!

See the subject index tab in FFTW2 2022. I limited the fields to tags, keywords and caption for the moment.

You can see my own attempts at organizing domains > topics > notes in the story river. The list-search in my way is handy, but your indexer requires less work upfront for me.

1 Like

As you hide the result by default (using details tag) you may like to show the number of results in front of entries like

Acts14

or

Acts (14)

1 Like

That is handy, but ‘count’ tends to slow files down…

Perhaps a click to see count? but one that only counts on click not when listing.

Hi Mohammad,

This is really a wonderful idea. Have you thought about provinding a button to export then in an html/.tid file with indexes as headings; entries (tiddler titles or some other field of choice) in bold?

Thank you Rahul,
Exporting to an interactive html, needs JS, but TW only exports static page with no JS.
And creating a manual setup to do so is tough!

1 Like

Thanks to this thread I solved a long standing problem for me, exporting static tiddlers that load the parent wiki. It also demonstrates how to possibly capture something like an indexer in a static tiddler.

  • To test download and drop Export Static tiddlers link to parent.json
  • Open the “Filter Operators” tiddler and export using the new exporter.
  • Save this static tiddler anywhere, then open it in your browser
  • It looks like a standard static tiddler however any link will open in the current tab the actual tiddlywiki.com tiddler/page.

If you look here Creating a custom export format you can see exporters simply make use of a “template” defined within a tiddler, eg static HTML exporter is in $:/core/templates/exporters/StaticRiver

  • I revisited this and discovered what I want to do was very easy using the html head/base tag. Here is my modified version Export Static tiddlers link to parent.json (1.3 KB)
  • The only change was adding <base href={{$:/info/url/full}} target="_self"> in the head section of the exporter.
  • Not true @Mohammad you just need a modified or new exporter and include the Javascript.
  • I believe the node version will make use of a named template as well (need to check)

Hi @rkashyap welcome. If you take a copy of the above exporter and modify it, including with javascript inside it you can do as you suggest.

  • To be clear, the tiddlywiki export mechanism allows you to generate almost any kind of output including fully formed HTML pages. Static tiddlers is the only html exporter provided for tiddlywiki users.
3 Likes

Many thanks. This is helpful.