Re: Alternatives to markup and comments modules

2014-08-08 Thread Collin Anderson
Create your own custom template filter for the markdown. Django's filter
didn't do much besides import markdown and send the content through that.

Comments now live here: https://github.com/django/django-contrib-comments

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S4FdYu-f8ShRMUPDXfzqVqBt-2wLWaL0Mrv3GcZSP%2BDFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Alternatives to markup and comments modules

2014-08-08 Thread Vibhu Rishi
I just picked up an old project i was working on ( wasn't working on it for
a year almost), and now the comments and markup modules are not working. It
seems that they have been depricated in 1.6  ( project was in 1.4 ).

What are the current alternatives for these ?

Vibhu

-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPiONwn%2BcAAJ3pPMzPJEGBd4apvqwdhjsCGj75tff7kaA_rXeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Alex Leonhardt
Thanks Brad - i had a look and didnt get it to work, but thanks to your 
hint I did get this to work : 

https://django-markup.readthedocs.org/en/latest/
with 
https://django-markup.readthedocs.org/en/latest/usage_templates.html

Cheers!
Alex


On Monday, 5 May 2014 21:22:21 UTC+1, Brad Pitcher wrote:
>
> django.contrib.markup has been deprecated. You could try using the 
> standalone project that is a copy of the same code from django:
>
> pip install django_markup_deprecated
>
> Then add "markup_deprecated" to your INSTALLED_APPS instead of 
> django.contrib.markup.
>
> -
> Brad Pitcher
>
>
> On Mon, May 5, 2014 at 1:07 PM, Alex Leonhardt  > wrote:
>
>> fwiw - this is the tutorial I was trying : 
>> http://www.creativebloq.com/netmag/get-started-django-7132932 it 
>> mentions django.contrib.markup ... but that doesnt seem to work :\ 
>>
>>
>> On Monday, 5 May 2014 16:44:47 UTC+1, Alex Leonhardt wrote:
>>>
>>> Hi all,
>>>
>>> am new to django and followed a tiny tutorial to start off - I wanted to 
>>> add the ability to use Markdown syntax in the blog posts. It was suggested 
>>> to use django.contrib.markup, but that wont work anymore ( i guess it's 
>>> been removed ) - what do I need to use Markdown in my posts ? 
>>>
>>> Thanks all!
>>> Alex
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/56aaacc5-48e1-47f8-a1bc-ac027246964a%40googlegroups.com
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/86876e0c-ca4c-4282-ac9d-391abcfdccfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Brad Pitcher
django.contrib.markup has been deprecated. You could try using the
standalone project that is a copy of the same code from django:

pip install django_markup_deprecated

Then add "markup_deprecated" to your INSTALLED_APPS instead of
django.contrib.markup.

-
Brad Pitcher


On Mon, May 5, 2014 at 1:07 PM, Alex Leonhardt  wrote:

> fwiw - this is the tutorial I was trying :
> http://www.creativebloq.com/netmag/get-started-django-7132932 it mentions
> django.contrib.markup ... but that doesnt seem to work :\
>
>
> On Monday, 5 May 2014 16:44:47 UTC+1, Alex Leonhardt wrote:
>>
>> Hi all,
>>
>> am new to django and followed a tiny tutorial to start off - I wanted to
>> add the ability to use Markdown syntax in the blog posts. It was suggested
>> to use django.contrib.markup, but that wont work anymore ( i guess it's
>> been removed ) - what do I need to use Markdown in my posts ?
>>
>> Thanks all!
>> Alex
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/56aaacc5-48e1-47f8-a1bc-ac027246964a%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMFpZrj1XV3qTx3eMUPCUDNQMV5D2CRH8vik8jSuGbSZ5tFsVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Alex Leonhardt
fwiw - this is the tutorial I was trying : 
http://www.creativebloq.com/netmag/get-started-django-7132932 it mentions 
django.contrib.markup ... but that doesnt seem to work :\ 


On Monday, 5 May 2014 16:44:47 UTC+1, Alex Leonhardt wrote:
>
> Hi all,
>
> am new to django and followed a tiny tutorial to start off - I wanted to 
> add the ability to use Markdown syntax in the blog posts. It was suggested 
> to use django.contrib.markup, but that wont work anymore ( i guess it's 
> been removed ) - what do I need to use Markdown in my posts ? 
>
> Thanks all!
> Alex
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/56aaacc5-48e1-47f8-a1bc-ac027246964a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Alex Leonhardt
Hi all,

am new to django and followed a tiny tutorial to start off - I wanted to 
add the ability to use Markdown syntax in the blog posts. It was suggested 
to use django.contrib.markup, but that wont work anymore ( i guess it's 
been removed ) - what do I need to use Markdown in my posts ? 

Thanks all!
Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2e528f86-fef0-43a8-b4a7-89cfa7786cc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


markup doesn't render mardown text in the templates

2012-09-22 Thread Giorgos Tsiapaliokas
Hello,

I am new to django and I am writing a simple blog application.
For my app I am using markdown in order to write the texts.

The issue is that the markdown plugin doesn't render my text files.

I have attached my views.py and my template file

Regards,
Giorgos

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/VlwsKwJRKN8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

{% extends "base.html" %}

{% load markup %}

{% block posts %}

{% for post in posts %}


{{ post.author }}

{{ post.date }}


{% if post.isInternalPost%}

{{ post.content|markdown }}

{% else %}

{{ post.title }}
{% autoescape off %}
{{ post.content }}
{% endautoescape %}

{% endif %}


{% endfor %}

{% endblock %}#  Copyright 2012 by Giorgos Tsiapaliokas <terie...@gmail.com>
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; see the file COPYING.  If not, write to
#  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
#  Boston, MA 02110-1301, USA.

from django.shortcuts import render_to_response
from posts import Posts

def home(request):
p = Posts()
print p.posts()[0]["content"]
return render_to_response('posts.html', {
"posts": p.posts()
})

def posts(resquest, post_id):
return render_to_response('posts.html', {})

Re: markup

2011-05-29 Thread Praveen Krishna R
*I have used tiny_mce with django.
*
On Sat, May 28, 2011 at 3:34 PM, Vladimir  wrote:

