Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
296 lines (296 sloc) 88 KB
[
{
"pk": 1,
"model": "sveedocuments.page",
"fields": {
"rght": 22,
"level": 0,
"tree_id": 2,
"parent": null,
"title": "Accueil",
"author": 1,
"modified": "2012-05-04 06:45:11",
"created": "2012-05-04 06:45:11",
"content": ".. _Django: https://www.djangoproject.com/\r\n\r\nIntroduction\r\n============\r\n\r\n**Django-Sveetchies** is the main site for documentation about some `Django`_ apps i \r\nmade and this is also their live demonstration.\r\n",
"visible": true,
"template": "homepage",
"published": "2012-01-09 14:07:51",
"lft": 1,
"order": 1,
"slug": "accueil"
}
},
{
"pk": 37,
"model": "sveedocuments.page",
"fields": {
"rght": 3,
"level": 1,
"tree_id": 2,
"parent": 1,
"title": "DjangoSveetchies Demo",
"author": 1,
"modified": "2012-05-05 20:33:27",
"created": "2012-05-05 20:33:27",
"content": ".. _Django: https://www.djangoproject.com/\r\n.. _Sending email with Django: https://docs.djangoproject.com/en/dev/topics/email/\r\n.. _Django database backends: https://docs.djangoproject.com/en/dev/ref/settings/#engine\r\n.. _Django deployment: https://docs.djangoproject.com/en/dev/howto/deployment/\r\n.. _Django collectstatic: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#collectstatic\r\n.. _Django internationalization system: https://docs.djangoproject.com/en/dev/topics/i18n/\r\n.. _docutils: http://docutils.sourceforge.net/\r\n.. _autobreadcrumbs: http://pypi.python.org/pypi/autobreadcrumbs\r\n.. _djangocodemirror: http://pypi.python.org/pypi/djangocodemirror\r\n.. _django-crispy-forms: https://github.com/maraujop/django-crispy-forms\r\n.. _django-mptt: http://pypi.python.org/pypi/django-mptt/\r\n.. _django-simple-captcha: https://github.com/mbi/django-simple-captcha\r\n.. _django-registration: http://pypi.python.org/pypi/django-registration\r\n.. _Sveetchies-accounts: https://github.com/sveetch/sveeaccounts\r\n.. _Sveetchies-documents: http://pypi.python.org/pypi/sveedocuments\r\n.. _CodeMirror: http://codemirror.net/\r\n.. _jQuery: http://jquery.com/\r\n.. _ReStructuredText: http://docutils.sourceforge.net/rst.html\r\n.. _pip: http://www.pip-installer.org/\r\n\r\nIntroduction\r\n============\r\n\r\n**Django-Sveetchies** is a `Django`_ website project, its main goal is to demonstrate \r\nsome `Django`_ apps I made while publishing their documentation.\r\n\r\nLinks\r\n*****\r\n\r\n* Clone it on his \r\n `Github repository <https://github.com/sveetch/DjangoSveetchies>`_;\r\n* Documentation to come on \r\n `DjangoSveetchies page <http://sveetchies.sveetch.net/djangosveetchies-demo/>`_.\r\n\r\nRequires\r\n========\r\n\r\nThis is the direct dependencies to use the project.\r\n\r\n* `autobreadcrumbs`_;\r\n* `djangocodemirror`_;\r\n* `Sveetchies-accounts`_;\r\n* `Sveetchies-documents`_;\r\n\r\nInstall\r\n=======\r\n\r\nThis is not an application but a website project, so you don't have to install it like a \r\nPython module, just put it where you want, configure it and start it.\r\n\r\nDjangoSveetchies contains a ``requirements.txt`` file, yf you have ``pip`` installed you \r\ncan simply install all his dependancies with the following command : ::\r\n\r\n\tpip install -r requirements.txt\r\n\r\nElse you can his dependancies and manually install them from requirements.\r\n\r\nThen to test it, just use the ``django-admin runserver`` command. To use it in production \r\nyou will have to configure your webserver to serve it as a website.\r\n\r\nSettings\r\n********\r\n\r\nThe project is shipped with a ``settings.py`` file that is the default project settings \r\nand you should not edit it if you need different settings. It is highly recommended that \r\nyou create a new settings file where you import the default settings and that you edit \r\nthose needed.\r\n\r\nBy example, for a development environnment you will copy it to a ``dev_settings.py`` \r\nfile that you will use like this with *django-admin* : ::\r\n\r\n django-admin YOURCOMMAND --settings=dev_settings\r\n\r\nFor a production environnment, you will create a ``prod_settings.py`` file where you \r\nimport the default settings and overwrite the required settings like this :\r\n\r\n.. sourcecode:: python\r\n :linenos:\r\n\r\n # -*- coding: utf-8 -*-\r\n \"\"\"\r\n Django settings for Sveetchies demo\r\n \r\n For production environnment, using the default project settings\r\n \"\"\"\r\n from settings import *\r\n \r\n # WEBAPP_ROOT must be manually specified in production\r\n WEBAPP_ROOT = \"/home/django/projects/Sveetchies/demo/\"\r\n \r\n # Database access\r\n DATABASES = {\r\n 'default': {\r\n 'NAME': 'your_database',\r\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\r\n 'USER': 'username',\r\n 'PASSWORD': 'password',\r\n }\r\n }\r\n \r\n # Make this unique, and don't share it with anyone.\r\n SECRET_KEY = 'long_key'\r\n \r\n # SMTP Settings to send Applications error, uncomment to active mail sending\r\n #EMAIL_HOST = 'localhost'\r\n #EMAIL_SUBJECT_PREFIX = '[Sveetchies] '\r\n #SERVER_EMAIL = 'Sveetchies errors <your@email>'\r\n #DEFAULT_FROM_EMAIL = 'Sveetchies <your@email>'\r\n \r\n # Emails receiver for errors if SMTP settings are actived\r\n #ADMINS = (\r\n #('YourName', 'your@email'),\r\n #)\r\n \r\n # Disable all debug mode\r\n DEBUG = False\r\n TEMPLATE_DEBUG = DEBUG\r\n UNIFORM_FAIL_SILENTLY = not DEBUG\r\n \r\n # Another site ID than default\r\n SITE_ID = 1\r\n \r\n # Adapt for WEBAPP_ROOT and STATIC_DIRNAME changes\r\n MEDIA_ROOT = os.path.join(WEBAPP_ROOT, MEDIA_DIRNAME)+\"/\"\r\n STATIC_DIRNAME = '_statics'\r\n STATIC_URL = '/{0}/'.format(STATIC_DIRNAME)\r\n STATIC_ROOT = os.path.join(WEBAPP_ROOT, STATIC_DIRNAME)+\"/\"\r\n STATICFILES_DIRS = (\r\n os.path.join(WEBAPP_ROOT, 'webapp_statics/'),\r\n os.path.join(SVEETCHIES_PATH_INSTALL, 'django/documents/static/'),\r\n )\r\n ADMIN_MEDIA_PREFIX = os.path.join('/', STATIC_DIRNAME, 'admin/')\r\n TEMPLATE_DIRS = (\r\n os.path.join(WEBAPP_ROOT, 'templates/'),\r\n os.path.join(SVEETCHIES_PATH_INSTALL, 'django/documents/templates/documents/'),\r\n )\r\n \r\n # Disable the DebugToolbar in production\r\n MIDDLEWARE_CLASSES = tuple([item for item in list(MIDDLEWARE_CLASSES) if item != 'debug_toolbar.middleware.DebugToolbarMiddleware'])\r\n INSTALLED_APPS = tuple([item for item in list(INSTALLED_APPS) if item != 'debug_toolbar'])\r\n \r\nGenerally the settings you will need to edit will be :\r\n\r\n* ``WEBAPP_ROOT`` is the absolute path to the project, you must define it manually;\r\n* ``DATABASES`` if you use a different database than the default one (This example use \r\n the Django database backend for PostgreSQL, for a different database type you should \r\n see `Django database backends`_;\r\n* ``SECRET_KEY`` is a unique string used to encrypt some data like sessions, for safety reasons \r\n this must not be the same as the default one;\r\n* Settings about email sending, this is used for account registration and to send error \r\n emails. See documentation `Sending email with Django`_ for more details;\r\n* ``SITE_ID`` if you want to use a different host than the default one or than the \r\n development environnment;\r\n\r\nThe static directory configured in this example is ``_statics/`` you will have to create \r\nit first, you can name it as you want but keep in mind that it must different from \r\nthe development version.\r\n\r\n.. NOTE:: If you plan to use a ``dev_settings.py`` or ``prod_settings.py`` or another \r\n settings file different from the default one ``settings.py``, you will need to \r\n specify it to all your command line with ``django-admin``. \r\n \r\n For this just add the option ``--settings=YOUR_SETTING_MODULE`` to your \r\n command lines, where ``YOUR_SETTING_MODULE`` is your settings file name \r\n without the ``.py`` extension.\r\n \r\n You can also define a ``DJANGO_SETTINGS_MODULE`` environment variable with the \r\n settings file name, ``django-admin`` will look at it each time the settings option \r\n is not defined. \r\n\r\nSynchronize data \r\n****************\r\n\r\nYou will need to synchronize the database structure with the project's database models \r\nwith the following command line : ::\r\n\r\n django-admin syncdb\r\n\r\nThe command will ask you if you want to create a superuser, you will need it so do it.\r\n\r\nFinally if you want to use the demonstration data, use the following command line : ::\r\n\r\n django-admin loaddata demo_data.json\r\n\r\nDeployment to production\r\n************************\r\n\r\nYou have to copy all the static files in your static directory to publish : ::\r\n\r\n django-admin collectstatic --settings=prod_settings\r\n\r\nFor more details see documentation on `Django collectstatic`_.\r\n\r\nThen you will have to configure your webserver to serve the project, see the documentation on `Django deployment`_. \r\n\r\nDjangoSveetchies is shipped with a ``dispatcher_sample.fcgi`` file, it is a dispatcher to use with FastCGI that is \r\nprobably the most easy to configure.\r\n\r\nInternationalization and localization\r\n=====================================\r\n\r\nThis application make usage of the `Django internationalization system`_, see the Django documentation about this if \r\nyou want to add a new language translation.\r\n",
"visible": true,
"template": "fixed_relative_with_columns",
"published": "2012-04-27 09:20:20",
"lft": 2,
"order": 1,
"slug": "djangosveetchies-demo"
}
},
{
"pk": 35,
"model": "sveedocuments.page",
"fields": {
"rght": 5,
"level": 1,
"tree_id": 2,
"parent": 1,
"title": "Django CodeMirror",
"author": 1,
"modified": "2012-05-04 20:04:45",
"created": "2012-05-04 20:04:45",
"content": ".. _CodeMirror: http://codemirror.net/\n.. _CodeMirror Documentation: http://codemirror.net/doc/manual.html\n.. _jQuery: http://jquery.com/\n.. _jQuery.axax(): http://api.jquery.com/jQuery.ajax/\n.. _Django CSRF: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/\n.. _Django staticfiles: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/\n.. _Django internationalization system: https://docs.djangoproject.com/en/dev/topics/i18n/\n.. _ReStructuredText: http://docutils.sourceforge.net/rst.html\n.. _qTip2: http://craigsworks.com/projects/qtip2/\n\nIntroduction\n============\n\n**Django-CodeMirror** is a Django application to embed the `CodeMirror`_ editor.\n\nIt was designed to be used in :page:`sveedocuments`, so it is suited for a \n`ReStructuredText`_ environment but `CodeMirror`_ support a large range of syntax \ncoloration modes (PHP, Python, Ruby, Java, HTML, etc..). It is essentialy a jQuery \nplugin on top of `CodeMirror`_ to add some features like :\n\n* A button bar with keyboard shortcuts to use some syntax element in your text;\n* A maximize mode to resize the editor at full browser size;\n* A preview mode;\n* A quicksave option;\n* Support translations with english and french allready shipped;\n* Compatibility with `Django CSRF`_.\n\nLinks\n*****\n\n* Download his \n `PyPi package <http://pypi.python.org/pypi/djangocodemirror>`_;\n* Clone it on his \n `Github repository <https://github.com/sveetch/djangocodemirror>`_;\n* Documentation and demo to come on his \n `DjangoSveetchies page <http://sveetchies.sveetch.net/djangocodemirror/>`_.\n\nRequires\n========\n\nYour project will have to includes a copy of these Javascript libraries :\n\n* `jQuery`_ >= 1.7;\n* `CodeMirror Version 2.24 <http://codemirror.net/codemirror-2.24.zip>`_ recommanded, \n but the last one should work;\n\nInstall\n=======\n\nSettings\n********\n\nIn your *settings* file add the app to your installed apps :\n\n.. sourcecode:: python\n :linenos:\n\n INSTALLED_APPS = (\n ...\n 'djangocodemirror',\n ...\n )\n\nAnd you will need to have a copy of `CodeMirror`_ in your *statics* directory (see \n`Django staticfiles`_). The jQuery library must be called by your templates, \n**Django-CodeMirror** don't do it for you.\n\nUsage\n=====\n\nDjangoCodeMirror\n****************\n\n`DjangoCodeMirror`_ is the `jQuery`_ plugin on top of `CodeMirror`_, it accepts all \n`CodeMirror`_ options and some additional :\n\nfullscreen\n This enable the maximize mode at ``true``. It is enabled by default.\nhelp_link\n Help page link to put in button bar if filled. If the string is empty there will be \n no help button displayed. When clicked the link is opened in a new window.\nquicksave_url\n When the string is not empty, it is used as the URL to send data in **POST** request \n where the view receiver should save the data. This is disabled by default. If the \n ``csrf`` option is enabled, it will be used in the request.\n \n The default sended datas are :\n \n * ``nocache`` : a timestamp used to block some browser caching, this can be ignored;\n * ``content`` : the textarea content.\n \n More datas can be sended with the ``quicksave_datas`` option.\nquicksave_datas\n Expect an object ``{...}`` whose variables will be sended as data in *quicksave* \n request.\n \n Or it can be a *string* that determine a variable name to find the object in the \n global context. This is useful if you want to use a variable that can change and not \n a defined object at page load. \npreview_url\n When the string is not empty, it is used as the URL to send data in **POST** request \n where the view receiver should render the content with a parser. The excepted \n response must return the HTML fragment rendered. This is disabled by default. If the \n ``csrf`` option is enabled, it will be used in the request.\n \n The default sended datas are :\n \n * ``nocache`` : a timestamp used to block some browser caching, this can be ignored;\n * ``content`` : the textarea content.\ncsrf\n Expect a *string* containing the function name which be used to modify a request to \n add it the needed *token* by `Django CSRF`_. The token will be injected in the \n request headers. A ready to use function is allready shipped.\n \n The function have two required arguments :\n \n * xhr : the `jQuery`_ XMLHTTPRequest to be modified;\n * settings : the settings object used with `jQuery.axax()`_.\n \n You should see the option ``beforeSend`` of `jQuery.axax()`_ for more details, this \n is where the csrf function is really used.\ndisplay_cursor_position\n At ``True`` it enable the display of current line and column in the bottom right of \n the editor. This option is enabled by default.\nno_tab_char\n At ``True`` the usage of the tabulation key will not write a tabulation character and \n spaces will be writed in replacment. The number of spaces will be determined from the \n *tabSize* option (default to 4) from CodeMirror.\nundo_buttons\n At ``True`` it display buttons *Undo* and *Redo* in the buttons bar. Enabled by \n default.\nsettings_cookie\n When the string is not empty, it is used as the cookie name where to search settings \n to overwrite the default ones (of Django-CodeMirror).\nsearch_enabled\n Only for your application settings, the plugin doesn't know of this option. At \n ``True`` this will enable the *search & replace* feature of `CodeMirror`_. This is \n enabled by default for `DjangoCodeMirrorField`_ and the demo settings.\n\nA full example of these settings with the plugin :\n\n.. sourcecode:: html\n :linenos:\n \n <div>\n <textarea id=\"id_content\" rows=\"10\" cols=\"40\" name=\"content\"></textarea>\n <script language=\"JavaScript\" type=\"text/javascript\">\n //<![CDATA[\n my_datas = {'foo': 'bar'};\n $(document).ready(function() {\n id_content_codemirror_instance = $('#id_content').djangocodemirror({\n \"mode\": \"rst\",\n \"csrf\": \"CSRFpass\",\n \"fullscreen\": true,\n \"help_link\": \"/help/\",\n \"quicksave_url\": \"/djangocodemirror-sample/quicksave/\",\n \"quicksave_datas\": my_datas,\n \"preview_url\": \"/djangocodemirror-sample/preview/\",\n \"display_cursor_position\": true,\n \"no_tab_char\": true,\n \"undo_buttons\": true,\n \"settings_cookie\": \"djancocodemirror_settings\",\n \"lineNumbers\": true\n });\n });\n //]]>\n </script>\n </div>\n\nThe plugin use some additional libraries (allready shipped) :\n\n* `jquery.cookies <http://plugins.jquery.com/project/Cookie>`_;\n* `qTip2`_;\n\n.. NOTE:: If you directly use the plugin, you will have to load yourself all needed \n libaries, see `Fields medias`_ for a details of these.\n\nCodeMirrorWidget\n****************\n\nThis is the widget to use in your form fields to apply them an instance of \n`DjangoCodeMirror`_ or `CodeMirror`_. It is accessible at \n``djangocodemirror.fields.CodeMirrorWidget``.\n\nUsage example on a form field :\n\n.. sourcecode:: python\n :linenos:\n\n from djangocodemirror.fields import CodeMirrorWidget\n \n class CodeMirrorSampleForm(forms.Form):\n content = forms.CharField(label=u\"Your content\", widget=CodeMirrorWidget)\n \n def save(self, *args, **kwargs):\n return\n\nThe widget accept two additional arguments :\n\n* ``codemirror_only`` A *boolean* to disable the `DjangoCodeMirror`_ usage at benefit of \n `CodeMirror`_. It is ``False`` by default;\n* ``codemirror_attrs`` : A *dict* to define the editor settings. It is empty by default.\n\nAnother example where the ``content`` field will be a `CodeMirror`_ editor with enabled \nline numbers :\n\n.. sourcecode:: python\n :linenos:\n\n from djangocodemirror.fields import CodeMirrorWidget\n \n class CodeMirrorSampleForm(forms.Form):\n content = forms.CharField(label=\"Your content\", widget=CodeMirrorWidget(codemirror_only=True, codemirror_attrs={'lineNumbers':True}))\n \n def save(self, *args, **kwargs):\n return\n\nMedias\n------\n\nThe widget load automatically all his needed medias and static files, you just have to \nput this in your templates : ::\n\n {{ form.media }}\n\nThis behavior is inherited by `DjangoCodeMirrorField`_ and `CodeMirrorField`_.\n\nCodeMirrorField\n***************\n\nThis inherit from ``django.forms.CharField`` to automatically use `CodeMirrorWidget`_ as \nthe widget field. The widget set the ``codemirror_only`` attribute to ``True`` to use \nonly the `CodeMirror`_ editor.\n\nIt take an additional named argument ``codemirror_attrs`` like `CodeMirrorWidget`_, his \ndefault value correspond to the ``default`` setting of `CODEMIRROR_SETTINGS`_.\n\n.. sourcecode:: python\n :linenos:\n\n from django import forms\n from djangocodemirror.fields import CodeMirrorField\n \n class CodeMirrorSampleForm(forms.Form):\n content_codemirror = CodeMirrorField(label=u\"Your content\", codemirror_attrs={'lineNumbers':True})\n \n def save(self, *args, **kwargs):\n return\n\nDjangoCodeMirrorField\n*********************\n\nIt is identical as `CodeMirrorField`_ but for usage of `DjangoCodeMirror`_ as the widget \nfield.\n\nHis default value for ``codemirror_attrs`` correspond to \n`DJANGOCODEMIRROR_DEFAULT_SETTING`_.\n\n.. sourcecode:: python\n :linenos:\n\n from django import forms\n from djangocodemirror.fields import CodeMirrorField\n \n class CodeMirrorSampleForm(forms.Form):\n content_djangocodemirror = DjangoCodeMirrorField(label=u\"Your content\", codemirror_attrs={'lineNumbers':True})\n \n def save(self, *args, **kwargs):\n return\n\nApplication settings\n====================\n\nAll default app settings is located in the ``settings_local.py`` file of \n``djangocodemirror``, you can modify them in your project settings.\n\n.. NOTE:: All app settings are overwritten if present in your project settings with the \n exception of dict variables. This is to be remembered when you want to add a \n new entry in a list variable, you will have to copy the default version in \n your settings with the new entry otherwise default variable will be lost.\n\nCODEMIRROR_FIELD_INIT_JS\n************************\n\n**Type :** *string*\n\nHTML code to instantiate `CodeMirror`_ in form fields, this is a template string (usable \nwith ``String.format()``) which expect two variable places :\n\n* ``{inputid}`` : Will be the unique field id;\n* ``{settings}`` : Will be a JSON string representation of the editor settings.\n\nDJANGOCODEMIRROR_FIELD_INIT_JS\n******************************\n\n**Type :** *string*\n\nThis identical to `CODEMIRROR_FIELD_INIT_JS`_ but for `DjangoCodeMirror`_ usage only.\n\nCODEMIRROR_SETTINGS\n*******************\n\n**Type :** *dict*\n\nThe settings schemes to use with `CodeMirror`_ and `DjangoCodeMirror`_ editors. Each \neditor form fields use this schemes to get their default settings. Note that these \noptions must be suitable to be transformed by the Python JSON parser.\n\nThe default available settings schemes are :\n\n* ``default`` : Only for enable the option to show line numbers;\n* ``djangocodemirror`` : Minimal options for `DjangoCodeMirror`_ (line numbers and mode \n ``rst`` for `ReStructuredText`_);\n* ``djangocodemirror_with_preview`` : Same as ``djangocodemirror`` but enable the \n preview option on ``preview/``;\n* ``djangocodemirror_sample_demo`` : Same as ``djangocodemirror`` but enable all stuff \n needed in the `Sample demonstration`_.\n\nDJANGOCODEMIRROR_DEFAULT_SETTING\n********************************\n\n**Type :** *string*\n\nThe keyword to use to select the default settings with `DjangoCodeMirrorField`_. Note \nthat `CodeMirrorField`_ always use the keyword ``default`` to select his default \nsettings.\n\nDJANGOCODEMIRROR_TRANSLATIONS\n*****************************\n\n**Type :** *list* or *tuple*\n\nA list of paths for available translations.\n\nCODEMIRROR_THEMES\n*****************\n\n**Type :** *list* or *tuple*\n\nA list of paths for available themes to load with `CodeMirror`_. There is actually no \nloaded theme by default, you will have to set one in your `CODEMIRROR_SETTINGS`_\n\nCODEMIRROR_MODES \n****************\n\n**Type :** *list* or *tuple*\n\nA list of tuples for the various syntax coloration modes supported by `CodeMirror`_. \nThis list is generated from the available mode files in `CodeMirror`_.\n\nFields medias\n*************\n\nThe `CodeMirrorWidget`_ widget need some medias to correctly load the editor, all these \nmedias paths are defined in settings and you can change them if needed. Theses paths \nassume to be in your staticfiles directory (see `Django staticfiles`_).\n\nCODEMIRROR_FILEPATH_LIB\n The JavaScript core library of `CodeMirror`_.\nCODEMIRROR_FILEPATH_CSS\n The CSS file of `CodeMirror`_.\nCODEMIRROR_FILEPATH_DIALOG_LIB\n The Javascript componant to enable dialogs of `CodeMirror`_.\nCODEMIRROR_FILEPATH_DIALOG_CSS\n The CSS file used by dialogs componant of `CodeMirror`_.\nCODEMIRROR_FILEPATH_SEARCH_LIB\n The Javascript componant to enable search and replace in `CodeMirror`_.\nCODEMIRROR_FILEPATH_SEARCHCURSOR_LIB\n The Javascript componant to enable search highlights in `CodeMirror`_.\nDJANGOCODEMIRROR_FILEPATH_LIB\n The Javascript core library of `DjangoCodeMirror`_.\nDJANGOCODEMIRROR_FILEPATH_TRANSLATION\n The Javascript componant to enable translations for `DjangoCodeMirror`_.\nDJANGOCODEMIRROR_FILEPATH_CSS\n The CSS file of `DjangoCodeMirror`_.\nDJANGOCODEMIRROR_FILEPATH_BUTTONS\n The Javascript componant of `DjangoCodeMirror`_ to define the avalaible buttons in \n the button bar. Change this path to your own componant if you want to change the \n button bar.\nDJANGOCODEMIRROR_FILEPATH_METHODS\n The Javascript componant of `DjangoCodeMirror`_ to define the internal methods used \n with the syntax buttons. If you add some new button in your own button bar, you have \n to make your own methods file too.\nDJANGOCODEMIRROR_FILEPATH_CONSOLE\n\tThe Javascript componant of `DjangoCodeMirror`_ which define the usage of qTip.\nDJANGOCODEMIRROR_FILEPATH_CSRF\n The Javascript componant of `DjangoCodeMirror`_ used in the editor requests (preview \n or quicksave) to apply `Django CSRF`_.\nDJANGOCODEMIRROR_FILEPATH_COOKIES\n Le plugin `jQuery`_ pour utiliser acc\u00e9der aux cookies, n\u00e9cessaire pour \n `Django CSRF`_.\nQTIP_FILEPATH_LIB\n The JavaScript core library of `qTip2`_.\nQTIP_FILEPATH_CSS\n The CSS file of `qTip2`_.\n\nSample demonstration\n====================\n\nYou can rapidly insert **Django-CodeMirror** in your project in adding \n``djangocodemirror.urls`` to your project ``urls.py`` file. This will use \n``djangocodemirror.views`` which contains the demonstration views.\n\n.. sourcecode:: python\n :linenos:\n\n urlpatterns = patterns('',\n ...\n (r'^djangocodemirror-sample/', include('djangocodemirror.urls')),\n ...\n )\n\nThree views are avalaible :\n\n* The editor demonstration on ``djangocodemirror-sample/`` using `ReStructuredText`_;\n* The preview view ``preview/`` used in editor demo, it require :page:`sveedocuments` to \n work correctly or it will simply return a dummy content. This view accepts only \n **POST** request and return an empty response for all request type (like GET);\n* The quicksave view ``quicksave/`` used in editor demo, doesn't really save anything, \n just do some validation. It require :page:`sveedocuments` to work correctly.\n* A public view ``settings/`` usable to edit some settings for the editor. These \n custom settings will be saved in a cookie. \n\nInternationalization and localization\n=====================================\n\nThis application make usage of the `Django internationalization system`_ only in his \ndemonstration. However the editor is translated with his own system using a javascript \nfile for each available language.\n\nTo add a new language, you will have to add a new javascript file that will register the \nnew available language. Just create a file with this :\n\n.. sourcecode:: javascript\n :linenos:\n\n DCM_Translations[\"NAME\"] = {\n // Translations goes here\n };\n\nWhere ``NAME`` is the language locale name to register and ``// Translations goes here`` \nmust be replaced by the content to translate. To see a full translation see the french \nversion in ``static/djangocodemirror/djangocodemirror.fr.js`` where you can see all the \nstring to translate.\n\nYou can save your file where you want in your project or application, you will just have \nto register it in the setting `DJANGOCODEMIRROR_TRANSLATIONS`_.",
"visible": true,
"template": "fixed_relative_with_columns",
"published": "2012-03-08 18:11:26",
"lft": 4,
"order": 10,
"slug": "djangocodemirror"
}
},
{
"pk": 33,
"model": "sveedocuments.page",
"fields": {
"rght": 7,
"level": 1,
"tree_id": 2,
"parent": 1,
"title": "AutoBreadcrumbs",
"author": 1,
"modified": "2012-04-26 17:58:40",
"created": "2012-04-26 17:58:40",
"content": ".. _breadcrumb: http://en.wikipedia.org/wiki/Breadcrumb_%28navigation%29#Websites\r\n.. _Django internationalization system: https://docs.djangoproject.com/en/dev/topics/i18n/\r\n\r\nIntroduction\r\n============\r\n\r\n**AutoBreadcrumbs** is a Django application to automatically build a breadcrumb in your website like \r\nthis : ::\r\n\r\n Home > Some page > Some child page\r\n\r\nEach *crumb* displays a title with a link to represent a view, the crumb tree is determined from the urls map \r\nof your project, their titles and links are determined from the associated view entries in the breadcrumbs \r\nregistry.\r\n\r\nLinks\r\n*****\r\n\r\n* Download his `PyPi package <http://pypi.python.org/pypi/autobreadcrumbs>`_;\r\n* Clone it on his `Github repository <https://github.com/sveetch/autobreadcrumbs>`_;\r\n* Documentation and demo to come on his `DjangoSveetchies page <http://sveetchies.sveetch.net/autobreadcrumbs/>`_.\r\n\r\nInstall\r\n=======\r\n\r\nIn your *settings* file add **AutoBreadcrumbs** to your installed apps :\r\n\r\n.. sourcecode:: python\r\n :linenos:\r\n\r\n INSTALLED_APPS = (\r\n ...\r\n 'autobreadcrumbs',\r\n ...\r\n )\r\n\r\nThen register his *context processor* :\r\n\r\n.. sourcecode:: python\r\n :linenos:\r\n\r\n TEMPLATE_CONTEXT_PROCESSORS = (\r\n ...\r\n 'autobreadcrumbs.context_processors.AutoBreadcrumbsContext',\r\n ...\r\n )\r\n\r\nAnd finally, as for the *autodiscover* for the admin site (``django.contrib.admin``), you will have to add these \r\ntwo lines in your ``urls.py`` project :\r\n\r\n.. sourcecode:: python\r\n :linenos:\r\n\r\n import autobreadcrumbs\r\n autobreadcrumbs.autodiscover()\r\n\r\nThis is optionnally but if you don't do this, all ``crumbs.py`` file will be ignored.\r\n\r\nUsage\r\n=====\r\n\r\nNote that this app will don't work correctly if you don't have a strong organisation in your \r\nurls map.\r\n\r\n* You must ensure that all your urls are correctly named (see \r\n `Naming URL patterns <https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns>`_);\r\n* Different views must not use the same url;\r\n* Regroup your restricted views on some url paths and don't mix them with non-restricted view urls.\r\n\r\nView registration\r\n*****************\r\n\r\nRegistration\r\n------------\r\n\r\nThe *context processor* makes a search from the current url that is splitted in segments which represent \r\nthe crumbs. For each segment, an entry is searched on his URL name in the breadcrumbs registry in this \r\nstep order :\r\n\r\n#. If the name has an entry in ``settings.AUTOBREADCRUMBS_TITLES``, then use it;\r\n#. If the name has an entry in a ``crumbs.py`` file in one of your apps, then use it;\r\n#. If the view has an attribute ``crumb_titles``, then try to find the URL name to use it, otherwise continue; \r\n#. If the view has an attribute ``crumb_title``, then use it;\r\n\r\nIf none of these steps succeeds to find the URL name, the ressource will be ignored and not be displayed \r\nin the breadcrumbs.\r\n\r\nIf you need to *hide* a ressource from breadcrumbs, just set his URL name to a *None* value, this will act in \r\nignoring the ressource.\r\n\r\nA crumb title value use the Django template system to be rendered and is aware of the context of the template \r\nwhere it is called, so you can use all available template filters, tags and variables in your crumb titles.\r\n\r\n.. NOTE:: ``crumb_titles`` and ``crumb_title`` will be deprecated in the next release as the decorators for *view \r\n functions*.\r\n\r\nApp crumbs\r\n~~~~~~~~~~\r\n\r\nApplications should define their crumbs in a ``crumbs.py`` file like this :\r\n\r\n.. sourcecode:: python\r\n :linenos:\r\n\r\n from autobreadcrumbs import site\r\n from django.utils.translation import ugettext_lazy\r\n \r\n site.update({\r\n ...\r\n 'documents-index': ugettext_lazy('Sitemap'),\r\n ...\r\n })\r\n\r\nNote the usage of ``ugettext_lazy`` to get translated strings, if you don't use the `Django internationalization system`_ in your \r\nproject you can avoid it, but if you plan to use it you must apply ``ugettext_lazy`` on your title strings.\r\n\r\nProject crumbs\r\n~~~~~~~~~~~~~~\r\n\r\nAlso you can register crumbs in your project settings :\r\n\r\n.. sourcecode:: python\r\n :linenos:\r\n\r\n AUTOBREADCRUMBS_TITLES = {\r\n \"pages-index1\": u\"My index\",\r\n \"pages-index2\": u\"My index alternative\",\r\n }\r\n\r\nCrumbs setted in project settings have the higher priority on application crumbs. As for `App crumbs`_ you should use \r\n``ugettext_lazy`` on your title strings.\r\n\r\nTemplate context\r\n****************\r\n\r\nIn all your templates laying that have the global context, two additional variables (`autobreadcrumbs_elements`_ and \r\n`autobreadcrumbs_current`_) will be added by the *context processor*.\r\n\r\nautobreadcrumbs_elements\r\n------------------------\r\n\r\nThis variable will contain the breadcrumb as a list of crumbs in the correct order, where each crumb will be \r\na ``BreadcrumbRessource`` instance. A ``BreadcrumbRessource`` instance contains the following attributes :\r\n\r\n* ``path`` : relative path to the ressource URL;\r\n* ``name`` : the ressource name (that is the name of the URL linked to the ressource);\r\n* ``title`` : the ressource title to be displayed;\r\n* ``view_args`` : argument list given to the ressource view;\r\n* ``view_kwargs`` : named argument list given to the ressource view;\r\n\r\nautobreadcrumbs_current\r\n-----------------------\r\n\r\nThis variable will contains the ``BreadcrumbRessource`` instance of the current crumb, this instance is the same as \r\nthe last list item in the `autobreadcrumbs_elements`_.\r\n\r\nTemplate tags\r\n*************\r\n\r\nThese tags are avalaible after loading their library in your templates : ::\r\n\r\n {% load autobreadcrumb %}\r\n\r\ncurrent_title_from_breadcrumbs\r\n This simply returns the title from the current ressource.\r\nautobreadcrumbs_tag\r\n Builds the breadcrumb HTML using the ``autobreadcrumbs_tag.html`` template.\r\nautobreadcrumbs_links\r\n Builds the breadcrumb HTML using the template strings in ``settings.AUTOBREADCRUMBS_HTML_LINK`` and \r\n ``settings.AUTOBREADCRUMBS_HTML_SEPARATOR``.\r\ncurrentwalkthroughto\r\n Returns the content tag if the current ressource walk through the given ressource URL name.\r\n \r\n Example : ::\r\n \r\n {% currentwalkthroughto 'index' %}This pas walk through the named url 'index'{% endcurrentwalkthroughto %}\r\n \r\n If the test fail, the tag return an empty string.\r\n",
"visible": true,
"template": "fixed_relative_with_columns",
"published": "2012-03-01 16:46:14",
"lft": 6,
"order": 20,
"slug": "autobreadcrumbs"
}
},
{
"pk": 36,
"model": "sveedocuments.page",
"fields": {
"rght": 9,
"level": 1,
"tree_id": 2,
"parent": 1,
"title": "Django-tribune",
"author": 1,
"modified": "2012-04-26 18:22:17",
"created": "2012-04-26 18:22:17",
"content": ".. _Django internationalization system: https://docs.djangoproject.com/en/dev/topics/i18n/\n\nIntroduction\n============\n\nThis Django app is a *chat-like application* with some aspects from *IRC* but with a \nstrong usage of message clocks.\n\n**Message clocks** are always displayed and used in message to reference answer or \nrelation with other messages.\n\nA sample part of Tribune messages will look like this in a plain-text version : ::\n \n 16:15:27 <superman> First\n 16:16:13 Anonymous coward 16:15:27 oh no you don't !\n 16:15:27 <superman> 16:16:13 lier !\n 18:39:01 Mozilla/5.0 Hello world !\n 18:39:05 <superman> 18:39:01 hello\n 18:43:22 Anonymous coward 18:39:01 yo\n\nActually the application includes all the needed batteries but it lack a *rich \ninterface*, this will come soon.\n\nLinks\n*****\n\n* Download his `PyPi package <http://pypi.python.org/pypi/djangotribune>`_;\n* Clone it on his `Github repository <https://github.com/sveetch/djangotribune>`_;\n* Documentation and demo to come on his `DjangoSveetchies page <http://sveetchies.sveetch.net/djangotribune/>`_.\n\nRequires\n========\n\n* `texttable <http://pypi.python.org/pypi/texttable/0.8.1>`_ (used to display \n plain-text backends);\n\nInstallation\n============\n\nActually Django-tribune doesn't requires any dependancy, just register the app in your \nproject settings like this : ::\n\n INSTALLED_APPS = (\n ...\n 'djangotribune',\n ...\n )\n\nThen after you should register the app urls in your project ``urls.py`` : ::\n\n url(r'^tribune/', include('djangotribune.urls')),\n\nOf course you can use another mounting directory than the default ``tribune/`` or even \nuse your own app urls, look at the provided ``djangotribune.urls`` to see what you have \nto map.\n\nAnd finally don't forget to do the Django's *syncdb command* to synchronise models in your \ndatabase.\n\nIf needed you can change some `Application settings`_ in your settings file.\n\n.. NOTE:: The recommended database engine is **PostgreSQL**. With SQLite you could have \n problems because the application make usage of case-insensitive matching \n notably in `Message filtering`_.\n\nUsage\n=====\n\nThe tribune can either be used from the web interface or via remote client applications.\n\nMessage backends\n****************\n\nBackends are available under various formats, each format have his own specificity. \nGenerally, *JSON* is for webapp usage, *XML* for remote clients and *Plain* for some \nnerdz.\n\nFormats\n-------\n\nPlain-text\n Very light, use the raw message, ascendant ordered by default. Url path from the \n tribune is ``remote/``.\nXML\n Very fast, use the remote message render, descendant ordered by default. Url path from \n the tribune is ``remote/xml/``.\nCRAP XML\n The XML version *extended* to suit to old tribune application client. Actually the \n only diff is the XML structure wich is indented. Url path from the tribune is \n ``remote/xml/crap/``.\nJSON\n Very *declarative*, use the web message render, descendant ordered by default. Url \n path from the tribune is ``remote/json/``.\n\nUrl arguments\n-------------\n\nOn backend URLs, you can set somes options by adding URL arguments like this : ::\n \n /remote/?channel=foo&limit=42&direction=asc&last_id=77\n\nchannel\n A string to specify the channel *slug* to use to limit the backend to fetch messages \n only from the given channel. By default, when this argument is not specified, the \n default channel is used. If the specified channel does not exist, the response return \n a *Http404*.\nlimit\n An integer to specify how much message can be retrieved, this value cannot be higher \n than the setting value ``TRIBUNE_MESSAGES_MAX_LIMIT``. Default value come from \n setting ``TRIBUNE_MESSAGES_MAX_LIMIT`` if this option is not specified.\ndirection\n Message listing direction specify if the list should be ordered on ``id`` in \n ascendant or descendant way. Value can be ``asc`` for ascendant or ``desc`` for \n descendant. Each backend can have his own default direction.\nlast_id\n The last ``id`` from wich to retrieve the messages in the interval of the ``limit`` \n option.\n \n For example, with a *tribune* with 42 messages numbered (on their ``id``) from 1 \n to 42, and with default limit to 30 :\n \n * Requesting a backend without any option will return messages from ``id`` 13 to 42;\n * Requesting a backend with option ``limit`` to 10, will return messages from ``id`` \n 33 to 42;\n * Requesting a backend with option ``last_id`` to 15 will return messages from ``id`` \n 16 to 42;\n * Requesting a backend with option ``limit`` to 5 and option ``last_id`` to 15 will \n return messages from ``id`` 38 to 42;\n \n No matter what direction you specify in option, the results will stays identical.\n\nMessage post\n************\n\nFrom web interface\n------------------\n\nThe actual web interface is really simple and don't implement yet a \"rich interface\" with \nJavascript, this is only a simple HTML form with the message list. The rich interface is \nplanned to be implemented in last.\n\nFrom remote client applications\n-------------------------------\n\nRemote clients can send a new message directly within a **POST** request and putting the \ncontent in a ``content`` argument. Validated messages return the last updated backend (from \nthe *knowed* last id). Unvalid message return an Http error (thus it's not \nimplemented yet).\n\n`Url arguments`_ options can be given for the POST request and they will be used for the returned \nbackend in success case.\n\nIn fact, remote client applications should always give the \n``last_id`` option (taken from the last message they know just before sending the POST \nrequest) to receive only messages they didn't know (and not the whole backend).\n\nIf the **POST** request is invalidated (with the form) the returned response will be an \nHttp400 (*Bad Request*) with an explanation in Ascii.\n\nAction commands\n***************\n\nAction commands can be passed in message content, generally this result in doing the \naction without saving a new message although some actions can push a message to save.\n\nAll action command must start with a ``/`` followed (without any separator) by the \naction name and then the action arguments if any. Unvalid action command will often \nresult in saving the content as a new message.\n\nname\n This allow anonymous users to display a custom name instead of their *User-Agent* in \n messages.\n \n Name saving is made by a special cookie, so if the user lose or delete his cookie, \n he lose his custom name.\n \n Add new ua : ::\n \n /name My name is bond\n \n Remove the saved ua : ::\n \n /name\n \n Note that this name will only be directly visible on anonymous user, because \n registered users have their username displayed, but the name (or user-agent) is \n visible on mouseover their username. This is behavior is only on HTML board, remote \n clients have their own behaviors.\nlastfm\n This command use the `LastFM <http://www.last.fm/>`_ `API <http://www.last.fm/api>`_ \n to automatically post a *musical instant* for the current \n track played. This works only the **current** track played, not the last recent \n track played.\n \n You should specify an *username* in argument within the action, it will be used as \n the username account on LastFM from where to search the current track.\n \n Generally, you will do like this : ::\n \n /lastfm instant myname\n \n But if you are authenticated on the tribune and your username is the same as on your \n LastFM account, you can do like this : ::\n \n /lastfm instant\n \n This will result in a message like this :\n \n **====> Moment Artist - Title <====**\nbak\n Intended for users to manage their message filters, see `Message filtering`_ for a \n full explanation.\n\nMessage filtering\n*****************\n\nAll users (registred and anonymous) can manage their own entries for filtering messages \non various pattern. These filters are stored in the user session in an object called BaK \nas *Bo\u00eete \u00e0 Kons* (eg: *Idiots box*) which is persistent in your session.\n\nThat being so an user can lose his session (by a very long inactivity or when logged out) \nso there are option to **save** the filters in your BaK in your profile in database then \nafter you can **load** them in your session when needed.\n\nThere is two way to manage filter from your bak :\n\n* You can use **the easy way** which always assume you use an exact pattern, this is the \n purpose of options **add** and **del** than expects only two arguments, a target and \n the pattern;\n* Or you can use **the verbose way** which expects three arguments respectively the target, \n the kind and the pattern, this is the purpose of options **set** and **remove**;\n\nAvailable arguments\n-------------------\n\ntarget\n The part of the message which will be used to apply the filter, available targets are :\n \n * ``ua`` for the user-agent;\n * ``author`` for the author username only effective for messages from registered used;\n * ``message`` for the message in his raw version (as it was posted).\nkind\n The kind of matching filter that will be used. Only used in the *verbose way* \n options, for the *easy way* this is always forced to an exact matching.\n \n Kinds are written like *operators*, the available kinds are :\n \n * ``*=`` for Case-sensitive containment test;\n * ``|=`` for Case-insensitive containment test;\n * ``==`` for Case-sensitive exact match;\n * ``~=`` for Case-insensitive exact match;\n * ``^=`` for Case-sensitive starts-with;\n * ``$=`` for Case-sensitive ends-with.\npattern\n The pattern to match by the filter. This is a simple string and not a regex pattern. \n You can use space in your pattern without quoting it.\n\nOptions details\n---------------\n\nadd\n The *easy way* to add a new filter. This requires two arguments, the target and the \n pattern like that : ::\n \n /bak add author Badboy\ndel\n The *easy way* to drop a filter. This requires two arguments, the target and the \n pattern that you did have used, like that : ::\n \n /bak del author Badboy\nset\n The *verbose way* to add a new filter. This requires three arguments, the target, the \n kind operator and the pattern like that : ::\n \n /bak set author == Badboy\nremove\n The *verbose way* to drop a filter. This requires three arguments, the target, the \n kind operator and the pattern like that : ::\n \n /bak remove author == Badboy\nsave\n To save your current filters in your session to your profile in database, this works only \n for registered users. \n \n Saving your filters will overwrite all your previous saved filters, so if you just \n want to add new filters, load the previously saved filters before.\n \n This is option does not requires any argument : ::\n \n /bak save\nload\n To load your previously saved filters in your current session. If you allready have \n filters in your current session this will overwrite them.\n \n This is option does not requires any argument : ::\n \n /bak load\non\n To enable message filtering using your filters in current session. A new session have \n message filtering enabled by default.\n \n This is option does not requires any argument : ::\n \n /bak on\noff\n To disable message filtering using your filters in current session. The filters will \n not be dropped out of your session so you can enable them after if needed.\n \n This is option does not requires any argument : ::\n \n /bak off\nreset\n To clear all your filters in current session. You can use this option followed after \n by a save action to clear your saved filters too.\n \n This is option does not requires any argument : ::\n \n /bak reset\n\n.. NOTE:: Messages filters will not be retroactive on displays on remote clients, only \n for new message to come after your command actions. So generally you will have \n to reload your client to see applyed filters on messages posted before your \n command actions.\n\nExamples\n--------\n\nYou want to avoid displaying message from the registered user ``BadBoy``, you will do : ::\n \n /bak add author Badboy\n\nYou want to avoid displaying all message containing a reference to ``http://perdu.com`` you will do : ::\n \n /bak set message *= http://perdu.com\n\nYou want to avoid displaying message from all user with an user-agent from ``Mozilla`` : ::\n \n /bak set ua *= Mozilla\n\nApplication settings\n====================\n\nAll default app settings is located in the ``settings_local.py`` file of ``djangotribune``, you can modify them in your \nproject settings.\n\n.. NOTE:: All app settings are overwritten if present in your project settings with the exception of \n dict variables. This is to be remembered when you want to add a new entry in a list variable, you will have to \n copy the default version in your settings with the new entry otherwise default variable will be lost.\n\nTRIBUNE_LOCKED\n When set to ``True`` all anonymous users will be rejected from any request on remote \n views, post views and board views, only registred users will continue to access to \n these views. \n \n By default this is set to ``False`` so anonymous and registred users have full access \n to any *public views*.\nTRIBUNE_MESSAGES_DEFAULT_LIMIT\n Default message limit to display in backend. \n \n Require an integer, by default this is set to 50.\nTRIBUNE_MESSAGES_MAX_LIMIT\n The maximum value allowed for the message limit option. Limit option used beyond this \n will be set to this maximum value. \n \n Require an integer, by default this is set to 100.\nTRIBUNE_MESSAGES_POST_MAX_LENGTH\n Maximum length (in characters) for the content message. \n \n Require an integer, by default this is set to 500. You have no real limit on this \n value because this is stored in full text field without limit.\nTRIBUNE_SMILEYS_URL\n `Template string <http://docs.python.org/library/string.html#formatstrings>`_ for \n smileys URL, this is where you can set the wanted smiley host. By default this is set to : ::\n \n http://sfw.totoz.eu/{0}.gif\n \n So the host will be *sfw.totoz.eu*.\nTRIBUNE_TITLES\n List of titles randomly displayed on tribune boards. \n \n The default one allready contains many titles.\n\nInternationalization and localization\n=====================================\n\nThis application make usage of the `Django internationalization system`_, see the Django documentation about this if \nyou want to add a new language translation.\n\nPlanned\n=======\n\n* Remote views (JSON and maybe XML too) to get messages targeted on a given clock;\n* A board with a *rich interface*;\n* Optional Captcha system to post new message to enable in settings;\n",
"visible": true,
"template": "fixed_relative_with_columns",
"published": "2012-04-15 05:21:32",
"lft": 8,
"order": 40,
"slug": "djangotribune"
}
},
{
"pk": 32,
"model": "sveedocuments.page",
"fields": {
"rght": 19,
"level": 1,
"tree_id": 2,
"parent": 1,
"title": "Sveetchies-documents",
"author": 1,
"modified": "2012-05-03 17:06:44",
"created": "2012-05-03 17:06:44",
"content": ".. _autobreadcrumbs: http://pypi.python.org/pypi/autobreadcrumbs\n.. _docutils: http://docutils.sourceforge.net/\n.. _Django: https://www.djangoproject.com/\n.. _Django internationalization system: https://docs.djangoproject.com/en/dev/topics/i18n/\n.. _djangocodemirror: http://pypi.python.org/pypi/djangocodemirror\n.. _django-crispy-forms: https://github.com/maraujop/django-crispy-forms\n.. _django-mptt: http://pypi.python.org/pypi/django-mptt/\n.. _ReStructuredText: http://docutils.sourceforge.net/rst.html\n.. _Pygments: http://pygments.org/\n\nIntroduction\n============\n\n**Sveetchies-documents** is a Django application to manage text documents. It work almost like a Wiki \nexcept the collaborative way.\n\nFeatures\n********\n\n* Usage of the `ReStructuredText`_ docutils parser;\n* Rich editor `djangocodemirror`_;\n* Ergonomic form with `django-crispy-forms`_;\n* Usage of `autobreadcrumbs`_ in *Pages* templates;\n* Usage of the Django cache system for the parser rendering;\n* Management board ready to use;\n* Two kind of documents :\n\n * Page : For full page documents with children pages in a sitemap tree;\n * Insert : For documents to insert as fragment in your templates;\n\n* Templatetags to use documents in your templates;\n* Fully internationalized;\n\nLinks\n*****\n\n* Download his `PyPi package <http://pypi.python.org/pypi/sveedocuments>`_;\n* Clone it on his `Github repository <https://github.com/sveetch/sveedocuments>`_;\n* Documentation and demo to come on his `DjangoSveetchies page <http://sveetchies.sveetch.net/sveedocuments/>`_.\n\nRequires\n========\n\n* `docutils`_ >= 0.7;\n* `autobreadcrumbs`_;\n* `djangocodemirror`_;\n* `django-mptt`_ >= 0.5.2;\n* `django-crispy-forms`_ >= 1.1.x;\n\nOptionnaly (but recommended) you can install Pygments to have highlighted syntax in your *sourcecode* block :\n\n* `Pygments`_ >= 1.2.x;\n\nInternationalization and localization\n=====================================\n\nThis application make usage of the `Django internationalization system`_, see the Django documentation about this if \nyou want to add a new language translation.\n",
"visible": true,
"template": "fixed_relative_with_columns",
"published": "2012-03-01 16:43:56",
"lft": 10,
"order": 40,
"slug": "sveedocuments"
}
},
{
"pk": 6,
"model": "sveedocuments.page",
"fields": {
"rght": 12,
"level": 2,
"tree_id": 2,
"parent": 32,
"title": "Install",
"author": 1,
"modified": "2012-05-04 16:01:43",
"created": "2012-05-04 16:01:43",
"content": ".. _ReStructuredText: http://docutils.sourceforge.net/rst.html\n\nIn your project\n===============\n\nSettings\n********\n\nFirst, register the application and his dependancies in your project settings like this :\n\n.. sourcecode:: python\n :linenos:\n\n INSTALLED_APPS = (\n ...\n 'mptt',\n 'crispy_forms',\n 'autobreadcrumbs',\n 'djangocodemirror',\n 'sveedocuments',\n ...\n )\n\nThen you have to add the context processor of :page:`autobreadcrumbs` in your settings :\n\n.. sourcecode:: python\n :linenos:\n\n TEMPLATE_CONTEXT_PROCESSORS = (\n ...\n 'autobreadcrumbs.context_processors.AutoBreadcrumbsContext',\n ...\n )\n\nApplication settings\n--------------------\n\nAll default app settings is located in the ``settings_local.py`` file of ``sveedocuments``, you can modify them in \nyour project settings.\n\n.. NOTE:: All app settings are overwritten if present in your project settings with the exception of \n dict variables. This is to be remembered when you want to add a new entry in a list variable, you will have to \n copy the default version in your settings with the new entry otherwise default variable will be lost.\n\nUrls\n****\n\nYou have to add the application urls to your project, for this the easy way is to include the shipped urls like \nthis :\n\n.. sourcecode:: python\n :linenos:\n\n urlpatterns = patterns('',\n ...\n (r'^documents/', include('sveedocuments.urls')),\n ...\n )\n\nIf needed you can change the mounting directory ``documents/`` to another. For more possibilities you can define your own \nurls for sveedocuments views. *(More details to come)*\n\nDatabase synchronization\n************************\n\nThe application is now installed in your project, you just need to add his tables to your database, you have to do this \nwith the ``django-admin`` command line : ::\n\n django-admin syncdb\n\nKnown Problems and Fixes\n========================\n\nThere is a minor bug in Django with `ReStructuredText`_ when the ``django.contrib.admindocs`` is enabled in your project and \nsome application directives or roles are used with the parser. See the `bug entry <https://code.djangoproject.com/ticket/6681>`_ \nfor more details.\n\nIt happen when your documents contains unknow references like : ::\n\n Following `the way`_ to the tree\n\nWhere ``the way`` has not been declared in your documents.\n\nIf it happens you have two choices, the first one (not recommended) is to patch the ``django/contrib/admindocs/utils.py`` file in your \nDjango installation, just comment the line below :\n\n.. sourcecode:: python\n :linenos:\n \n docutils.parsers.rst.roles.DEFAULT_INTERPRETED_ROLE = 'cmsreference'\n\nThe second choice, is simply to disable ``django.contrib.admindocs`` by removing it from ``settings.INSTALLED_APPS`` and your \n``urls.py`` project. But this is only if you don't need of *admindocs*.\n",
"visible": true,
"template": "fixed_relative_with_columns",
"published": "2012-02-03 10:39:33",
"lft": 11,
"order": 20,
"slug": "install"
}
},
{
"pk": 38,
"model": "sveedocuments.page",
"fields": {
"rght": 14,
"level": 2,
"tree_id": 2,
"parent": 32,
"title": "Usage",
"author": 1,
"modified": "2012-05-05 20:29:28",
"created": "2012-05-05 20:29:28",
"content": "User permissions\r\n================\r\n\r\nTo manage *Pages* or *Instances* users must have the required permissions.\r\n\r\nYou can assign them to user from the *Django administration* interface, they are clear \r\nenough on what they do.\r\n",
"visible": true,
"template": "fixed_relative_with_columns",
"published": "2012-04-27 11:41:28",
"lft": 13,
"order": 30,
"slug": "usage"
}
},
{
"pk": 8,
"model": "sveedocuments.page",
"fields": {
"rght": 18,
"level": 2,
"tree_id": 2,
"parent": 32,
"title": "Utilisation",
"author": 1,
"modified": "2012-04-27 11:42:03",
"created": "2012-04-27 11:42:03",
"content": "Urls\r\n====\r\n\r\nPour des cas plus particuliers par exemple si vous souhaitez utiliser uniquement cette \r\nbrique \u00e0 la racine de votre site, il vous faudra alors ins\u00e9rer et modifier chaque \r\ndirectives dans votre ``urls.py`` par exemple :\r\n\r\n.. sourcecode:: python\r\n :linenos:\r\n\r\n from Sveetchies.django.documents.views.page import HelpPage, PageIndex, PageDetails, PageSource\r\n \r\n urlpatterns = patterns('',\r\n url(r'^$', PageIndex.as_view(), name='documents-index'),\r\n \r\n (r'^board/', include('Sveetchies.django.documents.urls_board')),\r\n \r\n url(r'^documents-help/$', HelpPage.as_view(), name='documents-help'),\r\n url(r'^sitemap/$', PageIndex.as_view(), name='documents-index'),\r\n \r\n url(r'^(?P<slug>[-\\w]+)/$', PageDetails.as_view(), name='documents-page-details'),\r\n url(r'^(?P<slug>[-\\w]+)/source/$', PageSource.as_view(), name='documents-page-source'),\r\n ...\r\n )\r\n\r\nL'interface d'administration des documents et ses autres pages se trouvent dans ``board/``, mais \r\nvous pouvez modifier son nom si besoin. Pour des besoins encore plus particuliers, vous pouvez aussi \r\nint\u00e9grer une version modifi\u00e9e de ``urls_board``.\r\n\r\nViews\r\n=====\r\n\r\nLes urls utilisent les vues suivantes, toute celles li\u00e9s \u00e0 l'interface de gestion sont \r\nen g\u00e9n\u00e9ral prot\u00e9g\u00e9s par des permissions utilisateur.\r\n\r\ndocuments-index\r\n Le plan du site listant l'arborescence compl\u00e8te des pages visibles.\r\ndocuments-preview\r\n Vue permettant la r\u00e9ception d'une requ\u00eate **POST** pour transmettre le contenu \u00e0 pr\u00e9visualiser \r\n avec le parser, c'est une ressource prot\u00e9g\u00e9e n\u00e9cessitant d'\u00eatre identifi\u00e9.\r\ndocuments-help\r\n Page d'aide sur la syntaxe et l'\u00e9diteur, g\u00e9n\u00e9r\u00e9e \u00e0 partir du fichier \r\n ``templates/documents/help.rst`` et non pas \u00e0 partir d'une **Page** des documents.\r\ndocuments-board\r\n Interface de gestion des documents, c'est une ressource prot\u00e9g\u00e9e n\u00e9cessitant d'\u00eatre \r\n identifi\u00e9.\r\ndocuments-page-add\r\n Formulaire de cr\u00e9ation d'une nouvelle page, ressource prot\u00e9g\u00e9e n\u00e9cessitant d'\u00eatre \r\n identifi\u00e9 et avec la permission de cr\u00e9er des pages.\r\ndocuments-page-edit\r\n Formulaire d'\u00e9dition d'une page, ressource prot\u00e9g\u00e9e n\u00e9cessitant d'\u00eatre identifi\u00e9 et \r\n avec la permission de modifier des pages.\r\ndocuments-page-delete\r\n Formulaire de suppression d'une page (et \u00e9ventuelles sous-pages), ressource prot\u00e9g\u00e9e \r\n n\u00e9cessitant d'\u00eatre identifi\u00e9 et avec la permission de supprimer des pages.\r\ndocuments-insert-add\r\n Formulaire de cr\u00e9ation d'un document ins\u00e9rable, ressource prot\u00e9g\u00e9e n\u00e9cessitant d'\u00eatre \r\n identifi\u00e9 et avec la permission de cr\u00e9er des documents ins\u00e9rables.\r\ndocuments-insert-edit\r\n Formulaire d'\u00e9dition d'un document ins\u00e9rable, ressource prot\u00e9g\u00e9e n\u00e9cessitant d'\u00eatre \r\n identifi\u00e9 et avec la permission de modifier des documents ins\u00e9rables.\r\ndocuments-insert-delete\r\n Formulaire de suppression d'un document ins\u00e9rable, ressource prot\u00e9g\u00e9e n\u00e9cessitant d'\u00eatre \r\n identifi\u00e9 et avec la permission de supprimer des documents ins\u00e9rables.\r\ndocuments-page-details\r\n Vue pour afficher la page avec son contenu.\r\ndocuments-page-source\r\n Vue pour afficher la source *brute* du contenu sans aucun rendu par le parser.\r\ndocuments-page-quicksave\r\n Vue de r\u00e9ception d'une requ\u00eate **POST** pour transmettre le contenu \u00e0 sauvegarder, \r\n utilis\u00e9 par la fonction de *sauvegarde rapide* de l'\u00e9diteur sur les **Page**. Ressource \r\n prot\u00e9g\u00e9e n\u00e9cessitant les m\u00eames permissions que **documents-page-edit**.\r\ndocuments-insert-quicksave\r\n sqdsd\r\n\r\nTemplates\r\n=========\r\n\r\nTout les gabarits se trouvent dans le r\u00e9pertoire ``templates/documents/`` de votre \r\ninstallation de **Sveetchies-documents**. Pour utiliser vos propres gabarit, il suffit de \r\nles cr\u00e9er sous le m\u00eame nom dans le r\u00e9pertoire ``templates/documents/`` de votre projet.\r\n\r\npage_index.html\r\n Plan du site, utilis\u00e9 par la vue ``documents-index``.\r\nboard.html\r\n Index de l'interface de gestion, utilis\u00e9 par la vue ``documents-board``.\r\npage_form.html\r\n Formulaire d'une page, utilis\u00e9 par les vues ``documents-page-add`` \r\n et ``documents-page-edit``.\r\npage_delete.html\r\n Formulaire de suppression d'une page, utilis\u00e9 par la vue ``documents-page-delete``.\r\ninsert_form.html\r\n Formulaire d'un document ins\u00e9rable, utilis\u00e9 par les vues ``documents-insert-add`` \r\n et ``documents-insert-edit``.\r\ninsert_delete.html\r\n Formulaire de suppression d'un document ins\u00e9rable, utilis\u00e9 par la \r\n vue ``documents-page-delete``.\r\neditor_supercodemirror_includes.html\r\n Fragment de code inclus automatiquement dans les formulaires pour utiliser \r\n l'\u00e9diteur ``CodeMirror``.\r\neditor_markitup_includes.html\r\n Fragment de code inclus automatiquement dans les formulaires pour utiliser \r\n l'\u00e9diteur ``MarkItUp``.\r\npage_details/default.html\r\n Gabarit simple pour afficher une page. \r\npage_details/columned_bytwo.html\r\n Gabarit pr\u00e9vu pour fonctionner sur deux colonnes, la premi\u00e8re pour le contenu et la \r\n seconde pour le sommaire des titres et la navigation des sous-pages. \r\npage_treemenu.html\r\n Fragment pour g\u00e9n\u00e9rer un menu d'arborescence de pages. Utilis\u00e9 par d\u00e9faut lors \r\n de l'usage du template tag ``document_page_treemenu``.\r\npage_flatmenu.html\r\n Fragment pour g\u00e9n\u00e9rer un menu des pages adjacentes. Utilis\u00e9 par d\u00e9faut lors de \r\n l'usage du template tag ``document_page_flatmenu``.\r\n\r\nTemplates tags et filtres\r\n=========================\r\n\r\nLes diff\u00e9rentes filtres et tags disponibles dans les gabarits d\u00e8s lors qu'ils ont \r\n\u00e9t\u00e9 import\u00e9s.\r\n\r\ndocuments_markup\r\n****************\r\n\r\n\u00c0 importer dans vos templates via la balise ``{% load documents_markup %}``.\r\n\r\nsource_render\r\n Filtre de rendu par le parser du texte fournit, accepte un argument optionnel pour sp\u00e9cifier \r\n un nom cl\u00e9 de configuration de parser \u00e0 utiliser par exemple ``{{ myvar|source_render:\"mysettings\" }}``.\r\ndocument_render\r\n Filtre de rendu du contenu d'une instance de ``Page`` ou ``Insert``, accepte un argument optionnel pour \r\n sp\u00e9cifier un nom cl\u00e9 de configuration de parser \u00e0 utiliser par \r\n exemple ``{{ page_instance|document_render:\"mysettings\" }}``. \r\n Le contenu renvoy\u00e9 est directement celui du parser sans ajout ni utilisation de gabarit.\r\ndocument_toc\r\n Filtre g\u00e9n\u00e9rant le TOC (sommaire) des titres du contenus. Renvoi une arborescence sous forme \r\n d'une liste \u00e0 puce si le document contient bien des titres. Accepte les m\u00eames arguments \r\n que ``document_render``.\r\n\r\ndocuments_utils\r\n***************\r\n\r\n\u00c0 importer dans vos templates via la balise ``{% load documents_utils %}``.\r\n\r\npprint_recurse\r\n Tag qui renvoi une liste \u00e0 puce r\u00e9cursive de toute les relations d'un objet. C'est un tag \r\n tr\u00e8s particulier utilis\u00e9 en interne pour lister les relations d'un objet lors de sa \r\n suppression. En th\u00e9orie vous n'avez pas utilit\u00e9 de ce tag.\r\ndocument_insert\r\n Tag pour utiliser un document ins\u00e9rable dans n'importe quel autre template dans votre projet. \r\n N\u00e9cessite un argument qui peut \u00eatre soit une chaine de caract\u00e8res contenant le *slug* du \r\n document \u00e0 utiliser, soit directement l'instance d'un document ins\u00e9rable. Deux arguments \r\n optionnels sont possibles, le premier pour un nom cl\u00e9 de configuration de parser \u00e0 utiliser, \r\n le second pour un entier qui sp\u00e9cifie le niveau minimale des titres de premier niveau (\u00e0 3 \r\n il n'y aura jamais de ``h1`` ou de ``h2``). Notez que ce dernier argument permet d'\u00e9craser \r\n une valeur d\u00e9j\u00e0 d\u00e9finie dans les configurations par d\u00e9faut du parser.\r\ndocument_page_treemenu\r\n Tag pour g\u00e9n\u00e9rer un menu d'arborescence de pages \u00e0 partir d'un point donn\u00e9 (soit une Page, \r\n soit la racine de toute les pages), l'arborescence n'inclue pas le point de d\u00e9part (une \r\n instance ou la racine). Requiert un argument pour sp\u00e9cifier soit un *slug* d'une page, soit \r\n une instance de Page, soit ``0`` pour signifier de commencer \u00e0 partir de la racine de \r\n l'arborescence de toute les pages. Accepte un argument optionnel pour sp\u00e9cifier un gabarit \r\n sp\u00e9cifique \u00e0 utiliser autre que celui par d\u00e9faut.\r\ndocument_page_flatmenu\r\n Tag pour g\u00e9n\u00e9rer un menu des pages adjacentes d'une page ou de la racine (auquel cas ce ne \r\n sont pas les pages adjacentes mais les pages de premier niveau). Accepte les m\u00eames \r\n arguments que ``document_page_treemenu``.\r\ndocument_context\r\n Tag g\u00e9n\u00e9rant le rendu, un sommaire des titres automatiques et la navigation sur les sous-pages \r\n de la page en cours. Ce tag ne modifie pas ni n'injecte de html dans le template, \u00e0 la place \r\n les variables suivantes sont ajout\u00e9s dans le contexte du template :\r\n \r\n * ``document_toc`` : Fragment HTML d'une liste \u00e0 puces r\u00e9cursive pour l'arborescence des \r\n titres de la page;\r\n * ``document_navigation`` : Queryset des sous-pages de la page en cours, \u00e0 exploiter avec la \r\n m\u00e9thode ``recursetree`` de ``mptt``;\r\n * ``document_render`` : Fragment HTML du rendu du contenu par le parser;\r\n \r\n Les \u00e9l\u00e9ments ``document_toc`` et ``document_render`` b\u00e9n\u00e9ficient du cache.\r\n\r\n\u00c9diteurs de texte\r\n=================\r\n\r\n:page:`djangocodemirror` est l'\u00e9diteur par d\u00e9faut, il repose sur **CodeMirror** qui a le grand avantage \r\nde poss\u00e9der une coloration syntaxique de texte.\r\n\r\n.. figure:: /static/docs/supercodemirror_editor.png\r\n :alt: CodeMirror en mode \u00e9dition\r\n :class: left\r\n \r\n Le mode \u00e9dition avec la coloration syntaxique du contenu en train d'\u00eatre \u00e9dit\u00e9.\r\n\r\n.. figure:: /static/docs/supercodemirror_preview.png\r\n :alt: CodeMirror en mode \u00e9dition\r\n :class: left\r\n \r\n Le mode pr\u00e9visualisation avec le contenu rendu par le parser.\r\n\r\nCache\r\n=====\r\n\r\nLe syst\u00e8me utilise le cache de Django pour mettre en m\u00e9moire certains \u00e9l\u00e9ments de rendus \r\nli\u00e9s au parser, aucune autre partie n'est mis en cache (transaction base de donn\u00e9es, etc..).\r\n\r\nLa gestion du temps de vie de ces caches d\u00e9pends de votre configuration de votre cache dans les settings, \r\ncependant une invalidation de cache est effectu\u00e9e \u00e0 chaque sauvegarde d'une instance ou de sa suppression.\r\n\r\nSi votre projet ne n\u00e9cessite pas d'utilisation du cache, il vous suffit de l'ignorer, par d\u00e9faut si il n'est \r\npas configur\u00e9 dans les *settings*, Django n'utilise pas de cache.\r\n",
"visible": false,
"template": "fixed_relative_with_columns",
"published": "2012-02-06 03:24:37",
"lft": 15,
"order": 30,
"slug": "utilisation"
}
},
{
"pk": 11,
"model": "sveedocuments.page",
"fields": {
"rght": 17,
"level": 3,
"tree_id": 2,
"parent": 8,
"title": "Aide \u00e0 l'\u00e9dition",
"author": 1,
"modified": "2012-04-19 19:45:39",
"created": "2012-04-19 19:45:39",
"content": ".. _ReStructuredText: http://docutils.sourceforge.net/rst.html\r\n\r\nL'\u00e9dition se fait uniquement dans la syntaxe de `ReStructuredText`_, l'insertion directe de HTML \r\nn'est en g\u00e9n\u00e9ral pas permise.\r\n\r\nSyntaxe de ReStructuredText\r\n===========================\r\n\r\nLe principe de `ReStructuredText`_ (ou **ReST**) est de pouvoir r\u00e9diger son contenu en texte brut sans \r\nbalisages avec une syntaxe \u00e9volu\u00e9e qui permet de conserver un aspect lisible et une mise en \u00e9vidence \r\nde l'information.\r\n\r\nIl y a deux types d'\u00e9l\u00e9ments de syntaxe, les \u00e9l\u00e9ments dits *en ligne* comme la mise en gras ou en \r\nitalique et les \u00e9l\u00e9ments du types *blocs* tel qu'un paragraphe ou une liste \u00e0 puce. Sur ces derniers la \r\nchose principale \u00e0 retenir est de toujours respecter l'indentation lors de vos retours \u00e0 la ligne explicites.\r\n\r\nVous pouvez retrouver les documentations originales de RestructuredText pour plus de d\u00e9tails si besoin (tous \r\nen anglais) :\r\n\r\n* `Introduction \u00e0 la syntaxe <http://docutils.sourceforge.net/docs/user/rst/quickstart.html>`_; \r\n* `R\u00e9f\u00e9rence rapide de la syntaxe <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_;\r\n* `Un R\u00e9sum\u00e9 de la syntaxe en version texte <http://docutils.sourceforge.net/docs/user/rst/cheatsheet.txt>`_;\r\n* `Sp\u00e9cification compl\u00e8te de la syntaxe <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html>`_.\r\n\r\n\u00c9l\u00e9ments en lignes\r\n******************\r\n\r\nLes \u00e9l\u00e9ments communs de mise en forme tel que :\r\n\r\n* La mise en **gras** avec ``**gras**``;\r\n* La mise en *italique* avec ``*italique*``;\r\n* La mise en ``code litt\u00e9ral`` avec ````code litt\u00e9ral````;\r\n\r\nLiens\r\n*****\r\n\r\nIl y a diverses possibilit\u00e9s de cr\u00e9er des liens et de diff\u00e9rents types. Avec `ReStructuredText`_ on utilise plut\u00f4t le \r\nterme de **r\u00e9f\u00e9rence** au lieu de lien.\r\n\r\nLien externe direct\r\n-------------------\r\n\r\nPour un simple lien ponctuel on utilise une **r\u00e9f\u00e9rence externe directe** : ::\r\n\r\n Mon texte avec mon `Lien <http://perdu.com/>`_ et voila.\r\n\r\nR\u00e9f\u00e9rence interne\r\n-----------------\r\n\r\nD\u00e8s lors que vous comptez utiliser une m\u00eame URL plusieurs fois dans un m\u00eame document, il faut utiliser une **r\u00e9f\u00e9rence \r\ninterne** qui s'apparente une ancre sauf qu'elle peut faire r\u00e9f\u00e9rence aussi bien \u00e0 une position dans le document (l\u00e0 \r\no\u00f9 elle a \u00e9t\u00e9 d\u00e9finie) qu'\u00e0 une URL.\r\n\r\nPar exemple : ::\r\n\r\n .. _Mon lien perdu: http://perdu.com\r\n\r\nPourra ensuite \u00eatre utilis\u00e9 comme une r\u00e9f\u00e9rence interne de la fa\u00e7on suivante : ::\r\n\r\n Mon texte avec mon `Mon lien perdu`_ et voila.\r\n\r\nSi vous utilisez plusieurs fois une m\u00eame URL (on parle bien d'URL compl\u00e8te et pas simplement de son \r\ndomaine), `ReStructuredText`_ vous en avertira.\r\n\r\nAncre\r\n-----\r\n\r\nComme annonc\u00e9 plus haut, vous pouvez aussi cr\u00e9er une r\u00e9f\u00e9rence interne qui servira d'ancre \u00e0 la position \r\nou elle a \u00e9t\u00e9 d\u00e9finie.\r\n\r\nPar exemple : ::\r\n\r\n .. Ma super position:\r\n \r\n Mon texte lorem ipsum.\r\n \r\n ...\r\n\r\nPermettra d'utiliser la r\u00e9f\u00e9rence interne comme une ancre de la fa\u00e7on suivante : ::\r\n\r\n Vous pouvez retrouver plus de d\u00e9tails \u00e0 `Ma super position`_.\r\n\r\n\u00c0 noter qu'il est inutile de cr\u00e9er des r\u00e9f\u00e9rences internes pour les `Titres`_ car ils le sont tous \r\nd\u00e9j\u00e0 automatiquement.\r\n\r\n\u00c9l\u00e9ments en blocs\r\n*****************\r\n\r\nG\u00e9n\u00e9ralement tout les \u00e9l\u00e9ments en blocs doivent \u00eatre s\u00e9par\u00e9s par une ligne vide (ou contenant juste \r\nl'indentation en cours) sinon il y a risque de confusion dans la mise en forme. De fait si vous \r\nrespectez cette indentation vous pouvez aussi imbriquer plusieurs blocs diff\u00e9rents.\r\n\r\nLe bloc le plus simple est le paragraphe, c'est celui par d\u00e9faut lorsque vous r\u00e9digez simplement \r\nvotre contenu sans indentation ou autre pr\u00e9fixe de ligne ou de *directive*. \u00c0 noter que \r\n`ReStructuredText`_ ne tient pas compte de vos retours de ligne dans vos paragraphes par \r\nexemple la source suivante : ::\r\n\r\n Nam ultrices venenatis tempus. \r\n Sed amet.\r\n\r\nNe rend qu'un seul paragraphe :\r\n\r\n Nam ultrices venenatis tempus. Sed amet.\r\n\r\nAlors que la source suivante : ::\r\n\r\n Nam ultrices venenatis tempus. \r\n \r\n Sed amet.\r\n\r\nProduit deux paragraphes :\r\n\r\n Nam ultrices venenatis tempus. \r\n \r\n Sed amet.\r\n\r\nTitres\r\n------\r\n\r\nLes titres tiennent sur une ligne et doivent \u00eatre compl\u00e8tement souslign\u00e9s sur toute leur longueur, \r\npar exemple : ::\r\n\r\n Titre 1\r\n =======\r\n \r\n Mon texte..\r\n\r\nEt valide, mais pas l'\u00e9l\u00e9ment suivant : ::\r\n\r\n Titre 1\r\n =====\r\n \r\n Mon texte..\r\n \r\nUn titre ouvre ce qu'on apelle une **section**. Lorsque vous ouvrez un titre dans une section, cela ouvre une \r\nsous section et ainsi de suite jusqu'\u00e0 un autre titre. Mais sauf cas particulier, ceci vous est totalement transparent.\r\n\r\nTout les titres sont des r\u00e9f\u00e9rences internes que vous pouvez utiliser comme lien interne au document par exemple : ::\r\n\r\n Un lien vers le titre `\u00c9l\u00e9ments en blocs`_.\r\n\r\nDonnera :\r\n\r\n Un lien vers le titre `\u00c9l\u00e9ments en blocs`_.\r\n\r\nVous pouvez utiliser les caract\u00e8res que vous souhaitez parmi ``=``, ``*``, ``-``, ``_``, ``#`` entre autres pour \r\nsoulign\u00e9s vos titres, ceci ne pointant pas vers un niveau de titre particulier car ce dernier est calcul\u00e9 \r\nautomatiquement selon l'ordre d'utilisation dans ses *sections*.\r\n\r\nListes \u00e0 puces et num\u00e9rot\u00e9es\r\n----------------------------\r\n\r\nLes listes \u00e0 puces sont simplement d\u00e9clar\u00e9es en ajoutant respectivement ``*`` ou ``#.`` suivi d'un espace et \r\nvotre texte pour une liste \u00e0 puce ou une liste num\u00e9rot\u00e9e. Pour introduire une sous liste, il faut la s\u00e9parer \r\navec une ligne vide avant et apr\u00e8s. Par exemple la source suivante : ::\r\n\r\n * \u00e9l\u00e9ment 1\r\n * \u00e9l\u00e9ment 2\r\n \r\n #. Sous \u00e9l\u00e9ment 2.1\r\n #. Sous \u00e9l\u00e9ment 2.2\r\n \r\n * \u00e9l\u00e9ment 3\r\n * \u00e9l\u00e9ment 4 avec un retour\r\n forc\u00e9 \u00e0 la ligne\r\n * \u00e9l\u00e9ment 5\r\n\r\nDonnera le r\u00e9sultat suivant :\r\n\r\n * \u00e9l\u00e9ment 1\r\n * \u00e9l\u00e9ment 2\r\n \r\n #. Sous \u00e9l\u00e9ment 2.1\r\n #. Sous \u00e9l\u00e9ment 2.2\r\n \r\n * \u00e9l\u00e9ment 3\r\n * \u00e9l\u00e9ment 4 avec un retour\r\n forc\u00e9 \u00e0 la ligne\r\n * \u00e9l\u00e9ment 5\r\n\r\nCitations\r\n---------\r\n\r\nUne citation se fait simplement en indentant chaque ligne de votre contenu, par exemple : ::\r\n\r\n Nam ultrices **venenatis** tempus. \r\n *Sed amet*.\r\n\r\nRend une citation :\r\n\r\n Nam ultrices **venenatis** tempus. \r\n *Sed amet*.\r\n\r\nTexte pr\u00e9format\u00e9\r\n----------------\r\n\r\n\u00c0 la mani\u00e8re des citations, on peut citer du texte ou du code sans qu'il ne soit interpr\u00eat\u00e9 \r\nsur sa syntaxe par le parser, il suffit de pr\u00e9c\u00e9der le contenu de ``::`` et d'indenter \r\nle contenu, par exemple : ::\r\n\r\n ::\r\n \r\n Praesent eget **nulla** vitae lectus nullam.\r\n \r\n * \u00e9l\u00e9ment 1\r\n * \u00e9l\u00e9ment 2\r\n \r\nDonnera :\r\n \r\n::\r\n\r\n Praesent eget **nulla** vitae lectus nullam.\r\n \r\n * \u00e9l\u00e9ment 1\r\n * \u00e9l\u00e9ment 2\r\n\r\nMais la fa\u00e7on la plus \u00e9vidente est simplement d'ajouter ``::`` \u00e0 la fin de la ligne du bloc \r\npr\u00e9c\u00e9dant, par exemple : ::\r\n\r\n Mon annonce de citation pr\u00e9format\u00e9e : ::\r\n \r\n Praesent eget **nulla** vitae lectus nullam.\r\n\r\nDonnera :\r\n\r\n Mon annonce de citation pr\u00e9format\u00e9e : ::\r\n \r\n Praesent eget **nulla** vitae lectus nullam.\r\n\r\nCode source\r\n-----------\r\n\r\nIl est possible d'afficher un bloc de code source avec une coloration syntaxique selon son format. \r\nCe bloc permet aussi de mettre en \u00e9vidence certaines lignes du code source et d'afficher ou la \r\nnum\u00e9rotation des lignes.\r\n\r\nPour un code source en **Javascript** sans num\u00e9rotation, la source suivante : ::\r\n\r\n .. sourcecode:: javascript\r\n :linenos:\r\n \r\n function foobar(arg) {\r\n var foo = 'bar';\r\n var bar = arg*5;\r\n return false;\r\n };\r\n \r\n FOO = {\r\n toto: true,\r\n hello: 'world'\r\n };\r\n\r\nDonnera :\r\n\r\n.. sourcecode:: javascript\r\n\r\n function foobar(dummyarg) {\r\n var foo = 'bar';\r\n var bar = dummyarg*5;\r\n return false;\r\n };\r\n \r\n FOO = {\r\n toto: true,\r\n hello: 'world'\r\n };\r\n\r\nOu pour un code source en **Python** avec num\u00e9rotation des lignes et mise en \u00e9vidence de \r\ncertaines lignes : ::\r\n\r\n .. sourcecode:: python\r\n :linenos:\r\n :hl_lines: 1,6\r\n \r\n class foobar(object):\r\n def __init__(self, dummyarg):\r\n self.plop = True\r\n \r\n FOO = {\r\n 'toto': True,\r\n 'hello': 'world',\r\n }\r\n\r\nDonnera :\r\n\r\n.. sourcecode:: python\r\n :linenos:\r\n :hl_lines: 1,6\r\n\r\n class foobar(object):\r\n def __init__(self, dummyarg):\r\n self.plop = True\r\n \r\n FOO = {\r\n 'toto': True,\r\n 'hello': 'world',\r\n }\r\n",
"visible": true,
"template": "fixed_relative_with_columns",
"published": "2012-02-11 08:00:03",
"lft": 16,
"order": 1,
"slug": "aide-edition"
}
},
{
"pk": 39,
"model": "sveedocuments.page",
"fields": {
"rght": 21,
"level": 1,
"tree_id": 2,
"parent": 1,
"title": "Sveetchies-accounts",
"author": 1,
"modified": "2012-05-03 19:49:55",
"created": "2012-05-03 19:49:55",
"content": ".. _autobreadcrumbs: http://pypi.python.org/pypi/autobreadcrumbs\r\n.. _Django: https://www.djangoproject.com/\r\n.. _django-crispy-forms: https://github.com/maraujop/django-crispy-forms\r\n.. _django-simple-captcha: https://github.com/mbi/django-simple-captcha\r\n.. _django-registration: http://pypi.python.org/pypi/django-registration\r\n\r\nIntroduction\r\n============\r\n\r\n**Sveetchies-account** is a `Django`_ application to embed all the registration stuff using \r\n`django-registration`_ and `django-simple-captcha`_.\r\n\r\nThis is not really intended to be a generic app, so use it at your own risk.\r\n\r\nActually this is just an implementation of an inherited `django-registration`_ backend with \r\n`django-simple-captcha`_ usage.\r\n\r\nLinks\r\n*****\r\n\r\n* Download his `PyPi package <http://pypi.python.org/pypi/sveeaccounts>`_;\r\n* Clone it on his `Github repository <https://github.com/sveetch/sveeaccounts>`_;\r\n* Documentation and demo to come on his \r\n `DjangoSveetchies page <http://sveetchies.sveetch.net/sveeaccounts/>`_.\r\n\r\nRequires\r\n========\r\n\r\n* `autobreadcrumbs`_;\r\n* `django-registration`_ >= 0.8;\r\n* `django-simple-captcha`_ >= 0.3.4;\r\n* `django-crispy-forms`_ >= 1.1.x;\r\n\r\nInstall\r\n=======\r\n\r\nSettings\r\n********\r\n\r\nIn your *settings* file add the app to your installed apps :\r\n\r\n.. sourcecode:: python\r\n :linenos:\r\n\r\n INSTALLED_APPS = (\r\n ...\r\n 'sveeaccounts',\r\n ...\r\n )\r\n",
"visible": true,
"template": "fixed_absolute",
"published": "2012-05-03 06:47:39",
"lft": 20,
"order": 60,
"slug": "sveeaccounts"
}
},
{
"pk": 40,
"model": "sveedocuments.page",
"fields": {
"rght": 4,
"level": 0,
"tree_id": 3,
"parent": null,
"title": "Development notes",
"author": 1,
"modified": "2012-05-05 19:41:09",
"created": "2012-05-05 19:41:09",
"content": "Django internationalization\r\n===========================\r\n\r\nFirst need is to create a local directory where to put dictionnaries, do this from the \r\napp or project directory : ::\r\n\r\n mkdir locale\r\n\r\nTo crawl application and make a \"fr\" (eg: French) translations dictionnary : ::\r\n\r\n django-admin.py makemessages --no-wrap -l fr\r\n\r\nIf your key strings are writted in english, there is no need to create an english \r\ndictionnary as this will be the default language used.\r\n\r\nThis will create a file ``locale/fr/django.po``\r\n\r\nThen when dictonnaries have been translated, to publish them : ::\r\n\r\n django-admin.py compilemessages\r\n\r\nThis work only on projects, for publishing application locales, you need to use a \r\nsetting : ::\r\n \r\n django-admin.py compilemessages --pythonpath=../../gits/ --settings=DjangoSveetchies.settings\r\n\r\nAfter changes, you will have to make Django crawling your application to find new \r\nstrings, modified strings and deleted strings : ::\r\n\r\n django-admin.py makemessages --no-wrap -a\r\n\r\nThen update your translation dictionnaries and re-compiles them. \r\n\r\nGithub\r\n======\r\n\r\nFirst repository init\r\n*********************\r\n\r\nCreate a new repository with your github account and from your project/app directory \r\nto publish on repository : ::\r\n \r\n github init\r\n\r\nThen add/edit your files and make your first commit : ::\r\n \r\n github commit -m \"First commit\"\r\n\r\nAnd finally to push it on Github : ::\r\n \r\n git remote add origin git@github.com:sveetch/sveeaccounts.git\r\n git push -u origin master\r\n \r\nAfter the first push, you can simply push your commits with the command : ::\r\n \r\n git push\r\n\r\nAdd tags\r\n********\r\n\r\nMake your changes, commit them, this will result in something like this : ::\r\n \r\n [master abc0123] Some changes\r\n\r\nWhere ``abc0123`` is the commit hash, note it. And now create the tag \"1.442\" and link \r\nit to your commit, like this : ::\r\n \r\n git tag -a 1.42 abc0123\r\n\r\nYou can check in history to see your tag associated to the commit : ::\r\n \r\n git log --oneline --decorate --graph\r\n\r\nAnd finally when you're done, push the commit and his tag : ::\r\n \r\n git push --tags\r\n\r\nPyPi\r\n====\r\n\r\nThis is for packaging modules on the PyPi service with setuptools.\r\n\r\nFirst, the module need a ``setup.py`` file to contains all informations about the \r\npackage.\r\n\r\nWhen it's fully and correctly filled, check it with : ::\r\n\r\n\tpython setup.py sdist\r\n \r\nIt will create a ``dist/`` directory where setuptools will try to make a tarball from \r\nthe given directives in ``setup.py``.\r\n\r\nIf it's successful, you have to register your package and upload it. Before this you \r\nneed to create an account on PyPi. Then do : ::\r\n\r\n\tpython setup.py register\r\n\r\nYour package should be registred on PyPi, then upload it : ::\r\n\r\n\tpython setup.py sdist upload\r\n\r\nAnd *voila*.",
"visible": true,
"template": "fixed_relative_with_columns",
"published": "2012-05-03 06:50:18",
"lft": 1,
"order": 100,
"slug": "development-notes"
}
},
{
"pk": 41,
"model": "sveedocuments.page",
"fields": {
"rght": 3,
"level": 1,
"tree_id": 3,
"parent": 40,
"title": "Crash tests",
"author": 1,
"modified": "2012-05-04 19:20:43",
"created": "2012-05-04 19:20:43",
"content": "This is a document to test some things to check if they turned nasty in sveedocuments.\n\nThere is the bug with django and rest that will raise if `django-admindoc` is enabled in \nurls and if some documents contains `unknown references`_.\n\nThis is a test to check the github hack export for sourcedode :\n\n.. sourcecode:: python\n\n class Foobar(object):\n def __init__(self):\n self.greetings = \"Hello World\"\n\nAnd the same thing for sourcecode with linenos :\n\n.. sourcecode:: python\n :linenos:\n\n class Foobar(object):\n def __init__(self):\n self.greetings = \"Hello World\"\n\nAnd the same thing for sourcecode with hl_lines :\n\n.. sourcecode:: python\n :linenos:\n :hl_lines: 2,3\n\n class Foobar(object):\n def __init__(self):\n self.greetings = \"Hello World\"\n",
"visible": true,
"template": "fixed_absolute",
"published": "2012-05-04 18:58:27",
"lft": 2,
"order": 10,
"slug": "crash-tests"
}
},
{
"pk": 2,
"model": "sveedocuments.page",
"fields": {
"rght": 2,
"level": 0,
"tree_id": 4,
"parent": null,
"title": "Todolist",
"author": 1,
"modified": "2012-05-05 20:31:58",
"created": "2012-05-05 20:31:58",
"content": ".. contents::\n\nTemplate tags\n*************\n\n#. Better templatetag for menu generation, there are a bit tricky;\n#. Find a solution for the context templatetag that must be called two time because \n generated context by templatetags are accessible only from there current block; \n\nBoard interface\n***************\n\n#. Children of hidden pages should be with the same opacity as their parent and they \n should be resumed (only title, publish date and maybe visility but no action links);\n#. Feature to edit order attribute on Pages directly from the board;\n#. Feature to edit visibility attribute on Pages directly from the board;\n#. Announce to create a first object for Page and Insert when they don't have any object yet;\n#. Better layout for delete page forms;\n\nIdeas\n*****\n\n* Drag'n'drop on board to organize Pages;\n* Revision system for Pages (and Insert?);\n* Add new attribute(s) like a stylesheet content to add custom styles on a Page;\n* Improve cache management;\n* Easy images management;\n",
"visible": true,
"template": "fixed_absolute",
"published": "2012-01-24 14:08:41",
"lft": 1,
"order": 100,
"slug": "todolist"
}
}
]
Something went wrong with that request. Please try again.