Permalink
Browse files

Initial commit

  • Loading branch information...
turukawa committed Dec 26, 2013
0 parents commit 9df225afafc019faee042897f2f9632bf148ad62
Showing with 32,557 additions and 0 deletions.
  1. +10 −0 manage.py
  2. +52 −0 readme.md
  3. BIN requirements.txt
  4. 0 whyqd/__init__.py
  5. 0 whyqd/snippets/__init__.py
  6. +13 −0 whyqd/snippets/diff2merge.py
  7. +1,920 −0 whyqd/snippets/diff_match_patch.py
  8. +76 −0 whyqd/snippets/dominantcolor.py
  9. +914 −0 whyqd/snippets/html2text.py
  10. +103 −0 whyqd/snippets/shrtn.py
  11. +772 −0 whyqd/static/admin/css/base.css
  12. +289 −0 whyqd/static/admin/css/changelists.css
  13. +30 −0 whyqd/static/admin/css/dashboard.css
  14. +354 −0 whyqd/static/admin/css/forms.css
  15. +57 −0 whyqd/static/admin/css/ie.css
  16. +54 −0 whyqd/static/admin/css/login.css
  17. +221 −0 whyqd/static/admin/css/rtl.css
  18. +514 −0 whyqd/static/admin/css/widgets.css
  19. BIN whyqd/static/admin/img/admin/arrow-down.gif
  20. BIN whyqd/static/admin/img/admin/arrow-up.gif
  21. BIN whyqd/static/admin/img/admin/changelist-bg.gif
  22. BIN whyqd/static/admin/img/admin/changelist-bg_rtl.gif
  23. BIN whyqd/static/admin/img/admin/chooser-bg.gif
  24. BIN whyqd/static/admin/img/admin/chooser_stacked-bg.gif
  25. BIN whyqd/static/admin/img/admin/default-bg-reverse.gif
  26. BIN whyqd/static/admin/img/admin/default-bg.gif
  27. BIN whyqd/static/admin/img/admin/deleted-overlay.gif
  28. BIN whyqd/static/admin/img/admin/icon-no.gif
  29. BIN whyqd/static/admin/img/admin/icon-unknown.gif
  30. BIN whyqd/static/admin/img/admin/icon-yes.gif
  31. BIN whyqd/static/admin/img/admin/icon_addlink.gif
  32. BIN whyqd/static/admin/img/admin/icon_alert.gif
  33. BIN whyqd/static/admin/img/admin/icon_calendar.gif
  34. BIN whyqd/static/admin/img/admin/icon_changelink.gif
  35. BIN whyqd/static/admin/img/admin/icon_clock.gif
  36. BIN whyqd/static/admin/img/admin/icon_deletelink.gif
  37. BIN whyqd/static/admin/img/admin/icon_error.gif
  38. BIN whyqd/static/admin/img/admin/icon_searchbox.png
  39. BIN whyqd/static/admin/img/admin/icon_success.gif
  40. BIN whyqd/static/admin/img/admin/inline-delete-8bit.png
  41. BIN whyqd/static/admin/img/admin/inline-delete.png
  42. BIN whyqd/static/admin/img/admin/inline-restore-8bit.png
  43. BIN whyqd/static/admin/img/admin/inline-restore.png
  44. BIN whyqd/static/admin/img/admin/inline-splitter-bg.gif
  45. BIN whyqd/static/admin/img/admin/nav-bg-grabber.gif
  46. BIN whyqd/static/admin/img/admin/nav-bg-reverse.gif
  47. BIN whyqd/static/admin/img/admin/nav-bg.gif
  48. BIN whyqd/static/admin/img/admin/selector-add.gif
  49. BIN whyqd/static/admin/img/admin/selector-addall.gif
  50. BIN whyqd/static/admin/img/admin/selector-remove.gif
  51. BIN whyqd/static/admin/img/admin/selector-removeall.gif
  52. BIN whyqd/static/admin/img/admin/selector-search.gif
  53. BIN whyqd/static/admin/img/admin/selector_stacked-add.gif
  54. BIN whyqd/static/admin/img/admin/selector_stacked-remove.gif
  55. BIN whyqd/static/admin/img/admin/tool-left.gif
  56. BIN whyqd/static/admin/img/admin/tool-left_over.gif
  57. BIN whyqd/static/admin/img/admin/tool-right.gif
  58. BIN whyqd/static/admin/img/admin/tool-right_over.gif
  59. BIN whyqd/static/admin/img/admin/tooltag-add.gif
  60. BIN whyqd/static/admin/img/admin/tooltag-add_over.gif
  61. BIN whyqd/static/admin/img/admin/tooltag-arrowright.gif
  62. BIN whyqd/static/admin/img/admin/tooltag-arrowright_over.gif
  63. BIN whyqd/static/admin/img/gis/move_vertex_off.png
  64. BIN whyqd/static/admin/img/gis/move_vertex_on.png
  65. +20 −0 whyqd/static/admin/js/LICENSE-JQUERY.txt
  66. +111 −0 whyqd/static/admin/js/SelectBox.js
  67. +130 −0 whyqd/static/admin/js/SelectFilter2.js
  68. +139 −0 whyqd/static/admin/js/actions.js
  69. +7 −0 whyqd/static/admin/js/actions.min.js
  70. +274 −0 whyqd/static/admin/js/admin/DateTimeShortcuts.js
  71. +96 −0 whyqd/static/admin/js/admin/RelatedObjectLookups.js
  72. +137 −0 whyqd/static/admin/js/admin/ordering.js
  73. +156 −0 whyqd/static/admin/js/calendar.js
  74. +27 −0 whyqd/static/admin/js/collapse.js
  75. +2 −0 whyqd/static/admin/js/collapse.min.js
  76. +47 −0 whyqd/static/admin/js/compress.py
  77. +221 −0 whyqd/static/admin/js/core.js
  78. +239 −0 whyqd/static/admin/js/dateparse.js
  79. +167 −0 whyqd/static/admin/js/getElementsBySelector.js
  80. +136 −0 whyqd/static/admin/js/inlines.js
  81. +5 −0 whyqd/static/admin/js/inlines.min.js
  82. +4 −0 whyqd/static/admin/js/jquery.init.js
  83. +6,240 −0 whyqd/static/admin/js/jquery.js
  84. +154 −0 whyqd/static/admin/js/jquery.min.js
  85. +34 −0 whyqd/static/admin/js/prepopulate.js
  86. +1 −0 whyqd/static/admin/js/prepopulate.min.js
  87. +94 −0 whyqd/static/admin/js/timeparse.js
  88. +140 −0 whyqd/static/admin/js/urlify.js
  89. +397 −0 whyqd/static/css/bootstrap-theme.css
  90. +7 −0 whyqd/static/css/bootstrap-theme.min.css
  91. +7,118 −0 whyqd/static/css/bootstrap.css
  92. +7 −0 whyqd/static/css/bootstrap.min.css
  93. +86 −0 whyqd/static/css/icomoon.css
  94. +22 −0 whyqd/static/css/jquery.fileupload.css
  95. +189 −0 whyqd/static/css/medium-editor.css
  96. +58 −0 whyqd/static/css/whyqd.css
  97. BIN whyqd/static/fonts/glyphicons-halflings-regular.eot
  98. +229 −0 whyqd/static/fonts/glyphicons-halflings-regular.svg
  99. BIN whyqd/static/fonts/glyphicons-halflings-regular.ttf
  100. BIN whyqd/static/fonts/glyphicons-halflings-regular.woff
  101. BIN whyqd/static/fonts/icomoon.eot
  102. +29 −0 whyqd/static/fonts/icomoon.svg
  103. BIN whyqd/static/fonts/icomoon.ttf
  104. BIN whyqd/static/fonts/icomoon.woff
  105. +101 −0 whyqd/static/js/app.js
  106. +2,006 −0 whyqd/static/js/bootstrap.js
  107. +7 −0 whyqd/static/js/bootstrap.min.js
  108. +117 −0 whyqd/static/js/cors/jquery.postmessage-transport.js
  109. +86 −0 whyqd/static/js/cors/jquery.xdr-transport.js
  110. +6 −0 whyqd/static/js/jquery-1.10.2.min.js
  111. +7 −0 whyqd/static/js/jquery-ui-1.10.3.custom.min.js
  112. +427 −0 whyqd/static/js/jquery.fileupload-angular.js
  113. +106 −0 whyqd/static/js/jquery.fileupload-audio.js
  114. +309 −0 whyqd/static/js/jquery.fileupload-image.js
  115. +144 −0 whyqd/static/js/jquery.fileupload-jquery-ui.js
  116. +172 −0 whyqd/static/js/jquery.fileupload-process.js
  117. +699 −0 whyqd/static/js/jquery.fileupload-ui.js
  118. +119 −0 whyqd/static/js/jquery.fileupload-validate.js
  119. +106 −0 whyqd/static/js/jquery.fileupload-video.js
  120. +1,420 −0 whyqd/static/js/jquery.fileupload.js
  121. +209 −0 whyqd/static/js/jquery.iframe-transport.js
  122. +2 −0 whyqd/static/js/jquery.stellar.min.js
  123. +231 −0 whyqd/static/js/jquery.whyqd.js
  124. +1 −0 whyqd/static/js/load-image.min.js
  125. +76 −0 whyqd/static/js/main.js
  126. +701 −0 whyqd/static/js/medium-editor.js
  127. +530 −0 whyqd/static/js/vendor/jquery.ui.widget.js
  128. +9 −0 whyqd/templates/404.html
  129. +9 −0 whyqd/templates/500.html
  130. +4 −0 whyqd/templates/account/already_logged_in.html
  131. +28 −0 whyqd/templates/account/base.html
  132. +75 −0 whyqd/templates/account/email.html
  133. +38 −0 whyqd/templates/account/login.html
  134. +5 −0 whyqd/templates/account/login_extra.html
  135. +19 −0 whyqd/templates/account/password_change.html
  136. +35 −0 whyqd/templates/account/password_reset.html
  137. +28 −0 whyqd/templates/account/password_reset_from_key.html
  138. +20 −0 whyqd/templates/account/password_set.html
  139. +19 −0 whyqd/templates/account/provider_list.html
  140. +22 −0 whyqd/templates/account/signup.html
  141. +34 −0 whyqd/templates/base.html
  142. +27 −0 whyqd/templates/datalog.html
  143. +23 −0 whyqd/templates/embed_base.html
  144. +5 −0 whyqd/templates/index.html
  145. +25 −0 whyqd/templates/search.html
  146. +11 −0 whyqd/templates/socialaccount/account_inactive.html
  147. +11 −0 whyqd/templates/socialaccount/authentication_error.html
  148. +2 −0 whyqd/templates/socialaccount/base.html
  149. +56 −0 whyqd/templates/socialaccount/connections.html
  150. +16 −0 whyqd/templates/socialaccount/login_cancelled.html
  151. +25 −0 whyqd/templates/socialaccount/signup.html
  152. +4 −0 whyqd/templates/socialaccount/snippets/login_extra.html
  153. +20 −0 whyqd/templates/socialaccount/snippets/provider_list.html
  154. +19 −0 whyqd/templates/welcome.html
  155. +45 −0 whyqd/templates/wiqinav.html
  156. +19 −0 whyqd/templates/wrapper.html
  157. +15 −0 whyqd/urls.py
  158. 0 whyqd/usr/__init__.py
  159. +10 −0 whyqd/usr/forms.py
  160. +98 −0 whyqd/usr/migrations/0001_initial.py
  161. 0 whyqd/usr/migrations/__init__.py
  162. +53 −0 whyqd/usr/models.py
  163. +27 −0 whyqd/usr/templates/usr/subscribe.html
  164. +23 −0 whyqd/usr/tests.py
  165. +10 −0 whyqd/usr/urls.py
  166. +50 −0 whyqd/usr/views.py
  167. 0 whyqd/wiqi/__init__.py
  168. +62 −0 whyqd/wiqi/admin.py
  169. +45 −0 whyqd/wiqi/forms.py
  170. +42 −0 whyqd/wiqi/load.py
  171. +205 −0 whyqd/wiqi/migrations/0001_initial.py
  172. 0 whyqd/wiqi/migrations/__init__.py
  173. +12 −0 whyqd/wiqi/models/__init__.py
  174. +477 −0 whyqd/wiqi/models/base.py
  175. +99 −0 whyqd/wiqi/models/geomap.py
  176. +109 −0 whyqd/wiqi/models/image.py
  177. +124 −0 whyqd/wiqi/models/text.py
  178. +15 −0 whyqd/wiqi/templates/wiqi/compare.html
  179. +30 −0 whyqd/wiqi/templates/wiqi/edit.html
  180. +38 −0 whyqd/wiqi/templates/wiqi/embed.html
  181. +9 −0 whyqd/wiqi/templates/wiqi/list.html
  182. +45 −0 whyqd/wiqi/templates/wiqi/liststack.html
  183. +23 −0 whyqd/wiqi/templates/wiqi/revert.html
  184. +135 −0 whyqd/wiqi/templates/wiqi/view - Copy.html
  185. +60 −0 whyqd/wiqi/templates/wiqi/view.html
  186. +1 −0 whyqd/wiqi/templates/wiqi/viewstack.html
  187. +16 −0 whyqd/wiqi/tests.py
  188. +22 −0 whyqd/wiqi/urls.py
  189. +205 −0 whyqd/wiqi/views.py
  190. +128 −0 whyqd/wiqi/wiqi.py
  191. +32 −0 whyqd/wsgi.py