> Has anyone any experience in CKeditor or tinymce using with django ?
>
> On 26 май, 20:25, Oscar Carballal  wrote:
> > 2011/5/26 Brett Parker :
> >
> > > On 26 May 08:27, Vladimir wrote:
> > >> Is there a tool to transform MS WORD file into HTML ? I know there is
> > >> markdown and textile, but I would prefer MS WORD.
> >
> > >http://wvware.sourceforge.net/
> >
> > > --
> > > Brett Parker
> >
> > Alsohttp://ginstrom.com/software/doc2html/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: markup

2011-05-28 Thread Vladimir
Has anyone any experience in CKeditor or tinymce using with django ?

On 26 май, 20:25, Oscar Carballal  wrote:
> 2011/5/26 Brett Parker :
>
> > On 26 May 08:27, Vladimir wrote:
> >> Is there a tool to transform MS WORD file into HTML ? I know there is
> >> markdown and textile, but I would prefer MS WORD.
>
> >http://wvware.sourceforge.net/
>
> > --
> > Brett Parker
>
> Alsohttp://ginstrom.com/software/doc2html/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: markup

2011-05-26 Thread Oscar Carballal
2011/5/26 Brett Parker :
> On 26 May 08:27, Vladimir wrote:
>> Is there a tool to transform MS WORD file into HTML ? I know there is
>> markdown and textile, but I would prefer MS WORD.
>
> http://wvware.sourceforge.net/
>
> --
> Brett Parker

Also http://ginstrom.com/software/doc2html/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: markup

2011-05-26 Thread Brett Parker
On 26 May 08:27, Vladimir wrote:
> Is there a tool to transform MS WORD file into HTML ? I know there is
> markdown and textile, but I would prefer MS WORD.

http://wvware.sourceforge.net/

-- 
Brett Parker

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: markup

2011-05-26 Thread Maksymus007
yes,its called microsoft word:) it is possible to save file as html,but the
quality and portability of this code is poor

Pozdrawiam, Maksymilian Pawlak
26-05-2011 17:27 użytkownik "Vladimir"  napisał:
> Is there a tool to transform MS WORD file into HTML ? I know there is
> markdown and textile, but I would prefer MS WORD.
> Thank You
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



markup

2011-05-26 Thread Vladimir
Is there a tool to transform MS WORD file into HTML ? I know there is
markdown and textile, but I would prefer MS WORD.
Thank You

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DRY up your Django templates with Showell Markup

2009-12-05 Thread David Martorana
I wrote this rather quickly.  It allows you to put a template.showell
file in each app folder, and will render the templates on demand if
you call "render_showell_to_response(...)".  It'll check the last
modification time of the .showell files, and re-renders them if
they've changed, allowing you to come close to ignoring any running of
the Showell pre-processor on your own.

===

import os, sys
import showell

from django.conf import settings
from django.utils.importlib import import_module
from django.shortcuts import render_to_response

from datetime import datetime

_SHOWELL_FILES_ = []

def render_showell_to_response(template, *args, **kwargs):
'''
Monitor any templates.showell file in an app folder
for changes, and republish them if necessary before
serving up the request
'''
# Get a list of app showell files
# Runs only once
if len(_SHOWELL_FILES_) == 0:
for app in settings.INSTALLED_APPS:
m = import_module(app)
for path in m.__path__:
sfile = os.path.join(path, 'templates.showell')
if os.path.exists(sfile):
_SHOWELL_FILES_.append(sfile)

# Check the date of each showell file
for sfile in _SHOWELL_FILES_:
if not hasattr(settings, '_SHOWELL_LAST_RENDERED_') or \
datetime.fromtimestamp(os.path.getmtime(sfile)) >
settings._SHOWELL_LAST_RENDERED_:
#print 'Republishing %s' % sfile
showell.publish(sfile)

# Set the last time we looked
settings._SHOWELL_LAST_RENDERED_ = datetime.now()

# Render normal template
return render_to_response(template, *args, **kwargs)

On Nov 27, 1:08 pm, Steve Howell <showel...@yahoo.com> wrote:
> I would like to announce an early version ofShowellMarkup.  It
> allows you or your designer to create web pages without the visual
> clutter of , , {% endfor %}, {% endwith %}, and friends.
>
> Unlike templating solutions that compete with Django, theShowell
> Markup plays nice with Django and still delegates all the heavy
> lifting to Django, so you still get variable interpolation, extends,
> custom filter tags, include, etc. from Django.
>
> ShowellMarkup just does two jobs and does them well:
>
>   1. Allow for indentation-based blocking (both for HTML and Django
> tags)
>   2. Allow for clean HTML one-liners that truly separate markup from
> content.
>
> The implementation ofShowellMarkup is just a preprocessor to publish
> Django templates.  You edit theShowellMarkup from a master file and
> then publish the templates to their locations within the Django
> directory structure and you're done.   You can keep both markups under
> source control.  The preprocessor writes clean markup, so you can
> debug at the Django level as needed.  Also, you are not forced to 
> useShowellidioms everywhere; normal Django and HTML still passes through
> the preprocessor without modification.
>
> You can find the implementation here:
>
> http://www.djangosnippets.org/snippets/1819/
>
> The indentation feature is, of course, inspired by Python/YAML/HAML/
> etc.
>
> The one-liner syntax is inspired by Django's use of pipes to implement
> filters.
>
> Here are some examples (some of which look better in a monospace
> font)...
>
>     You can use indentation syntax for HTML tags like table.
>
>     Instead of this...
>
>     
>         
>             
>                 Right
>             
>             
>                 Center
>             
>             
>                 Left
>             
>         
>     
>
>     You can write DRY code this...
>
>     >> table
>         >> tr
>             >> td
>                 Right
>             >> td
>                 Center
>             >> td
>                 Left
>
>     Lists work the same way, and note that attributes are not a
> problem.
>
>     Instead of this...
>
>     
>         
>             
>                 One
>             
>             
>                Two
>             
>         
>     
>
>     You can write DRY code this...
>
>     >> div class="spinnable"
>         >> ul
>             >> li id="item1"
>                 One
>             >> li id="item2"
>                Two
>
>     This tool should play nice with most templating engines, but it
> has
>     specific support for Django.
>
>     Instead of this...
>
>     {% extends 'base.html' %}
>     {% load smartif %}
>
>     {% block body %}
>         {% for book in books %}
>             {{ book }}
>         {% endfor %}
>
>         {% if condition %}
>             D

Re: DRY up your Django templates with Showell Markup

