Piki is a minimal wiki
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

help.py 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. from django.utils.translation import gettext as _
  2. import mycreole
  3. import pages
  4. from themes import color_icon_url
  5. HELP_UID = 'help'
  6. MAIN = mycreole.render_simple(_(
  7. """
  8. = Piki
  9. **piki** is a minimal wiki implemented with python and django.
  10. == Help
  11. * [[creole|Creole Markup Language]]
  12. * [[access|Access Control for the site content]]
  13. * [[search|Help on Search]]
  14. """))
  15. CREOLE = mycreole.mycreole_help_pagecontent()
  16. CREOLE += mycreole.render_simple("""
  17. = Piki Markup
  18. | {{{[[rel_path_to_page|Name]]}}} | will result in a Link to the given wiki page. |
  19. | {{{<<subpages>>}}} | will result in a list of all subpages below the current page. |
  20. | {{{<<subpages=N,startswith>>}}} | will result in a list of subpages below the current page.\
  21. N will reduce the depth of the subpages to N. \
  22. startswith will reduce the hits to all pages starting with the given string. \
  23. You can give one or both Parameters. |
  24. | {{{<<allpages>>}}} | will result in a last of all pages. You can use [N,startswith] as with subpages. |
  25. """)
  26. ACCESS = mycreole.render_simple(_("""
  27. = Access
  28. * Currently just two specific users have write access.
  29. * Pages containing "private" in the relative page path have no public read access.
  30. """))
  31. SEARCH = mycreole.render_simple(_(
  32. """
  33. = Search
  34. The search looks up full words in //title (page basename)// and //page_src (the creole source)// without giving \
  35. special search commands in the search string.
  36. === Search fields
  37. * title (TEXT)
  38. * page_src (TEXT)
  39. * creation_time (DATETIME)
  40. * modified_time (DATETIME)
  41. * modified_user (TEXT)
  42. == Search syntax (Whoosh)
  43. === Logic operators
  44. * AND
  45. ** **Example:** "foo AND bar" - Search will find all items with foo and bar.
  46. * OR
  47. ** **Example:** "foo OR bar" - Search will find all items with foo, bar or with foo and bar.
  48. * NOT
  49. ** **Example:** "foo NOT bar" - Search will find all items with foo and no bar.
  50. === Search in specific fields
  51. A search pattern like //foo:bar// does look for //bar// in the field named //foo//.
  52. This search pattern can also be combined with other search text via logical operators.
  53. === Search for specific content
  54. * **Wildcards:**
  55. * **Range:**
  56. ** From To:
  57. ** Above:
  58. ** Below:
  59. * **Named constants:**
  60. ** //now//: Current date
  61. ** //-[num]y//: Current date minus [num] years
  62. ** //+[num]mo//: Current date plus [num] months
  63. ** //-[num]d//: Current date minus [num] days
  64. ** ...
  65. == Examples
  66. * [[/search/?q=modified_user:system-page|modified_user:system-page]] results in a list of all system pages.
  67. * [[/search/?q=modified_time%3A%5B-5d+to+now%5D| modified_time:[-5d to now] ]] results in a list of all pages which have been modified within the last 5 days.
  68. """))
  69. help_pages = {
  70. 'main': MAIN,
  71. 'creole': CREOLE,
  72. 'access': ACCESS,
  73. 'search': SEARCH,
  74. }
  75. def actionbar(context, request, current_help_page=None, **kwargs):
  76. actionbar_entries = (
  77. ('1', 'Main'),
  78. ('2', 'Creole'),
  79. ('3', 'Access'),
  80. ('4', 'Search'),
  81. )
  82. for num, name in actionbar_entries:
  83. context[context.ACTIONBAR].append_entry(
  84. HELP_UID + '-%s' % name.lower(), # uid
  85. _(name), # name
  86. color_icon_url(request, num + '.png'), # icon
  87. pages.url_helpview(request, name.lower()), # url
  88. True, # left
  89. name.lower() == current_help_page, # active
  90. )