Discussion:
[Docutils-users] ReST - `Try It Now` page?
Clint Laskowski
2006-07-14 16:32:47 UTC
Permalink
Seems there should be a 'try it now' link on the docutils or
ReStructured Text pages where a newbie could type in some ReST and have
it rendered. Is there such a page, site, etc.?

-- Clint

---
. Clint Laskowski, CISSP
. Information Security Consultant
. ***@robotic.com
. 414-807-8845 (mobile)
Jiri Barton
2006-07-14 18:48:48 UTC
Permalink
Hello Clint,

in fact, it is so easy to write something like that that I could not resist to
write one:

http://www.hosting4u.cz/jbar/rest/rest.html

Just a side note, we both mean rendering reST to HTML; you can render reST to
other formats such as PDF or plain text. reST is a markup... :-)

If you're interested, here's the source (using mod_python):

rest.py
-------
from docutils.core import publish_string

def index(req, content):
req.content_type = 'text/html; charset=UTF-8'
req.send_http_header()
return publish_string(source=content, writer_name='html')

apache conf fragment
--------------------
(be sure to put rest.py and rest.html in the directory (such
as /home/jbar/scratchpad/rest) and edit the path below... and don't forget to
load mod_python)

<Directory "/home/jbar/scratchpad/rest">
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>

Alias /rest /home/jbar/scratchpad/rest


rest.html
---------

<html>
<head>

<title>reST renderer</title>

</head>
<body>

<h1>reST to HTML conversion</h1>

<form action="render.py" method="post">
<label>Type in some reST into the box below:</label>
<textarea name="content" rows="20" cols="80"></textarea>
<br /><br />
<input type="submit" value="Render" />
</form>

</body>
</html>


HTH,
Jiri
Post by Clint Laskowski
Seems there should be a 'try it now' link on the docutils or
ReStructured Text pages where a newbie could type in some ReST and have
it rendered. Is there such a page, site, etc.?
-- Clint
David Goodger
2006-07-14 19:04:12 UTC
Permalink
[Jiri Barton]
Post by Jiri Barton
in fact, it is so easy to write something like that that I could not resist to
http://www.hosting4u.cz/jbar/rest/rest.html
rest.py
-------
from docutils.core import publish_string
req.content_type = 'text/html; charset=UTF-8'
req.send_http_header()
return publish_string(source=content, writer_name='html')
I suggest you add this to the publish_string call, to avoid potential security
issues:

settings_overrides={'file_insertion_enabled': 0, 'raw_enabled': 0}
Post by Jiri Barton
rest.html
---------
<html>
<head>
<title>reST renderer</title>
</head>
<body>
<h1>reST to HTML conversion</h1>
<form action="render.py" method="post">
<label>Type in some reST into the box below:</label>
Add a <br /> here so the box *is* below.
Post by Jiri Barton
<textarea name="content" rows="20" cols="80"></textarea>
<br /><br />
<input type="submit" value="Render" />
</form>
</body>
</html>
--
David Goodger <http://python.net/~goodger>
Jiri Barton
2006-07-14 19:54:26 UTC
Permalink
Post by David Goodger
[Jiri Barton]
Post by Jiri Barton
in fact, it is so easy to write something like that that I could not
http://www.hosting4u.cz/jbar/rest/rest.html
Thank you David, I have added your suggestions!

Plus I have added the meta tag for utf-8 to allow for accented characters.

Jiri