2009-12-04 Thread David Martorana
I don't want to jump on something too quickly, being somewhat
unproven, but it's a nice thing to have with GHRML being dead and HAML
being Ruby only.  I'll keep an eye on this!

What plans do you have for future improvement?

Dave

On Nov 27, 1:08 pm, Steve Howell <showel...@yahoo.com> wrote:
> I would like to announce an early version ofShowellMarkup.  It
> allows you or your designer to create web pages without the visual
> clutter of , , {% endfor %}, {% endwith %}, and friends.
>
> Unlike templating solutions that compete with Django, theShowell
> Markup plays nice with Django and still delegates all the heavy
> lifting to Django, so you still get variable interpolation, extends,
> custom filter tags, include, etc. from Django.
>
> ShowellMarkup just does two jobs and does them well:
>
>   1. Allow for indentation-based blocking (both for HTML and Django
> tags)
>   2. Allow for clean HTML one-liners that truly separate markup from
> content.
>
> The implementation ofShowellMarkup is just a preprocessor to publish
> Django templates.  You edit theShowellMarkup from a master file and
> then publish the templates to their locations within the Django
> directory structure and you're done.   You can keep both markups under
> source control.  The preprocessor writes clean markup, so you can
> debug at the Django level as needed.  Also, you are not forced to 
> useShowellidioms everywhere; normal Django and HTML still passes through
> the preprocessor without modification.
>
> You can find the implementation here:
>
> http://www.djangosnippets.org/snippets/1819/
>
> The indentation feature is, of course, inspired by Python/YAML/HAML/
> etc.
>
> The one-liner syntax is inspired by Django's use of pipes to implement
> filters.
>
> Here are some examples (some of which look better in a monospace
> font)...
>
>     You can use indentation syntax for HTML tags like table.
>
>     Instead of this...
>
>     
>         
>             
>                 Right
>             
>             
>                 Center
>             
>             
>                 Left
>             
>         
>     
>
>     You can write DRY code this...
>
>     >> table
>         >> tr
>             >> td
>                 Right
>             >> td
>                 Center
>             >> td
>                 Left
>
>     Lists work the same way, and note that attributes are not a
> problem.
>
>     Instead of this...
>
>     
>         
>             
>                 One
>             
>             
>                Two
>             
>         
>     
>
>     You can write DRY code this...
>
>     >> div class="spinnable"
>         >> ul
>             >> li id="item1"
>                 One
>             >> li id="item2"
>                Two
>
>     This tool should play nice with most templating engines, but it
> has
>     specific support for Django.
>
>     Instead of this...
>
>     {% extends 'base.html' %}
>     {% load smartif %}
>
>     {% block body %}
>         {% for book in books %}
>             {{ book }}
>         {% endfor %}
>
>         {% if condition %}
>             Display this
>         {% elif condition %}
>             Display that
>         {% else %}
>             {% include 'other.html' %}
>         {% endif %}
>     {% endblock %}
>
>     You can write DRY code this...
>
>     %% extends 'base.html'
>     %% load smartif
>
>     %% block body
>         %% for book in books
>             {{ book }}
>
>         %% if condition
>             Display this
>         %% elif condition
>             Display that
>         %% else
>             %% include 'other.html'
>
>     The tool also lets you dry up individual lines of HTML using a
>     piping concept.  Note the clean separation between markup and
> content.
>
>     Instead of this...
>
>         
>             Original Author
>             Commenters
>             Title
>             Action
>             Last words
>             By
>             When
>         
>
>         
>             One
>             Two
>             Three
>             {{ element4|join:',' }}
>         
>
>     You can write DRY code this...
>
>         >> tr class="header_row"
>             Original Author | th class="first_column"
>             Commenters      | th
>             Title           | th
>             Action          | th
>             Last words      | th
>

URLs created by custom python-markup filter are incorrect

2009-11-19 Thread Stodge
I'm using a custom python-markup filter, which seems to be working
well. However, my URLs aren't relative to my site. So if the rendered
text before filtering contains:

[/login Login]

and the login page is at:

http://localhost/test/login

the filter produces an URL of:

http://localhost/login

which is wrong. How do I get URLs from a filter like this that are
correct?

Thanks

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: Enable Image macro on tracwiki markup (djangosnippet 1047)

2009-04-23 Thread Matías Iturburu
Nevermind, I think I'll cut the problem down and use markdown instead of
trac's mackup. I've found a way of handling images that seems more sane here
http://www.omh.cc/2008/aug/18/django-inserting-and-positioning-images/

Although I find trac's markup easier

2009/4/23 Matías Iturburu <maturb...@gmail.com>

> Hi all
>
> I have been using this snippet
> http://www.djangosnippets.org/snippets/1047/ to enable the trac's excelent
> wiki markup to my app, so far so well, the snippet works flawlessy rendering
> _text_ , however I would like to use the [Image()] macro as it enables me to
> do some cool stuff with images already stored in the server.
>
> I'm not quite a pythonista myself and already spent a while trying to
> figure out what are the parts I'm missing.
> I also wonder what the problems of mixing macros from different frameworks
> would be.
>
> What do you guys think? I am just asking too much? :)
>
> Thanks for any pointer
>
>
> --
> Matías Iturburu
> Revoluciones Informáticas
> www.revolucionesweb.com.ar
> http://www.linkedin.com/in/miturburu
>



-- 
Matías Iturburu
Revoluciones Informáticas
www.revolucionesweb.com.ar
http://www.linkedin.com/in/miturburu

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Enable Image macro on tracwiki markup (djangosnippet 1047)

2009-04-23 Thread Matías Iturburu
Hi all

I have been using this snippet
http://www.djangosnippets.org/snippets/1047/to enable the trac's
excelent wiki markup to my app, so far so well, the
snippet works flawlessy rendering _text_ , however I would like to use the
[Image()] macro as it enables me to do some cool stuff with images already
stored in the server.

I'm not quite a pythonista myself and already spent a while trying to figure
out what are the parts I'm missing.
I also wonder what the problems of mixing macros from different frameworks
would be.

What do you guys think? I am just asking too much? :)

Thanks for any pointer


-- 
Matías Iturburu
Revoluciones Informáticas
www.revolucionesweb.com.ar
http://www.linkedin.com/in/miturburu

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup languages vs HTML

2008-07-10 Thread Matic Žgur

