Commits

Anonymous committed acb6edb

awesome doc building

  • Participants
  • Parent commits ea43eba

Comments (0)

Files changed (3)

 	sudo pip install --download-cache="virtualenv/.pipcache" virtualenv
 	virtualenv --distribute virtualenv
 	pip install -E virtualenv -r requirements.txt --download-cache="virtualenv/.pipcache"
+	mkdir virtualenv/docs; rm -r virtualenv/docs && mkdir virtualenv/docs
+	cd virtualenv && find -name \*.py | grep -v "site-packages/django/" | grep -v "site-packages/pycco/" | grep -v "site-packages/piston/" | grep -v "site-packages/pip" > docs/sources.txt # These do magic that break pycco
+	cd virtualenv && bin/pycco `cat docs/sources.txt` -d docs -p
+	for i in `find virtualenv/docs -type d`; do cp virtualenv/docs/pycco.css $$i; done
 	./manage.py createcachetable django_cache
 	./manage.py syncdb --migrate
 
 	sudo -u postgres psql -c"UPDATE pg_database SET datistemplate = TRUE where datname = 'template_postgis';" # set db to be a template
 	sudo -u postgres psql template_postgis -c"select postgis_lib_version();"
 
+htmldocs:
+	mkdir docs; rm -r docs && mkdir docs
+	find -name \*.py | grep -v "virtualenv/" > docs/sources.txt
+	virtualenv/bin/pycco `cat docs/sources.txt` -d docs -p
+	for i in `find docs -type d`; do cp docs/pycco.css $$i; done
+        
+
 update:
 	pip install -E virtualenv -Ur requirements.txt --download-cache="virtualenv/.pipcache"
 

File requirements.txt

 django-devserver
 django-reversion
 django-permissions
+django-tablib
+tablib
 djkombu
 sqlparse
 werkzeug
 guppy
 yolk
-tablib
 pycco
 beautifulsoup
+import os
+
 from django.conf import settings
 from django.conf.urls.defaults import *
 
 
 urlpatterns = patterns('',
     (r'^sentry/', include('sentry.urls')),
-    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
     (r'^admin/', include(admin.site.urls)),
     (r'^soxy/', 'soxy.views.proxy'),
     (r'^api/', include('restless.urls')),
 )
 
-urlpatterns += patterns('django.views.static',
-    # serve static media magically, should override this one using nginx/apache
-    # and cache forever in prod
-    (r'^media/(?P<path>.*)$', 'serve', {'document_root': settings.MEDIA_ROOT}),
-    (r'^media/admin/(?P<path>.*)$', 'serve', {'document_root': settings.ADMIN_MEDIA_ROOT}),
-)
+if settings.DEBUG:
+    urlpatterns += patterns('django.views.static',
+        # serve static media magically, should override this one using nginx/apache
+        # and cache forever in prod
+        (r'^media/(?P<path>.*)$', 'serve', {'document_root': settings.MEDIA_ROOT}),
+        (r'^media/admin/(?P<path>.*)$', 'serve', {'document_root': settings.ADMIN_MEDIA_ROOT}),
+        (r'^docs/(?P<path>.*)$', 'serve', {'document_root': os.path.join(settings.SITE_ROOT, "docs"), "show_indexes": True}),
+        (r'^virtualenv/docs/(?P<path>.*)$', 'serve', {'document_root': os.path.join(settings.SITE_ROOT, "virtualenv", "docs"), "show_indexes": True}),
+    )
 
 urlpatterns += patterns('',
     # DEC test project, including sample templates.