@@ -0,0 +1,10 @@
#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "whyqd.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
@@ -0,0 +1,52 @@
Whyqd
=====

Whyqd is an extensible object-based wiki bringing revision control, content presentation, forking and embedding to any type of digital object.

Whyqd is written in Python and Django, with Jquery for the client side.

The current implementation permits the following wiqi objects:

- Text
- Images
- Maps (handlers still to be written)

While you can write your own views and templates, I have included a minimalist wiqi interface influenced by blog sites like [Medium](http://medium.com) and [WriteBox](http://writeboxapps.com/). Note a few permutations of this wiqi:

- WYSIWIG writing interface: no separation of view vs editing pages;
- Minimal interface: there is an assumption you know what you're doing, no queries regarding forking, new versions, etc.
- Permissions-based: if you own a document, you can do what you like, if you don't, you fork it if you want to change it;
- Merge-changes: if you want to merge two docs, view the diff, edit and commit;

I will put a demo up at some point so you can see this in action.

Roadmap
-------

- Complete the auth system along with per-object permissions;
- A "book" model so that individual texts can be arranged as a single work;
- D3.js simple tree view to present wiqi stack, as well as forked changes;
- Book management system (shuffling order of chapters);
- Integration of html2docx and python-docx for upload of Docx files, as well as download of work;
- Integration of [EbookGlue](https://ebookglue.com/) API so books can be saved as .epub and .mobi files;
- eCommerce system to support author sales of books;

Long-term roadmap:

Once the basic system is up and stable, then adding in new wiqi objects to support a much richer environment of book creation, including technical textbooks.

There's a long way to go and I would be grateful for code review and forks.

Acknowledgements
----------------

See the requirements.txt file for all the list of Python libraries included. The snippets folder includes code from all over and the comments in the code gives links to various sources I used. The included Javascript libraries are also sourced from their various creators.

My thanks to everyone, too numerous across the community of coders, are offered with deep gratitude.

License
-------

Whyqd is released under the [GNU Affero General Public License](http://www.gnu.org/licenses/agpl-3.0.html).

Attribution: Gavin Chait, http://www.whythawk.com/
BIN +534 Bytes requirements.txt
Binary file not shown.
No changes.
No changes.
@@ -0,0 +1,13 @@
from bs4 import BeautifulSoup

def mergediff(html, valid_tags = ['b', 'i', 'u', 'strong', 'em', 'blockquote']):
# http://stackoverflow.com/q/1765848
soup = BeautifulSoup(html)
for match in soup.findAll('ins'):
match.replaceWithChildren()
for match in soup.findAll('del'):
match.decompose()
# http://tezro.livejournal.com/219164.html
empty_tags = soup.findAll(lambda tag: tag.name in valid_tags and not tag.contents and (tag.string is None or not tag.string.strip()))
[empty_tag.extract() for empty_tag in empty_tags]
return unicode(soup)
Oops, something went wrong.

0 comments on commit 9df225a

Please sign in to comment.