Thanks for your opinions.

I've just discovered this: http://wmd-editor.com . WYSIWYG Markdown
editor. Quite an interesting thing. I think, I'll play around with
this for a while and then decide for the appropriate markup language,
whether Markdown or HTML.

On Tue, Jul 8, 2008 at 10:23 PM, bruno desthuilliers
<[EMAIL PROTECTED]> wrote:
>
>
>
> On 8 juil, 18:02, "Matic Žgur" <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I'm working on some project, a part of which is a small blog app. All
>> the blog posts are saved as HTML (using TinyMCE in admin). I was
>> wondering, after reading some stuff about Markdown, what are pros and
>> cons of each method, ie. saving posts with some markup language vs.
>> html.
>
> Err... HTML actually *is* a markup language, you know ?
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup languages vs HTML

2008-07-08 Thread bruno desthuilliers



On 8 juil, 18:02, "Matic Žgur" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm working on some project, a part of which is a small blog app. All
> the blog posts are saved as HTML (using TinyMCE in admin). I was
> wondering, after reading some stuff about Markdown, what are pros and
> cons of each method, ie. saving posts with some markup language vs.
> html.

Err... HTML actually *is* a markup language, you know ?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup languages vs HTML

2008-07-08 Thread Ned Batchelder

The important consideration is what is the best representation for your 
data?  Since you are talking about user-edited content, you need to 
think about the user experience, and what data format is best for your 
users.  The database concerns don't really matter after that.  If you 
users need or expect to edit HTML, then you should offer that and store 
the HTML in the database.  Don't be distracted by the fact that HTML is 
often generated from structured data: it can also be a perfectly 
reasonable data storage format itself.

On the other hand, if your users would be more comfortable editing 
Markdown, then use that.  The user experience concerns are far more 
important, and will dictate the data storage.

--Ned.
http://nedbatchelder.com

Matic Žgur wrote:
> Hi,
>
> I'm working on some project, a part of which is a small blog app. All
> the blog posts are saved as HTML (using TinyMCE in admin). I was
> wondering, after reading some stuff about Markdown, what are pros and
> cons of each method, ie. saving posts with some markup language vs.
> html. I must admit, that I feel a bit uncomfortable saving html to the
> database - it just doesn't seem right to me. So, what is your opinion
> on this matter?
>
> Thanks,
> Matic Žgur
>
> >
>
>   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup languages vs HTML

2008-07-08 Thread Ned Batchelder

The important consideration is what is the best representation for your 
data?  Since you are talking about user-edited content, you need to 
think about the user experience, and what data format is best for your 
users.  The database concerns don't really matter after that.  If you 
users need or expect to edit HTML, then you should offer that and store 
the HTML in the database.  Don't be distracted by the fact that HTML is 
often generated from structured data: it can also be a perfectly 
reasonable data storage format itself.

On the other hand, if your users would be more comfortable editing 
Markdown, then use that.  The user experience concerns are far more 
important, and will dictate the data storage.

--Ned.

Matic Žgur wrote:
> Hi,
>
> I'm working on some project, a part of which is a small blog app. All
> the blog posts are saved as HTML (using TinyMCE in admin). I was
> wondering, after reading some stuff about Markdown, what are pros and
> cons of each method, ie. saving posts with some markup language vs.
> html. I must admit, that I feel a bit uncomfortable saving html to the
> database - it just doesn't seem right to me. So, what is your opinion
> on this matter?
>
> Thanks,
> Matic Žgur
>
> >
>
>   

-- 
Ned Batchelder, http://nedbatchelder.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup languages vs HTML

2008-07-08 Thread Norman Harman

Matic Žgur wrote:
> Hi,
> 
> I'm working on some project, a part of which is a small blog app. All
> the blog posts are saved as HTML (using TinyMCE in admin). I was
> wondering, after reading some stuff about Markdown, what are pros and
> cons of each method, ie. saving posts with some markup language vs.
> html. I must admit, that I feel a bit uncomfortable saving html to the
> database - it just doesn't seem right to me. So, what is your opinion
> on this matter?

I often will create two(three) fields.

body_markup -> "source" text in markup
body_rendered   -> body_markup rendered to html
[markup_style]  -> optional choice field that defines what markup 
body_markup is in

Edit body_markup.  Display body_rendered. Render body_markup to 
body_rendered on save().   body_rendered is probably a pre-optimization. 
  But, I use it anyway.

Could use the cache system for something similar, your needs probably vary.

markup is good for sophisticated / power users / niches where markup is 
expected (e.g. wikis)

TinyMCE / js editor is good for the masses.

-- 
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got fun!  Check out Austin360.com for all the entertainment
info you need to live it up in the big city!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup languages vs HTML

2008-07-08 Thread rui
Hi Matic,

I really think that html should not be saved on your database.
Markup languages are more "human readable" and can be easily converted
to HTML, if needed.

And really, it just don´t look right :)

Cheers and good luck.
--
Rui

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Markup languages vs HTML

2008-07-08 Thread Matic Žgur

Hi,

I'm working on some project, a part of which is a small blog app. All
the blog posts are saved as HTML (using TinyMCE in admin). I was
wondering, after reading some stuff about Markdown, what are pros and
cons of each method, ie. saving posts with some markup language vs.
html. I must admit, that I feel a bit uncomfortable saving html to the
database - it just doesn't seem right to me. So, what is your opinion
on this matter?

Thanks,
Matic Žgur

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Which markup language to choose?

2008-02-06 Thread Eric Abrahamsen

> For a) it's important for me to have the possibility to embed raw  
> HTML. AFAIK markdown provides hat possiblity, is it also possible with  
> textile and reST?

I'm definitely a fan of markdown (I do most of my writing in it), and
it's more than sufficient for any online needs. I tend to import it
into my models and use it in custom save methods, rather than using
the template filter, since it offers more flexibility and less runtime
load that way. That said, I did make a patch to add some more
functionality into the template filter:
http://code.djangoproject.com/ticket/6526

you might find that useful.

Yours,
eric
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Which markup language to choose?

2008-02-06 Thread Nathaniel Whiteinge

On Feb 6, 2:55 pm, Florian Lindner <[EMAIL PROTECTED]> wrote:
> For a) it's important for me to have the possibility to embed raw
> HTML. AFAIK markdown provides hat possiblity, is it also possible with
> textile and reST?

