7.3.9 Collection Navigation Commands ↑
7.3.9.6 Generate a Collection Search Page
As an extension to the original Markdown spec from John Gruber, a Collection Search Page may be generated by placing the literal {:search}
on a line by itself, as in the following example:
{:search}
This command will generate HTML with embedded JavaScript providing a way to search the contents of the Collection for pages containing the indicated search term.
This command incorporates techniques found on the Go Make Things site. My sincere thanks to Chris Ferdinandi for his very useful and extremely usable site.
The command takes one operand, which would be the web URL for the site to be searched. This operand is supplied to DuckDuckGo as the site to be searched, as a fallback search mechanism, in case the generated JavaScript fails for some reason.
The following would be an example of the command with the supplied operand.
{:search: https://learnedabouthumans.org}
Note that this command is not particularly useful when viewing a Collection within Notenik, since Notenik already has its own Search capability built in.
On the other hand, the command becomes more useful when using Notenik to turn a Collection into a website, as with the Export as Web Book feature, since the resulting page can be used as the primary means of searching the resulting site.
Note that, when using Merge Templates and converting Markdown to HTML, you will likely also need to use the Variable Modifier identified as the Wiki-Style Links Mod, typically with a value of ‘w1
’, in order to make sure that this command resolves effectively, since it generates wiki-style links in Markdown before the conversion to HTML takes place.
See the Search the Knowledge Base page within this Collection for an example of the usage of this command.
Next: Generate a Tags Cloud