(find the corrected version source at http://pastebin.com/748259)
Felix Wiemann
2006-07-14 20:29:19 UTC
Permalink
Post by Jiri Barton
http://www.hosting4u.cz/jbar/rest/rest.html
That's pretty neat indeed.

Could you release the source that you posted to the Public Domain?
--
For private mail please ensure that the header contains 'Felix Wiemann'.

"the number of contributors [...] is strongly and inversely correlated with the
number of hoops each project makes a contributing user go through." -- ESR
Felix Wiemann
2006-07-14 20:38:05 UTC
Permalink
Post by Felix Wiemann
Post by Jiri Barton
http://www.hosting4u.cz/jbar/rest/rest.html
That's pretty neat indeed.
Could you release the source that you posted to the Public Domain?
Oh, and another question:

May we add a text box to the reStructuredText homepage at
<http://docutils.sf.net/rst.html> which renders text using the renderer
script on your website? (We'd ultimately put the script on our own
webspace to avoid using your server resources, but for now that would be
really nice.)
--
For private mail please ensure that the header contains 'Felix Wiemann'.

"the number of contributors [...] is strongly and inversely correlated with the
number of hoops each project makes a contributing user go through." -- ESR
Jiri Barton
2006-07-14 21:20:17 UTC
Permalink
Post by Felix Wiemann
Post by Felix Wiemann
Post by Jiri Barton
http://www.hosting4u.cz/jbar/rest/rest.html
That's pretty neat indeed.
Could you release the source that you posted to the Public Domain?
May we add a text box to the reStructuredText homepage at
<http://docutils.sf.net/rst.html> which renders text using the renderer
script on your website? (We'd ultimately put the script on our own
webspace to avoid using your server resources, but for now that would be
really nice.)
By all means Felix. No problem with the resources, the web hosting is a friend
of mine's business. (and I am its admin:-)

As for the release to the Public Domain - is it just alright just to state,
"I'm releasing it to the Public Domain?" Or, does it have to be written, like
in "I am releasing http://pastebin.com/748259 into the Public Domain"?

Geez, does the pastebin crawl! I have put a small link on the page
itself - "about". I may remove it if it looks too awkward (it does kind of, I
can tell).

Best, Jiri
Felix Wiemann
2006-07-14 22:45:33 UTC
Permalink
Post by Jiri Barton
By all means Felix.
Thanks a lot! I've added a link to <http://docutils.sf.net/rst.html>
(should show up soon).
Post by Jiri Barton
As for the release to the Public Domain - is it just alright just to state,
"I'm releasing it to the Public Domain?"
Yes, that's just fine. Thanks!
Post by Jiri Barton
Geez, does the pastebin crawl!
Yeah, it's "a bit" slow at the moment. :-)
Post by Jiri Barton
I have put a small link on the page itself - "about". I may remove it
if it looks too awkward (it does kind of, I can tell).
Well, I think it looks fine.
--
Felix Wiemann -- http://www.ososo.de/
Sandra
2015-10-19 13:54:36 UTC
Permalink
Hi, I am using reST for some of my documentation and tried the link to the
public domain reST to HTML converter.
From http://docutils.sourceforge.net/rst.html#try-it-online
Converter https://www.tele3.cz/jbar/rest/rest.html

The converter itself gives an error when I enter text and press ``Render``:
405 Not Allowed
nginx/1.4.6 (Ubuntu)

As a side note, the about link is a good idea!

Thanks for the docs, converter & reading (:
Sandra.
Oleksandr Gavenko
2016-02-26 13:54:13 UTC
Permalink
Post by Sandra
Hi, I am using reST for some of my documentation and tried the link to the
public domain reST to HTML converter.
From http://docutils.sourceforge.net/rst.html#try-it-online
Converter https://www.tele3.cz/jbar/rest/rest.html
405 Not Allowed
nginx/1.4.6 (Ubuntu)
As a side note, the about link is a good idea!
I have filled bug with suggestion to remove "Try it Online" section:

https://sourceforge.net/p/docutils/bugs/293/

Actually RST should have JS parser and so host online editor on home page
which is always alive (filed request):

https://sourceforge.net/p/docutils/bugs/294/
#294 JavaScript parser for official RST specification (for online live preview).
--
http://defun.work/


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Docutils-users mailing list
Docutils-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
Continue reading on narkive:
Loading...