For a) you'll never be left wanting with RestructuredText. It is *by
far* the most flexible. All the Django docs are done using it (which
is also a good place to look at examples). I even use it for school
papers. You can produce a variety of slick-looking output, check out
rst2a.com [1] for examples and download-able style sheets. If you're
on a Mac, there's a pretty slick GUI program [2] for composing it too.

.. [1] http://www.rst2a.com/
.. [2] http://python.net/~gherman/ReSTedit.html
(not sure if the above link is the latest version...)

> For b) it's important the output is more or less pretty also if the
> writer is not aware of using a markup language. Or should I just stick
> with {{ comment.content | escape | urlizetrunc:40 | linebreaks }}?

For b) I'm pretty ambivalent. Textile seems to be on the way out
though.

- whiteinge
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Which markup language to choose?

2008-02-06 Thread Petite Abeille


On Feb 6, 2008, at 10:55 PM, Florian Lindner wrote:

> I'm writing my own blogging application for Django (yes, I want to
> reinvent the wheel, for learning and fun) ;-)

More power to you! :P

> According to documentation django.contrib.markup provides an interface
> to markdown, textile and restructered text. Now I wonder which one to
> choose for a) blog entries b) comments
>
> For a) it's important for me to have the possibility to embed raw
> HTML. AFAIK markdown provides hat possiblity, is it also possible with
> textile and reST?
>
> For b) it's important the output is more or less pretty also if the
> writer is not aware of using a markup language. Or should I just stick
> with {{ comment.content | escape | urlizetrunc:40 | linebreaks }}?
>
> What are your experiences?

Personally, I would favor Markdown as it would address (a) and (b) out  
of the box, i.e. you can get fancy stuff in raw HTML if needed and  
people not aware of the syntax will get decent result out-of-the-box...

As an example, here is a, hmm, homemade wiki engine which uses Markdown:

http://svr225.stepx.com:3388/main
http://svr225.stepx.com:3388/main.txt
http://svr225.stepx.com:3388/main/editor

Tangentially related... Once you have your blogging app up and  
running... read a bit about spambots :))

http://nedbatchelder.com/text/stopbots.html

Cheers,

PA.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Which markup language to choose?

2008-02-06 Thread Rajesh Dhawan

On Feb 6, 4:55 pm, Florian Lindner <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm writing my own blogging application for Django (yes, I want to
> reinvent the wheel, for learning and fun) ;-)
> According to documentation django.contrib.markup provides an interface
> to markdown, textile and restructered text. Now I wonder which one to
> choose for a) blog entries b) comments
>
> For a) it's important for me to have the possibility to embed raw
> HTML. AFAIK markdown provides hat possiblity, is it also possible with
> textile and reST?
>
> For b) it's important the output is more or less pretty also if the
> writer is not aware of using a markup language. Or should I just stick
> with {{ comment.content | escape | urlizetrunc:40 | linebreaks }}?
>
> What are your experiences?

I prefer Markdown for the following main reasons:

- simplicity (I feel that Markdown's input text is cleaner, more
legible than Textile's)
- its ability to intermix HTML (great for blog entries)
- the Python Markdown library has a nice "safe_mode" attribute which
can get rid of HTML tags if you don't want them (great for escaping
comments and other untrusted user content)
- I like the way Markdown does hard breaks only when asked explicitly
unlike Textile's "always break on \n" behaviour.

I have no practical experience using reST.

In any case, you should do some research of your own. Also, perhaps
look at other Django bloggers that you trust and see what they like. I
suppose you are already doing this via your post :)

For comments, you don't really need much more than the ability to do
links, bold, italics, and paragraphs. Any of your above 3 markup
languages will deal with that easily.

-Rajesh D
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Which markup language to choose?

2008-02-06 Thread Florian Lindner

Hello,
I'm writing my own blogging application for Django (yes, I want to  
reinvent the wheel, for learning and fun) ;-)
According to documentation django.contrib.markup provides an interface  
to markdown, textile and restructered text. Now I wonder which one to  
choose for a) blog entries b) comments

For a) it's important for me to have the possibility to embed raw  
HTML. AFAIK markdown provides hat possiblity, is it also possible with  
textile and reST?

For b) it's important the output is more or less pretty also if the  
writer is not aware of using a markup language. Or should I just stick  
with {{ comment.content | escape | urlizetrunc:40 | linebreaks }}?

What are your experiences?

Thanks,

Florian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup Filters (restructuredtext)

2008-02-05 Thread Christian W. Koch

Craig,

I went your way, and works just great! thanks a lot. I guess I was
making things more complicated than they should.

THANKS! =)

On Feb 4, 10:52 pm, "Craig Ogg" <[EMAIL PROTECTED]> wrote:
> On Feb 4, 2008 4:41 PM, Christian W. Koch <[EMAIL PROTECTED]> wrote:
>
> > I've been looking for this like crazy, I started using the markup
> > filters with great succes (love at first sight) but there's a little
> > problem. I use special carachters, like  and things like that
> > to support different languages. So, if I store it just like that in
> > the DB then the filter just spits it out literally instead of the
> > actual carachter "ã"
>
> This may not be the answer you are looking for, but generally I find
> it is better to just store the actual characters in the database.
> Allowing data to go from the db into HTML without escaping is
> generally considered a security hole.  If you are unable to do this
> (for database encoding reasons, for example), you could translate the
> character entities back to characters before sending them on your
> template.
>
> If you want to take that route, there is an example of doing this at
> the top of html2text.py[1].
>
> Craig
>
> [1]http://www.aaronsw.com/2002/html2text/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup Filters (restructuredtext)

2008-02-05 Thread Christian W. Koch

Thanks Craig, will try it when I get home and report on success. =)

On Feb 4, 10:52 pm, "Craig Ogg" <[EMAIL PROTECTED]> wrote:
> On Feb 4, 2008 4:41 PM, Christian W. Koch <[EMAIL PROTECTED]> wrote:
>
> > I've been looking for this like crazy, I started using the markup
> > filters with great succes (love at first sight) but there's a little
> > problem. I use special carachters, like  and things like that
> > to support different languages. So, if I store it just like that in
> > the DB then the filter just spits it out literally instead of the
> > actual carachter "ã"
>
> This may not be the answer you are looking for, but generally I find
> it is better to just store the actual characters in the database.
> Allowing data to go from the db into HTML without escaping is
> generally considered a security hole.  If you are unable to do this
> (for database encoding reasons, for example), you could translate the
> character entities back to characters before sending them on your
> template.
>
> If you want to take that route, there is an example of doing this at
> the top of html2text.py[1].
>
> Craig
>
> [1]http://www.aaronsw.com/2002/html2text/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup Filters (restructuredtext)

