PageRenderTime 57ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/README.md

https://gitlab.com/pelican-plugins/tipue_search
Markdown | 67 lines | 50 code | 17 blank | 0 comment | 0 complexity | 1a526ccb28872161f53b6bf61b748472 MD5 | raw file
  1. Tipue Search
  2. ============
  3. A Pelican plugin to serialize generated HTML to JSON that can be used by jQuery plugin - Tipue Search.
  4. Copyright (c) Talha Mansoor
  5. Author | Talha Mansoor
  6. ----------------|-----
  7. Author Email | talha131@gmail.com
  8. Author Homepage | http://onCrashReboot.com
  9. Github Account | https://github.com/talha131
  10. Why do you need it?
  11. ===================
  12. Static sites do not offer search feature out of the box. [Tipue Search](http://www.tipue.com/search/)
  13. is a jQuery plugin that search the static site without using any third party service, like DuckDuckGo or Google.
  14. Tipue Search offers 4 search modes. Its [JSON search mode](http://www.tipue.com/search/docs/json/) is the best search mode
  15. especially for large sites.
  16. Tipue's JSON search mode requires the textual content of site in JSON format.
  17. Requirements
  18. ============
  19. Tipue Search requires BeautifulSoup.
  20. ```bash
  21. pip install beautifulsoup4
  22. ```
  23. How Tipue Search works
  24. =========================
  25. Tipue Search serializes the generated HTML into JSON. Format of JSON is as follows
  26. ```python
  27. {
  28. "pages": [
  29. {
  30. "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero.",
  31. "tags": "Example Category",
  32. "url" : "http://oncrashreboot.com/plugin-example.html",
  33. "title": "Everything you want to know about Lorem Ipsum"
  34. },
  35. {
  36. "text": "Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh.",
  37. "tags": "Example Category",
  38. "url" : "http://oncrashreboot.com/plugin-example-2.html",
  39. "title": "Review of the book Lorem Ipsum"
  40. }
  41. ]
  42. }
  43. ```
  44. JSON is written to file `tipuesearch_content.json` which is created in the root of `output` directory.
  45. How to use
  46. ==========
  47. To utilize JSON Search mode, your theme needs to have Tipue Search properly configured in it. [Official documentation](http://www.tipue.com/search/docs/#json) has the required details.
  48. Pelican [Elegant Theme](https://github.com/talha131/pelican-elegant) and [Plumage
  49. theme](https://github.com/kdeldycke/plumage) have Tipue Search configured. You can view their
  50. code to understand the configuration.