2008-02-04 Thread Craig Ogg

On Feb 4, 2008 4:41 PM, Christian W. Koch <[EMAIL PROTECTED]> wrote:
> I've been looking for this like crazy, I started using the markup
> filters with great succes (love at first sight) but there's a little
> problem. I use special carachters, like  and things like that
> to support different languages. So, if I store it just like that in
> the DB then the filter just spits it out literally instead of the
> actual carachter "ã"
>

This may not be the answer you are looking for, but generally I find
it is better to just store the actual characters in the database.
Allowing data to go from the db into HTML without escaping is
generally considered a security hole.  If you are unable to do this
(for database encoding reasons, for example), you could translate the
character entities back to characters before sending them on your
template.

If you want to take that route, there is an example of doing this at
the top of html2text.py[1].

Craig

[1] http://www.aaronsw.com/2002/html2text/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Markup Filters (restructuredtext)

2008-02-04 Thread Christian W. Koch

Hey everybody,

I've been looking for this like crazy, I started using the markup
filters with great succes (love at first sight) but there's a little
problem. I use special carachters, like  and things like that
to support different languages. So, if I store it just like that in
the DB then the filter just spits it out literally instead of the
actual carachter "ã"

I tried using {{ object.text|restructuredtext|safe }} but it still
prints the ugly string. I have not found anything in their
documentation on how to escape such things, and also looked at the
markup.py file and there's nothing there that helps me.

Any clues?

Thanks! =)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Simple markup language?

2008-01-21 Thread Derek Anderson

Jeff Anderson wrote:
> And you just need minimal functionality,
> You could probable write up a small hack to do it with some regular 
> expressions. You can find things that strip html, and then you could to 
> the simple markup fairly easily after that. It shouldn't take too long 
> to write something like that.

i recommend against this.  too easy to miss corner-cases, allowing 
inputs like "<script>alert('owned');" to inject foreign html.  better 
to use a proper html parser.


-- 
  looking to buy or sell anything?

 try: http://allurstuff.com

  it's a classified ads service that
  shows on a map where the seller is
  (think craigslist + google maps)

  plus it's 100% free :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Simple markup language?

2008-01-21 Thread Derek Anderson

i use beautifulsoup [http://www.crummy.com/software/BeautifulSoup/]. 
run it on your input, iterate through all tags, calling extract if 
they're not in your allowed set.  then print it back out as a string.

derek


Rob Hudson wrote:
> Hi,
> 
> I'm looking for something along the lines of Textile or Markdown, but
> with very minimal features.  Does anyone know of other projects that
> might fit these requirements?
> 
> * Strip all HTML
> * Only allow for simple markup (bold, italics, headers, lists, URLs or
> auto-linking URLs)
> * Do not allow things like images, tables, classes or styles
> 
> Thanks,
> Rob
> > 
> 


-- 
  looking to buy or sell anything?

 try: http://allurstuff.com

  it's a classified ads service that
  shows on a map where the seller is
  (think craigslist + google maps)

  plus it's 100% free :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Simple markup language?

2008-01-21 Thread Rob Hudson

Hi,

I'm looking for something along the lines of Textile or Markdown, but
with very minimal features.  Does anyone know of other projects that
might fit these requirements?

* Strip all HTML
* Only allow for simple markup (bold, italics, headers, lists, URLs or
auto-linking URLs)
* Do not allow things like images, tables, classes or styles

Thanks,
Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Simple markup language?

2008-01-21 Thread Oscar Carlsson
Another alternative could be using BeautifulSoup to find all tags in the
data and replace all non-approved tags with nothing.

Oscar

On Mon, Jan 21, 2008 at 04:03:54PM -0700, Jeff Anderson wrote:
> If you've already looked at the regular bunch: textile, markdown, rst, 
> etc...
> And you just need minimal functionality,
> You could probable write up a small hack to do it with some regular 
> expressions. You can find things that strip html, and then you could to the 
> simple markup fairly easily after that. It shouldn't take too long to write 
> something like that.
>
> It is also possible that some of the existing things may be able to either 
> disable the extras you don't need, or you could modify them to just skip 
> the code for those features.
>
> Jeff Anderson
>
> Rob Hudson wrote:
>> Hi,
>>
>> I'm looking for something along the lines of Textile or Markdown, but
>> with very minimal features.  Does anyone know of other projects that
>> might fit these requirements?
>>
>> * Strip all HTML
>> * Only allow for simple markup (bold, italics, headers, lists, URLs or
>> auto-linking URLs)
>> * Do not allow things like images, tables, classes or styles
>>
>> Thanks,
>> Rob
>> --~--~-~--~~~---~--~~
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com
>> To unsubscribe from this group, send email to [EMAIL PROTECTED]
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en
>> -~--~~~~--~~--~--~---
>>
>>   
>
>




pgp2h4iYpYxhe.pgp
Description: PGP signature


Re: Simple markup language?

2008-01-21 Thread Rob Hudson

Thanks for the reply...

I have considered rolling my own along the lines of {{ mytext|
striptags|simple_markup }} but thought I'd ask before I went through
the effort.  In Python there's usually a library for everything.  :)

I've also looked at the optional arguments to Markdown and Textile and
didn't see a way to disable core features specifically.

Cheers,
Rob

On Jan 21, 3:03 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> If you've already looked at the regular bunch: textile, markdown, rst,
> etc...
> And you just need minimal functionality,
> You could probable write up a small hack to do it with some regular
> expressions. You can find things that strip html, and then you could to
> the simple markup fairly easily after that. It shouldn't take too long
> to write something like that.
>
> It is also possible that some of the existing things may be able to
> either disable the extras you don't need, or you could modify them to
> just skip the code for those features.
>
> Jeff Anderson
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Simple markup language?

2008-01-21 Thread Jeff Anderson
If you've already looked at the regular bunch: textile, markdown, rst, 
etc...

And you just need minimal functionality,
You could probable write up a small hack to do it with some regular 
expressions. You can find things that strip html, and then you could to 
the simple markup fairly easily after that. It shouldn't take too long 
to write something like that.


It is also possible that some of the existing things may be able to 
either disable the extras you don't need, or you could modify them to 
just skip the code for those features.


Jeff Anderson

Rob Hudson wrote:

Hi,

I'm looking for something along the lines of Textile or Markdown, but
with very minimal features.  Does anyone know of other projects that
might fit these requirements?

* Strip all HTML
* Only allow for simple markup (bold, italics, headers, lists, URLs or
auto-linking URLs)
* Do not allow things like images, tables, classes or styles

Thanks,
Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---

  





signature.asc
Description: OpenPGP digital signature


Re: mark form field as required in markup

2007-12-07 Thread l5x

You also do this like that:

class CommentForm(forms.Form):
name = forms.CharField(
widget=forms.TextInput(attrs={'class':'special'}))
url = forms.URLField()
comment = forms.CharField(
   widget=forms.TextInput(attrs={'size':'40'}))


'class':'special' -- it marks your field with the class
'special' (example straight from Django documentation)

http://www.djangoproject.com/documentation/newforms/#creating-custom-fields

Best regards,
l
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: mark form field as required in markup

2007-12-07 Thread Empty

Well each field has and id that in your case here appears as 'id_age'.
 So you can attach a style sheet item to that field directly but that
will not do anything for the whole row.

If you just wanted to add something to the label like 'Age *" so the
user can see that it's required that way, then use the label_suffix
option when creating the form.

If you want to customize the output of the form, you either have to
write out the contents yourself
(http://www.djangoproject.com/documentation/newforms/#complex-template-output),
or create your own as_??? construct that give you what you want.

Michael Trier
blog.michaeltrier.com

On Dec 7, 2007 5:27 AM, Frank 7200 <[EMAIL PROTECTED]> wrote:
> Hi group,
> another question. Is there a way how to pass an information to markup that a
> form field is required?
>
> I have this form with one field, which is required (default value).
>
> class CustomForm(forms.Form ):
>  age = forms.ChoiceField(label='Age', choices=AGE_CHOICES)
>
> 
> {{ form.as_table}}
> 
>
> This is what appears in the markup
> <
> tr>Age: label> id="id_age">
>  "1" selected="selected">0-3
>
> I would need something like  because I would like
> to highlite the whole table row. Or at least 
>
> How can I do that?
>
> Thanks for any advice,
> Frank
>
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



mark form field as required in markup

2007-12-07 Thread Frank 7200
Hi group,
another question. Is there a way how to pass an information to markup that a
form field is required?

I have this form with one field, which is required (default value).

class CustomForm(forms.Form):
age = forms.ChoiceField(label='Age', choices=AGE_CHOICES)


{{ form.as_table}}


This is what appears in the markup

Age:
0-3


I would need something like  because I would like
to highlite the whole table row. Or at least 

How can I do that?

Thanks for any advice,
Frank

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: full-text search and mediawiki markup apps

2007-09-08 Thread Useful Database
) to promote their products through doctors, surgeons,
physicians, hospitals, pharmacists, etc.

Now if the area of sales operation is new for the MR, then he/she initially
would find it difficult to search for various doctors, hospitals, etc. This
results in wastage of time and  money. In case the pharma company is new to
the market then it requires more time and money. With our database of
doctors, nurses, pharmacists, etc. you are able to get in touch with that
Doctor on phone or by email.



*Disadvantages *

Since there are so many resumes, searching with exact key words is a bit
difficult and time consuming.

Some resumes (around 1%) may be of no use to you.



*Other Databases in Hard Copy Formats are also available *

We also have a huge compilation of old and new directories, yellow pages of
various categories from India. If required we can also send it to you at
reasonable prices.

We also have a huge collection of email addresses as well available in the
form of excel sheets. You can easily import them in your Outlook Address
book.



*Cost of the database/s*

For a customized database, the cost varies as per the requirement of the
consumer.

The cost of the Total database of all categories and segments has been kept
at a nominal price of USD 1000/- (i.e. USD One thousand only) excluding the
freight/courier charges for companies or consultants located out of India.

For Corporates located in India, the cost of the Total database would be INR
35000/- (i.e. Rupees Thirty Five thousand only).

The delivery shall be done only after we receive the payment. Trust us we
are honest, hard working people. We have taken lot of pain in compiling the
resume data.

Please feel free to contact us at [EMAIL PROTECTED] for any doubts or
queries.



*Payment *

For Foreign Companies: Wire Transfer to our Bankers in India.

For Indian Companies : By Cheque.

Please contact us at [EMAIL PROTECTED] and we shall guide you
accordingly.



*For people whom this email is of no use*

You can mail us your resume at [EMAIL PROTECTED] and we shall store in
our database forever, which shall then be forwarded to our future clientele
at no cost. This increases your job opportunities.



*Important Note *

We are against spamming. If you wish to remove yourself from our mailing
list then please email us at [EMAIL PROTECTED], with the subject as
"Unsubscribe".



"This message may contain confidential, proprietary or legally privileged
information. It might be sent to you by mistake or an erroneous click,
sometimes. It should not be used by anyone who is not the original intended
recipient. If you have erroneously received this message, please delete it
immediately and notify the sender. The recipient acknowledges that we are
unable to exercise control or ensure or guarantee the integrity of/over the
contents of the information contained in e-mail transmissions and further
acknowledges that any views expressed in this message are those of the
individual sender and no binding nature of the message shall be implied or
assumed unless the sender does so expressly. Before opening any attachments
please check them for viruses and defects."


On 9/8/07, David Cramer <[EMAIL PROTECTED]> wrote:
>
>
> I've taken the time to upload both our SphinxSearch layer, and our
> MediaWiki markup util to Google code today. For more info see my blog
> post:
> http://www.davidcramer.net/code/54/mediawiki-markup-and-sphinxsearch-...
>
> I haven't used Google code before, so if theres any problems just let
> me know.
>
> Enjoy.
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: full-text search and mediawiki markup apps

2007-09-08 Thread ringemup

Just yesterday, I was thinking how useful it would be to be able to
use mediawiki markup syntax for a new project... and voila -- my
prayers are answered!  Thank you for putting this together!

One problem... I'm getting a syntax error on import (using python
2.5):

>>> import wikimarkup
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\django\django\Python25\Lib\site-packages\wikimarkup
\__init__.py", lin
e 28
_attributePat = re.compile(ur'(?:^|\s)([A-Za-z0-9]+)(?:\s*=
\s*(?:"([^<"]*)"|
'([^<']*)'|([a-zA-Z0-9!#$%&()*,\-./:;<>[EMAIL PROTECTED]|}~]+)|#([0-9a-fA-F]
+)))', re.UN
ICODE)

   ^
SyntaxError: invalid syntax


Am I doing something wrong?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



full-text search and mediawiki markup apps

2007-09-07 Thread David Cramer

I've taken the time to upload both our SphinxSearch layer, and our
MediaWiki markup util to Google code today. For more info see my blog
post: http://www.davidcramer.net/code/54/mediawiki-markup-and-sphinxsearch-...

I haven't used Google code before, so if theres any problems just let
me know.

Enjoy.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Markup as a function of User-Agent

2007-06-21 Thread [EMAIL PROTECTED]

Yup... first, don't do it based on user agent. Guaranteed you won't
think of one, or the specs will change, or something will go belly up
on you. Do it on capability. If it's a small screen, do x, otherwise,
do y, whatever the UA is.
What really matters to you is the size of the thing, right?

So, on the simplest level, you use a snippet of JS to get the clients
browser window size (not resolution), and feed additional/alternate
CSS for it. See http://www.themaninblue.com/writing/perspective/2006/01/19/

Getting more sophisticated, you could have the JS make the check and
either set a cookie or append some querystring (?small=true, maybe) to
each url, which you could then pick up in your view, if you needed
COMPLETELY different content.

But that sounds messy to me, and just making a smart small-screen CSS
is pretty trivial.

The same trick is also very helpful for taking small-to-mid-size fixed-
width layouts and resizing them for very large windows.



On Jun 20, 1:43 pm, EagerToUnderstand <[EMAIL PROTECTED]> wrote:
> I would like to change the information/size of the returned HTML page
> depending on the User-Agent accessing the content.
> (Typically rendering a smaller page for a PDA than for a PC browser.)
> I know how to get hold of the User-Agent.  It feels to me like this
> must be a common requirement, yet I can not find info on it.  Anybody
> got a eloquent solution?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Markup as a function of User-Agent

2007-06-20 Thread EagerToUnderstand

I would like to change the information/size of the returned HTML page
depending on the User-Agent accessing the content.
(Typically rendering a smaller page for a PDA than for a PC browser.)
I know how to get hold of the User-Agent.  It feels to me like this
must be a common requirement, yet I can not find info on it.  Anybody
got a eloquent solution?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Contrib markup app not to be installed?

2005-12-03 Thread Robert Wittams

Ian Holsman wrote:
> shouldn't a warning/informational message be generated in this case.
> something like
> 
> $ django-admin install markup
> INFO: no models found to install.. skipping markup
> 
> ?

Given that the command acts on a model module, *not* on an app, this
wouldn't work. It will instead say 'No module named markup', which is
accurate. You have probably been using a model files named the same as
your apps, so didn't notice this.

We did look at making it work on an app and it might change to that in
future.



Re: Contrib markup app not to be installed?

2005-12-03 Thread Ian Holsman

shouldn't a warning/informational message be generated in this case.
something like

$ django-admin install markup
INFO: no models found to install.. skipping markup

?

On 12/3/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
>
> On Dec 3, 2005, at 5:13 AM, James Bennett wrote:
> > While setting up a new project tonight, I was running through and
> > doing a 'django-admin.py install' for each of the apps from
> > django.contrib I'll be using, and when I got to the markup app, I got
> > the following error:
> >
> > Error: No module named markup. Are you sure your INSTALLED_APPS
> > setting is correct?
> >
> > I've got 'django.contrib.markup' in INSTALLED_APPS, and the markup app
> > certainly seems to be a Python module. Is it not meant to be installed
> > with 'django-admin.py' (since I recall Jacob saying that all you need
> > is to have it in INSTALLED_APPS and then do 'load markup' in your
> > template)?
>
> Yeah, it doesn't get installed -- the markup app has no models, just
> the custom template tag.
>
> Jacob
>


--
[EMAIL PROTECTED] -- blog: http://feh.holsman.net/ -- PH: ++61-3-9877-0909

If everything seems under control, you're not going fast enough. -
Mario Andretti


Re: Contrib markup app not to be installed?

2005-12-03 Thread Jacob Kaplan-Moss


On Dec 3, 2005, at 5:13 AM, James Bennett wrote:

While setting up a new project tonight, I was running through and
doing a 'django-admin.py install' for each of the apps from
django.contrib I'll be using, and when I got to the markup app, I got
the following error:

Error: No module named markup. Are you sure your INSTALLED_APPS
setting is correct?

I've got 'django.contrib.markup' in INSTALLED_APPS, and the markup app
certainly seems to be a Python module. Is it not meant to be installed
with 'django-admin.py' (since I recall Jacob saying that all you need
is to have it in INSTALLED_APPS and then do 'load markup' in your
template)?


Yeah, it doesn't get installed -- the markup app has no models, just  
the custom template tag.


Jacob


Re: Contrib markup app not to be installed?

2005-12-03 Thread James Bennett

On 12/3/05, Robert Wittams <[EMAIL PROTECTED]> wrote:
> The install is for installing a model-module, not an app. As the markup
> app has no model modules, and there is no model module named markup,
> this is not going to work.

OK, I'd figured as much from a little further poking around, but just
wanted to be sure that's how it's supposed to be. Thanks for the quick
reply.


--
"May the forces of evil become confused on the way to your house."
  -- George Carlin


Contrib markup app not to be installed?

2005-12-03 Thread James Bennett

While setting up a new project tonight, I was running through and
doing a 'django-admin.py install' for each of the apps from
django.contrib I'll be using, and when I got to the markup app, I got
the following error:

Error: No module named markup. Are you sure your INSTALLED_APPS
setting is correct?

I've got 'django.contrib.markup' in INSTALLED_APPS, and the markup app
certainly seems to be a Python module. Is it not meant to be installed
with 'django-admin.py' (since I recall Jacob saying that all you need
is to have it in INSTALLED_APPS and then do 'load markup' in your
template)?


--
"May the forces of evil become confused on the way to your house."
  -- George Carlin