Re: [dev] [surf] Shortcuts for horizontal scrolling

2010-08-22 Thread stanio
* Alex Puterbaugh  [2010-08-21 20:32]:
> I think that horizontal scrolling via the keyboard is far from an
> "edge" use case for a web browser that already depends so heavily on
> the keyboard, 

Yep. I've patched surf for horiz scrolling several months ago and shared
the patch here I guess. There are so many pages which use fixed width wider
than my netbook's screen. Horizontal scrolling is a must. 

Also, the following proved to be useful for me, especially for sites with
mainly text and not sane css:

# cat .surf/text_style.css
body,textarea,p,input,td,tr,div,h1,h2,h3,h4 {
background-color:#AFD7AF  !important;
text-color:#121212  !important;
max-width:100%;
}
body{width:100%;}

with following in config.h

{ MODKEY, GDK_t, setstyle, { .v = "/home/stanio/.surf/text_style.css" } 
},
{ MODKEY, GDK_T, setstyle, { .v = (const char *)NULL} },

and in surf.c

void
setstyle(Client *c, const Arg *arg){
  WebKitWebSettings *settings;
  char *uri, *customstylefile;

  customstylefile = arg->v==NULL?stylefile:(char *)arg->v;
  settings = webkit_web_view_get_settings(c->view);
  uri = g_strconcat("file://", customstylefile, NULL);
  g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL);
}


cheers,
-- 
 stanio_



[dev] Usable typesetting system?

2010-08-22 Thread Martin Kopta
Hi everyone,

  I wrote my bachelor thesis using LaTeX and now I am going to write my
master thesis. I would rather avoid TeX and everything TeX based this time.

The PDF output of (La)TeX is awesome and I really like that part of it, but
writting itself was painful, since the language is pretty cryptic and complex
for 'simple document like thesis'. Overhelming compilation output completely
hides any warnings and errors, which are too fuzzy and useless anyway. Also,
work with images is pretty much impossible and texlive package is too big in
size.

I am currently looking for some replacement with:

* input as plain text (NOT xml)
* simple syntax/commands/language
* output as PDF (acceptable as thesis), may be indirectly
* usable compilator (readable overall output, warnings and errors)
* overall good design

I guess my demands are too high, but if you know about something interesting,
please, let me know.

Thank you,
  dum8d0g


pgp4z3D8SbjNy.pgp
Description: PGP signature


Re: [dev] Usable typesetting system?

2010-08-22 Thread Kai Hendry
On 22 August 2010 12:15, Martin Kopta  wrote:
> * input as plain text (NOT xml)
> * simple syntax/commands/language

I suggest markdown and HTML

> * output as PDF (acceptable as thesis), may be indirectly

I recommend the non-free software http://www.princexml.com/

It takes in HTML, despite the name.

> * usable compilator (readable overall output, warnings and errors)
> * overall good design

Here is an example
http://hsivonen.iki.fi/thesis/



Re: [dev] Usable typesetting system?

2010-08-22 Thread Alexander Teinum
I want to use Markdown for writing university documents, but it lacks
features such as table of contents, list of figures, and reference lists.

HTML is not something I would choose for output format, since it doesn’t
know the height of a page.

Personally, I’d love to see a Markdown-language with some “university
extensions”. It should have a fast compiler written in C or Go. It should
output a PDF, follow the APA Style – well, that’s what we’re supposed to
follow at my university in Norway.

All of this can be modularized. Perhaps Markdown with macro support would
solve the problem. Maybe it already exists?

I’m learning troff right now so that I can write man-pages. It seems like a
nice enough language. I have used LaTeX for university work earlier, and the
result was really nice.

I do find LaTeX and troff hard to get into. I am not able to fully express
what I feel about this, but it has something to do with the documentation.
It’s more inaccessible compared to Markdown and HTML.  LaTeX in itself isn’t
that hard, but the whole ecosystem around it feels scary.


Re: [dev] Usable typesetting system?

2010-08-22 Thread David J Patrick

On 10-08-22 07:15 AM, Martin Kopta wrote:

Hi everyone,

   I wrote my bachelor thesis using LaTeX and now I am going to write my
master thesis. I would rather avoid TeX and everything TeX based this time.


consider writing in markdown and transforming via pandoc.
http://johnmacfarlane.net/pandoc/
djp



Re: [dev] Usable typesetting system?

2010-08-22 Thread Kurt H Maier
If you dislike TeX, use troff.  If you dislike troff, just use
microsoft word, because you're wrong.

Markdown is a crippled pile of meta-shit; it is not a typesetting
system.  If you're producing anything other than blog posts in
markdown you're fucking up.

-- 
# Kurt H Maier



Re: [dev] Usable typesetting system?

2010-08-22 Thread Alexander Teinum
I might create a parser for a language that I just invented. It’s
somewhat like Common Lisp.

(h1 A heading)
(p This is (strong awefully) nice.)
(h2 Another heading)

Or, it could be written this way…

(h1
A heading)
(p
This is (strong awefully) nice.)
(h2
Another heading)

Writing a parser for this is ten times easier than writing one for
Markdown. And this language is infinitely times more extensible.



Re: [dev] Usable typesetting system?

2010-08-22 Thread yy
I'm using a Markdown-like language to write my phd thesis in LaTeX (I
have already used it for my master thesis and several scientific
papers). Some day I should probably clean all my stuff and release
something, but at this moment is a very ad-hoc thing.

Basicly an awk script (find attached) processes titles, emphasis and
lists like markdown. Images are included with a tag at the begining of
the line. It also supports footnotes, tables (in the same or different
files), equations with LaTeX notation, an graphs (processed with
gnuplot and the epslatex terminal). Bibliographic references, as well
as references to figures and tables, can be included too. In the same
way that Markdown can include raw html you can include raw LaTeX here.
Makefiles and a series of scripts take care of building everything for
me.

If anybody is interested maybe I can privately send some of the
material, but it won't be very useful without a full example and I'm
not allowed to put that in the tubes. Anyway, I suggest to write your
own toolset if you are taking this route.

-- 
- yiyus || JGL . 4l77.com


md2tex.awk
Description: Binary data


Re: [dev] Usable typesetting system?

2010-08-22 Thread Aditya Mahajan

On Sun, 22 Aug 2010, Martin Kopta wrote:


Hi everyone,

 I wrote my bachelor thesis using LaTeX and now I am going to write my
master thesis. I would rather avoid TeX and everything TeX based this time.


Why everything TeX based? Give ConTeXt a shot: 
http://www.contextgarden.net



Overhelming compilation output completely
hides any warnings and errors, which are too fuzzy and useless anyway.


For LaTeX,  filtering useless information is easy. There are plenty of 
scripts and editor plugins that do that.



Also, work with images is pretty much impossible


Can you elaborate? Do you mean that it is hard to draw an image or it is 
hard to include an image or it is hard to predict where the image will end 
up in the document?



and texlive package is too big in size.


For ConTeXt you can download context minimals. The install size is around 
200MB (most of which is fonts), which is much smaller than TeXLive that 
can be around 1GB.



I am currently looking for some replacement with:

* input as plain text (NOT xml)
* simple syntax/commands/language
* output as PDF (acceptable as thesis), may be indirectly
* usable compilator (readable overall output, warnings and errors)
* overall good design

I guess my demands are too high, but if you know about something interesting,
please, let me know.


ConTeXt fits all points. The error messages in ConTeXt are more readable 
than plain TeX/LaTeX, but still somewhat cryptic if you are not used to 
TeX error messages.


Aditya



[dev] A language similar to Markdown that sucks less

2010-08-22 Thread Alexander Teinum
I didn’t want to start a completely off-topic discussion in the
typesetting thread, so I created a new thread. I’m playing with the
idea of creating a language that is simple to read like Markdown, but
that has a stricter syntax. It looks like Common Lisp. I think the
parser should be implemented in Go.

(h1 A heading)
(p This is (strong awfully) nice.)
(h2 Another heading)


Or, it could be written this way…

(h1
   A heading)
(p
   This is (strong awfully) nice.)
(h2
   Another heading)


There might be a rule that says that the first level doesn’t need the
parentheses…

h1 A heading
p This is (strong awfully) nice.
h2 Another heading


There isn’t any information in that markup that says where the h1, p,
or h2 tag ends, so it would be most sane to say that it ends at \n,
unless the last character is a \.

h1 A heading
p This is (strong awfully) nice.\
\
Line breaks in a paragraph.\

h2 Another heading


Hash signs might be better than h1, h2, …

# A heading
p This is (* awfully) nice.
## Another heading


That’s the idea. I’d like to discuss the language here; the syntax and
implementation details. Maybe it has already been done. Maybe the idea
sucks.



Re: [dev] Usable typesetting system?

2010-08-22 Thread Josh Rickmar
On Sun, Aug 22, 2010 at 01:15:40PM +0200, Martin Kopta wrote:
> Hi everyone,
> 
>   I wrote my bachelor thesis using LaTeX and now I am going to write my
> master thesis. I would rather avoid TeX and everything TeX based this time.
> 
> The PDF output of (La)TeX is awesome and I really like that part of it, but
> writting itself was painful, since the language is pretty cryptic and complex
> for 'simple document like thesis'. Overhelming compilation output completely
> hides any warnings and errors, which are too fuzzy and useless anyway. Also,
> work with images is pretty much impossible and texlive package is too big in
> size.
> 
> I am currently looking for some replacement with:
> 
> * input as plain text (NOT xml)
> * simple syntax/commands/language
> * output as PDF (acceptable as thesis), may be indirectly
> * usable compilator (readable overall output, warnings and errors)
> * overall good design
> 
> I guess my demands are too high, but if you know about something interesting,
> please, let me know.
> 
> Thank you,
>   dum8d0g

This is probably not what you're looking for, but last year I've
been using lout[1] (that website is awful, btw) for all of my
university documents.  It's not really suckless, but I think that
overall it's better than LaTeX.  The syntax feels rather lisp-y
(it's actually a functional language), but is much easier to extend
and program than TeX.  It's written entirely in C and the lout
distribution is *much* smaller than (La)TeX.

$ du -sh lout.lib/
5.5Mlout.lib/

lout outputs directly to postscript, so compiling to pdf is rather
easy.

$ lout test.lout | ps2pdf - test.pdf

Links:
[1] http://lout.wiki.sourceforge.net/



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread David J Patrick

On 10-08-22 11:52 AM, Alexander Teinum wrote:

I didn’t want to start a completely off-topic discussion in the
typesetting thread, so I created a new thread. I’m playing with the
idea of creating a language that is simple to read like Markdown, but
that has a stricter syntax. It looks like Common Lisp. I think the
parser should be implemented in Go.


personaly, I would be hesitant to re-invent something that already works 
well and is part of a rich software ecosystem. I use werc extensively, 
and it's markdown centric, so it would take wild horses to drag me away.

djp



Re: [dev] Usable typesetting system?

2010-08-22 Thread Jimmy Tang
On Sun, Aug 22, 2010 at 03:29:35PM +0200, Alexander Teinum wrote:
> I want to use Markdown for writing university documents, but it lacks
> features such as table of contents, list of figures, and reference lists.
> 
> HTML is not something I would choose for output format, since it doesn?t
> know the height of a page.
> 
> Personally, I?d love to see a Markdown-language with some ?university
> extensions?. It should have a fast compiler written in C or Go. It should
> output a PDF, follow the APA Style ? well, that?s what we?re supposed to
> follow at my university in Norway.
> 
> All of this can be modularized. Perhaps Markdown with macro support would
> solve the problem. Maybe it already exists?
> 
> I?m learning troff right now so that I can write man-pages. It seems like a
> nice enough language. I have used LaTeX for university work earlier, and the
> result was really nice.
> 
> I do find LaTeX and troff hard to get into. I am not able to fully express
> what I feel about this, but it has something to do with the documentation.
> It?s more inaccessible compared to Markdown and HTML.  LaTeX in itself isn?t
> that hard, but the whole ecosystem around it feels scary.

latex/tex may be hard to get into initially, but it offers pretty good
support for references, and support for mathematical equations etc. I
would hardly think one would want to use markdown (or a markdown like
system) to typeset mathematical equations which is it's strong point.

-- 
Jimmy Tang
Trinity Centre for High Performance Computing,
Lloyd Building, Trinity College Dublin, Dublin 2, Ireland.
http://www.tchpc.tcd.ie/


pgpO7UUrnllr1.pgp
Description: PGP signature


Re: [dev] [surf] Shortcuts for horizontal scrolling

2010-08-22 Thread Alex Puterbaugh
Nice stuff.  You should submit that to the wiki :D

>On Sun, Aug 22, 2010 at 11:17:20AM +0200, sta...@cs.tu-berlin.de wrote:
> * Alex Puterbaugh  [2010-08-21 20:32]:
> > I think that horizontal scrolling via the keyboard is far from an
> > "edge" use case for a web browser that already depends so heavily on
> > the keyboard, 
> 
> Yep. I've patched surf for horiz scrolling several months ago and shared
> the patch here I guess. There are so many pages which use fixed width wider
> than my netbook's screen. Horizontal scrolling is a must. 
> 
> Also, the following proved to be useful for me, especially for sites with
> mainly text and not sane css:
> 
>   # cat .surf/text_style.css
>   body,textarea,p,input,td,tr,div,h1,h2,h3,h4 {
>   background-color:#AFD7AF  !important;
>   text-color:#121212  !important;
>   max-width:100%;
>   }
>   body{width:100%;}
> 
> with following in config.h
> 
>   { MODKEY, GDK_t, setstyle, { .v = "/home/stanio/.surf/text_style.css" } 
> },
>   { MODKEY, GDK_T, setstyle, { .v = (const char *)NULL} },
> 
> and in surf.c
> 
>   void
>   setstyle(Client *c, const Arg *arg){
> WebKitWebSettings *settings;
> char *uri, *customstylefile;
> 
> customstylefile = arg->v==NULL?stylefile:(char *)arg->v;
> settings = webkit_web_view_get_settings(c->view);
> uri = g_strconcat("file://", customstylefile, NULL);
> g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL);
>   }
> 
> 
> cheers,
> -- 
>  stanio_
> 



Fwd: [dev] [surf] Shortcuts for horizontal scrolling

2010-08-22 Thread Alex Puterbaugh
And because I'm really married to the idea of this going into the
main branch of surf, here's a diff that does the same thing, but
doesn't make Arg a struct, if it should happen to please Tox.

> From: Alex Puterbaugh 
> To: suckless dev 
> Date: Sat, 21 Aug 2010 14:32:17 -0400
> Subject: [dev] [surf] Shortcuts for horizontal scrolling
> 
> Hey all,
> 
> I've made a small patch that allows you to bind keys for
> horizontal scrolling.
> 
> This approach (which imho is the least of many evils) requires
> the Arg union to be a struct, to allow the scroll() function
> to use both .b and .i as arguments.
> 
> I think that horizontal scrolling via the keyboard is far from an
> "edge" use case for a web browser that already depends so heavily on
> the keyboard, so I propose that this patch be included in the
> next version of surf.
diff -r dbb565b8d61c config.def.h
--- a/config.def.h  Fri Jun 25 09:42:58 2010 +0200
+++ b/config.def.h  Sun Aug 22 12:13:48 2010 -0400
@@ -27,14 +27,16 @@
 { MODKEY|GDK_SHIFT_MASK,GDK_j,  zoom,   { .i = -1 } },
 { MODKEY|GDK_SHIFT_MASK,GDK_k,  zoom,   { .i = +1 } },
 { MODKEY|GDK_SHIFT_MASK,GDK_i,  zoom,   { .i = 0  } },
-{ MODKEY,   GDK_l,  navigate,   { .i = +1 } },
-{ MODKEY,   GDK_h,  navigate,   { .i = -1 } },
-{ MODKEY,   GDK_j,  scroll, { .i = +1 } },
-{ MODKEY,   GDK_k,  scroll, { .i = -1 } },
+{ MODKEY,   GDK_f,  navigate,   { .i = +1 } },
+{ MODKEY,   GDK_b,  navigate,   { .i = -1 } },
+{ MODKEY,   GDK_h,  hscroll, { .i = -1 } },
+{ MODKEY,   GDK_l,  hscroll, { .i = +1 } },
+{ MODKEY,   GDK_j,  vscroll, { .i = +1 } },
+{ MODKEY,   GDK_k,  vscroll, { .i = -1 } },
 { 0,GDK_Escape, stop,   { 0 } },
 { MODKEY,   GDK_o,  source, { 0 } },
 { MODKEY,   GDK_g,  spawn,  SETPROP("_SURF_URI", 
"_SURF_GO") },
-{ MODKEY,   GDK_f,  spawn,  SETPROP("_SURF_FIND", 
"_SURF_FIND") },
+{ MODKEY,   GDK_slash,  spawn,  SETPROP("_SURF_FIND", 
"_SURF_FIND") },
 { MODKEY,   GDK_n,  find,   { .b = TRUE } },
 { MODKEY|GDK_SHIFT_MASK,GDK_n,  find,   { .b = FALSE } },
 };
diff -r dbb565b8d61c surf.c
--- a/surf.cFri Jun 25 09:42:58 2010 +0200
+++ b/surf.cSun Aug 22 12:13:48 2010 -0400
@@ -81,6 +81,7 @@
 static const char *getcookies(SoupURI *uri);
 static char *geturi(Client *c);
 void gotheaders(SoupMessage *msg, gpointer user_data);
+void hscroll(Client *c, const Arg *arg);
 static gboolean initdownload(WebKitWebView *v, WebKitDownload *o, Client *c);
 static gboolean keypress(GtkWidget *w, GdkEventKey *ev, Client *c);
 static void linkhover(WebKitWebView *v, const char* t, const char* l, Client 
*c);
@@ -96,7 +97,7 @@
 static void progresschange(WebKitWebView *view, GParamSpec *pspec, Client *c);
 static void reload(Client *c, const Arg *arg);
 static void resize(GtkWidget *w, GtkAllocation *a, Client *c);
-static void scroll(Client *c, const Arg *arg);
+static void scroll(GtkAdjustment *a, gint i);
 static void setatom(Client *c, int a, const char *v);
 static void setcookie(SoupCookie *c);
 static void setup(void);
@@ -108,6 +109,7 @@
 static void update(Client *c);
 static void updatewinid(Client *c);
 static void usage(void);
+void vscroll(Client *c, const Arg *arg);
 static void windowobjectcleared(GtkWidget *w, WebKitWebFrame *frame, 
JSContextRef js, JSObjectRef win, Client *c);
 static void zoom(Client *c, const Arg *arg);
 
@@ -326,6 +328,13 @@
soup_cookies_free(l);
 }
 
+void
+hscroll(Client *c, const Arg *arg) {
+   GtkAdjustment *a;
+   a = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(c->scroll));
+   scroll(a, arg->i);
+}
+
 gboolean
 initdownload(WebKitWebView *view, WebKitDownload *o, Client *c) {
Arg arg;
@@ -627,13 +636,11 @@
 }
 
 void
-scroll(Client *c, const Arg *arg) {
+scroll(GtkAdjustment *a, gint i) {
gdouble v;
-   GtkAdjustment *a;
 
-   a = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(c->scroll));
v = gtk_adjustment_get_value(a);
-   v += gtk_adjustment_get_step_increment(a) * arg->i;
+   v += gtk_adjustment_get_step_increment(a) * i;
v = MAX(v, 0.0);
v = MIN(v, gtk_adjustment_get_upper(a) - 
gtk_adjustment_get_page_size(a));
gtk_adjustment_set_value(a, v);
@@ -778,6 +785,13 @@
 }
 
 void
+vscroll(Client *c, const Arg *arg) {
+   GtkAdjustment *a;
+   a = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(c->scroll));
+   scroll(a, arg->i);
+}
+
+void
 windowobjectcleared(GtkWidget *w, WebKitWebFrame *frame, JSContextRef js, 
JSObjectRef win, Client *c) {
runscript(frame, js);
 }


Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread Alexander Teinum
What doesn’t work well for me, is that I cannot easily extend
Markdown. The design that I propose is simpler and more strict. All
tags work the same way. The input is close to a data structure, and it
doesn’t need complex parsing. The drawback is that tables and lists
need more characters:

p   Here is a list.
list(item One)\
(item Two)\
(item Three)

Or…

p   Here is a list.
(list(item One)
 (item Two)
 (item Three))

In Markdown, it’s much simpler for the user, but more complex for the parser:

 * One
 * Two
 * Three



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread David J Patrick

On 10-08-22 12:37 PM, Alexander Teinum wrote:

What doesn’t work well for me, is that I cannot easily extend
Markdown. The design that I propose is simpler and more strict. All
tags work the same way. The input is close to a data structure, and it
doesn’t need complex parsing. The drawback is that tables and lists
need more characters:


pandoc extends markdown and has some table support,
djp



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread David J Patrick

On 10-08-22 12:47 PM, David J Patrick wrote:



pandoc extends markdown and has some table support,


I think.. or maybe it doesn't..

anyhow, it's a noble effort, best of luck, keep us posted,
djp



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread Aurélien Aptel
On Sun, Aug 22, 2010 at 5:52 PM, Alexander Teinum  wrote:
> That’s the idea. I’d like to discuss the language here; the syntax and
> implementation details. Maybe it has already been done. Maybe the idea
> sucks.

Have you heard of SexpCode?

http://cairnarvon.rotahall.org/2010/05/25/towards-a-better-bbcode/
http://cairnarvon.rotahall.org/misc/sexpcode.html



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread Anh Hai Trinh
On Sun, Aug 22, 2010 at 10:52 PM, Alexander Teinum  wrote:
> I didn’t want to start a completely off-topic discussion in the
> typesetting thread, so I created a new thread. I’m playing with the
> idea of creating a language that is simple to read like Markdown, but
> that has a stricter syntax. It looks like Common Lisp. I think the
> parser should be implemented in Go.
>
> (h1 A heading)
> (p This is (strong awfully) nice.)
> (h2 Another heading)
>
>
> Or, it could be written this way…
>
> (h1
>   A heading)
> (p
>   This is (strong awfully) nice.)
> (h2
>   Another heading)
>
>
> There might be a rule that says that the first level doesn’t need the
> parentheses…
>
> h1 A heading
> p This is (strong awfully) nice.
> h2 Another heading
>
>

I've written something you might like. It can do both open/closing
tags and by indentations.

http://www.trinhhaianh.com/NEST.html

It looks like this:

\html <

\h1 title
\

\< This is a comment but can be used decoratively, like the one
under the \\h1 >

\div[class=content]:

\p You may close off the tags by indentation (notice the ":").

\blockquote:
Immature poets imitate; mature poets steal; bad poets
deface what they take, and good poets make it into
something better, or at least something different.
— T.S. Eliot, The Sacred Wood

\p You can do inline \b, \code<\em<λ>x. x+1>.

\p I personally when you can nest arbitrary tags after each other
(hence the name), e.g.

\footer \div[style="float: right"] \p Yours truly

>

I have written the parsers using PLY (Python lex/yacc), which can
output HTML or ElementTree: http://github.com/aht/nest


-- 
@chickamade



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread Kurt H Maier
This just looks like POD all over again.

Which is fine, as POD works well, but can someone explain to me why we
need sixty thousand metamarkup languages?  You're never going to make
one that sucks less.  Metamarkup is a sucky idea in the first place.
Markdown sucks because it only implements a subset of HTML, which also
sucks, and most of the markdown implementations out there are one-way
(ie, you can't recover the markdown source).  TeX is great unless
you've got some kind of aversion to learning how to do what you want
to do.  troff is the same way.

And then there's docbook.  I tried to count the ways in which docbook
sucks, but I ran out of RAM.

-- 
# Kurt H Maier



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread Alexander Teinum
> pandoc extends markdown and has some table support,

It does have lots of extensions that I miss in the standard Markdown,
so that’s a good point. Still, I’d like to have a minimalistic tool
for this that is 100 % based on functions.

> Have you heard of SexpCode?

No, but that looks very familiar. ;) I want something less
complicated, but having the function accept arguments other than just
the string might be necessary. I think I’ll wrap the functions in
parentheses rather than mustaches.

> I've written something you might like. It can do both open/closing
> tags and by indentations.

Nice work. I did consider using \ for prefixing functions, but I ended
up liking parentheses more.



Re: [dev] Usable typesetting system?

2010-08-22 Thread David Tweed
On Sun, Aug 22, 2010 at 12:15 PM, Martin Kopta  wrote:
>  I wrote my bachelor thesis using LaTeX and now I am going to write my
> master thesis. I would rather avoid TeX and everything TeX based this time.

Are you planning on writing any papers (effectively, do you plan to
become an academic)? If so, it's worth bearing in mind that some
subject areas tend to distribute the "conference/journal/arxiv style"
as LaTeX packages; with the move to electronic proceedings with
hyperlinks I imagine it's getting more and more trouble to make
non-LaTeX papers fit the submission guidelines. If both these apply,
you'd have to become comfortable with LaTeX anyway so it might make
sense to start now. Of course you may not, or you may be in an area
where the default is MS Word style files, but it's something to bear
in mind.

-- 
cheers, dave tweed__
computer vision reasearcher: david.tw...@gmail.com
"while having code so boring anyone can maintain it, use Python." --
attempted insult seen on slashdot



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread Troels Henriksen
Alexander Teinum  writes:

> Maybe the idea sucks.

You've missed the point of Markdown, which is readable plaintext that
looks much like an email of Usenet post would.

Your language seems fine, but it's not a useful replacement for
Markdown, because it's clearly aimed at something entirely different.

-- 
\  Troels
/\ Henriksen



Re: [dev] Usable typesetting system?

2010-08-22 Thread Suraj Kurapati
On Sun, Aug 22, 2010 at 4:15 AM, Martin Kopta  wrote:
> I am currently looking for some replacement with:
>
> * input as plain text (NOT xml)
> * simple syntax/commands/language
> * output as PDF (acceptable as thesis), may be indirectly
> * usable compilator (readable overall output, warnings and errors)
> * overall good design

Try AsciiDoc http://www.methods.co.nz/asciidoc/

Its PDF output is horrible (looks like something created in M$ Word
*vomit*), but it can emit plain old LaTeX as well.  Since you already
know LaTeX, I'm sure you could take AsciiDoc's LaTeX output and
somehow typeset in the beautiful, classic Knuth style that we love.

> I guess my demands are too high, but if you know about something interesting,
> please, let me know.

In my case, I wrote my masters thesis using LyX http://www.lyx.org/
It's a What You See Is What You Mean system, better than WYSIWYG.
And it was so good and easy that I never had to learn LaTeX! :-)



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread Alexander Teinum
> TeX is great unless you've got some kind of aversion to learning how to do 
> what you want
> to do.  troff is the same way.

I have used TeX for a university paper, and I think the result looked
great. I might use this language to generate TeX, HTML, … Most likely
my project will die, since that what’s happens to most projects, but I
prefer the syntax of this language over TeX and troff.

> Your language seems fine, but it's not a useful replacement for
> Markdown, because it's clearly aimed at something entirely different.

Yup. I realize that now. There are some visual similarities, but the
goals are totally different. This is more like a markup language that
tries to be as transparent as possible.



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread yy
2010/8/22 Alexander Teinum :
> I think the
> parser should be implemented in Go.

Why? It looks like something much easier to do with lisp.

-- 
- yiyus || JGL . 4l77.com



Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread Alexander Teinum
>> I think the
>> parser should be implemented in Go.
>
> Why? It looks like something much easier to do with lisp.

Good point, and that might be true, but I want to do it in Go because…

1. I want to learn Go – I haven’t had a chance to try it yet.
2. My guess is that it will execute faster when written in either Go or C.
3. I prefer programming in C-like languages, as it gives more control
over how the statements are executed by the machine (am I wrong?) Go
has a garbage collector, which I don’t like, but I believe it’s a sane
choice by the language designers.
4. I suck at Lisp, which shouldn’t matter, since one can always learn
and improve. But after watching this[1] Robert Pike video on YouTube,
I’m eager to check out Go first.

[1]: http://www.youtube.com/watch?v=5kj5ApnhPAE



Re: [dev] [sic] port argument necessary?

2010-08-22 Thread Jimmy Tang
On Tue, Aug 17, 2010 at 03:31:19PM -0700, Robert Ransom wrote:
> On Wed, 18 Aug 2010 07:37:28 +1000
> Ramana Kumar  wrote:
> 
> > Thanks Josh!
> > Does anyone know whether ircd is "supposed" to be set up properly on Linux?
> > I can tell you that it doesn't get done on Arch, at least.
> 
> On an Arch system:
> 
> $ getent services ircd
> $ getent services irc 
> irc   194/tcp
> 
> Apparently 6667 is not an IANA-blessed port for IRC; thus, it is not in
> the /etc/services file Arch uses.
> 
> 
> Robert Ransom


fyi, this is also true for osx, ircd is not defined so one must define
the port number yourself. 

jimmy.


-- 
Jimmy Tang
Trinity Centre for High Performance Computing,
Lloyd Building, Trinity College Dublin, Dublin 2, Ireland.
http://www.tchpc.tcd.ie/


pgpNLbXknVQ8m.pgp
Description: PGP signature


Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread Joseph Xu

On 8/22/2010 12:47 PM, David J Patrick wrote:

On 10-08-22 12:37 PM, Alexander Teinum wrote:

What doesn’t work well for me, is that I cannot easily extend
Markdown. The design that I propose is simpler and more strict. All
tags work the same way. The input is close to a data structure, and it
doesn’t need complex parsing. The drawback is that tables and lists
need more characters:


pandoc extends markdown and has some table support,
djp



The problem with all these Markdown extensions is that they come as 
packages with monolithic parsers, so if you like the pandoc syntax for 
one kind of entity but the PHP markdown extensions syntax for another, 
you're screwed. This is a problem with latex as well, all syntax for 
complex structures like tables must derive from the base tex syntax. 
Hence the source code for tables looks ridiculous in latex. The troff 
idea of multiple passes with different parsers translating each type of 
entity into a base representation solves this problem nicely and should 
be emulated more. I wonder why troff never really caught on in the 
academic community.




[dev] [surf] Why enable spatial navigation?

2010-08-22 Thread Matthew Bauer
Why does surf by default have spatial navigation[1] enabled? I would think
most users would want the up key to move the page up and the down key to
move the page down.

[1]:
http://webkitgtk.org/reference/webkitgtk-WebKitWebSettings.html#WebKitWebSettings--enable-spatial-navigation
diff -r 6d9e59393666 surf.c
--- a/surf.c	Sat Aug 21 19:46:07 2010 -0500
+++ b/surf.c	Sun Aug 22 14:20:06 2010 -0500
@@ -388,8 +388,8 @@
 
 	if(strcmp(uri, "") == 0)
 		return;
-	if(!(uri[0]=='h'&&uri[1]=='t'&&uri[2]=='t'&&uri[3]=='p')&&(!(uri[4]==':'&&uri[5]=='/'&&uri[6]=='/')||!(uri[4]=='s'&&uri[5]==':'&&uri[6]=='/'&&uri[7]=='/'))){
-//	if(g_strrstr(uri, "://") != NULL && g_strrstr(uri, "http://";) == NULL && g_strrstr(uri, "https://";) == NULL){
+//	if(!((uri[0]=='h'&&uri[1]=='t'&&uri[2]=='t'&&uri[3]=='p')&&((uri[4]==':'&&uri[5]=='/'&&uri[6]=='/')||(uri[4]=='s'&&uri[5]==':'&&uri[6]=='/'&&uri[7]=='/'{
+	if(g_strrstr(uri, "://") && !g_strrstr(uri, "http://";) && !g_strrstr(uri, "https://";)){
 		Arg spawnarg;
 		spawnarg = (Arg)PROTOCOL_HANDLER((char *)uri);
 		spawn(c, &spawnarg);
@@ -507,7 +507,7 @@
 	g_object_set(G_OBJECT(settings), "auto-load-images", loadimage, NULL);
 	g_object_set(G_OBJECT(settings), "enable-plugins", plugin, NULL);
 	g_object_set(G_OBJECT(settings), "enable-scripts", script, NULL);
-	g_object_set(G_OBJECT(settings), "enable-spatial-navigation", true, NULL);
+	//g_object_set(G_OBJECT(settings), "enable-spatial-navigation", true, NULL);
 
 	g_free(uri);
 


Re: [dev] A language similar to Markdown that sucks less

2010-08-22 Thread David Tweed
On Sun, Aug 22, 2010 at 8:20 PM, Joseph Xu  wrote:
> On 8/22/2010 12:47 PM, David J Patrick wrote:
>>
>> On 10-08-22 12:37 PM, Alexander Teinum wrote:
>>>
>>> What doesn’t work well for me, is that I cannot easily extend
>>> Markdown. The design that I propose is simpler and more strict. All
>>> tags work the same way. The input is close to a data structure, and it
>>> doesn’t need complex parsing. The drawback is that tables and lists
>>> need more characters:
>>
>> pandoc extends markdown and has some table support,
>> djp
>>
>
> The problem with all these Markdown extensions is that they come as packages
> with monolithic parsers, so if you like the pandoc syntax for one kind of
> entity but the PHP markdown extensions syntax for another, you're screwed.
> This is a problem with latex as well, all syntax for complex structures like
> tables must derive from the base tex syntax. Hence the source code for
> tables looks ridiculous in latex. The troff idea of multiple passes with
> different parsers translating each type of entity into a base representation
> solves this problem nicely and should be emulated more. I wonder why troff
> never really caught on in the academic community.

There's the obvious point that, being a mathematician, Knuth really
understands how mathematicians think and both the TeX basic
mathematics notation and the quality look noticeably better than eqn.
There are two slightly more minor reasons:

1. Knuth went to incredible pains to ensure that the output file from
a given .tex file is absolutely identical regardless of the machine
the program was run on (and has shouted loudly at anybody making
changes which break this). Given that academic papers can remain
relevant for at least 50 years, and that citations in other papers are
occasionally very specific (the 1st paragraph on page 4) that may have
been an important point.

2. Knuth really, really, Really, no REALLY, cares about his programs
not misbehaving in the case of user errors (unlike some luminaries in
the computing field). The work he did basically trying incredibly
convoluted language abuse to "break" TeX means that it's almost
unencounterably rare to have it silently produce corrupt output files
or segfault. Admittedly part of this may be from him primarily working
in an era when submitting jobs for batch-mode processing was one
common way of doing things, so that you want to have useful logs at
the end rather than relying on the user interactively spotting
something screwy is happening. Again, back in 1982 this attitude may
have been relatively important. (I've got to admit it's probably
reading his amaxing paper on the TRIP test for TeX that probably fired
up my desire not to silently output corrupt files, or fail
mysteriously when given corrupted/erroneous input, and above all to
consider how you can diagnose errors in your program at just as
important as considering normal processing during the design stage.)

Of course, it's possible that the fact TeX took off whilst ROFF
descendants never did is purely historical accident.

-- 
cheers, dave tweed__
computer vision reasearcher: david.tw...@gmail.com
"while having code so boring anyone can maintain it, use Python." --
attempted insult seen on slashdot



Re: [dev] [surf] Why enable spatial navigation?

2010-08-22 Thread Matthew Bauer
Some web apps use the arrow keys to navigate, like Google Spreadsheets.

On Sun, Aug 22, 2010 at 3:19 PM, Alex Puterbaugh wrote:

> Personal taste I guess.  There are existing keybinds for
> scrolling that you can change in config.h, so I guess enabling
> spatial navigation allows the best of both worlds or something.
>
>
> >On Sun, Aug 22, 2010 at 02:26:13PM -0500, Matthew Bauer wrote:
> > Why does surf by default have spatial navigation[1] enabled? I would
> think
> > most users would want the up key to move the page up and the down key to
> > move the page down.
> >
> > [1]:
> >
> http://webkitgtk.org/reference/webkitgtk-WebKitWebSettings.html#WebKitWebSettings--enable-spatial-navigation
>
> > diff -r 6d9e59393666 surf.c
> > --- a/surf.c  Sat Aug 21 19:46:07 2010 -0500
> > +++ b/surf.c  Sun Aug 22 14:20:06 2010 -0500
> > @@ -388,8 +388,8 @@
> >
> >   if(strcmp(uri, "") == 0)
> >   return;
> > -
> if(!(uri[0]=='h'&&uri[1]=='t'&&uri[2]=='t'&&uri[3]=='p')&&(!(uri[4]==':'&&uri[5]=='/'&&uri[6]=='/')||!(uri[4]=='s'&&uri[5]==':'&&uri[6]=='/'&&uri[7]=='/'))){
> > -//   if(g_strrstr(uri, "://") != NULL && g_strrstr(uri, "http://";) ==
> NULL && g_strrstr(uri, "https://";) == NULL){
> > +//
> if(!((uri[0]=='h'&&uri[1]=='t'&&uri[2]=='t'&&uri[3]=='p')&&((uri[4]==':'&&uri[5]=='/'&&uri[6]=='/')||(uri[4]=='s'&&uri[5]==':'&&uri[6]=='/'&&uri[7]=='/'{
> > + if(g_strrstr(uri, "://") && !g_strrstr(uri, "http://";) &&
> !g_strrstr(uri, "https://";)){
> >   Arg spawnarg;
> >   spawnarg = (Arg)PROTOCOL_HANDLER((char *)uri);
> >   spawn(c, &spawnarg);
> > @@ -507,7 +507,7 @@
> >   g_object_set(G_OBJECT(settings), "auto-load-images", loadimage,
> NULL);
> >   g_object_set(G_OBJECT(settings), "enable-plugins", plugin, NULL);
> >   g_object_set(G_OBJECT(settings), "enable-scripts", script, NULL);
> > - g_object_set(G_OBJECT(settings), "enable-spatial-navigation", true,
> NULL);
> > + //g_object_set(G_OBJECT(settings), "enable-spatial-navigation",
> true, NULL);
> >
> >   g_free(uri);
> >
>
>
>


Re: [dev] [surf] Why enable spatial navigation?

2010-08-22 Thread Josh Rickmar
On Sun, Aug 22, 2010 at 04:19:10PM -0400, Alex Puterbaugh wrote:
> Personal taste I guess.  There are existing keybinds for
> scrolling that you can change in config.h, so I guess enabling
> spatial navigation allows the best of both worlds or something.

It also means that you can't then use left and right for horizontal
scrolling.  If spatial navigation does stay, then the patch to add
horizontal scrolling should probably be added to surf.



[dev] Re: [surf] Why enable spatial navigation?

2010-08-22 Thread Matthew Bauer
I just realized there was some extra stuff in the patch. A fixed version is
attached.

On Sun, Aug 22, 2010 at 2:26 PM, Matthew Bauer  wrote:

> Why does surf by default have spatial navigation[1] enabled? I would think
> most users would want the up key to move the page up and the down key to
> move the page down.
>
> [1]:
> http://webkitgtk.org/reference/webkitgtk-WebKitWebSettings.html#WebKitWebSettings--enable-spatial-navigation


no_spatial_nav.diff
Description: Binary data


Re: [dev] [surf] Why enable spatial navigation?

2010-08-22 Thread Alex Puterbaugh
Personal taste I guess.  There are existing keybinds for
scrolling that you can change in config.h, so I guess enabling
spatial navigation allows the best of both worlds or something.


>On Sun, Aug 22, 2010 at 02:26:13PM -0500, Matthew Bauer wrote:
> Why does surf by default have spatial navigation[1] enabled? I would think
> most users would want the up key to move the page up and the down key to
> move the page down.
> 
> [1]:
> http://webkitgtk.org/reference/webkitgtk-WebKitWebSettings.html#WebKitWebSettings--enable-spatial-navigation

> diff -r 6d9e59393666 surf.c
> --- a/surf.c  Sat Aug 21 19:46:07 2010 -0500
> +++ b/surf.c  Sun Aug 22 14:20:06 2010 -0500
> @@ -388,8 +388,8 @@
>  
>   if(strcmp(uri, "") == 0)
>   return;
> - 
> if(!(uri[0]=='h'&&uri[1]=='t'&&uri[2]=='t'&&uri[3]=='p')&&(!(uri[4]==':'&&uri[5]=='/'&&uri[6]=='/')||!(uri[4]=='s'&&uri[5]==':'&&uri[6]=='/'&&uri[7]=='/'))){
> -//   if(g_strrstr(uri, "://") != NULL && g_strrstr(uri, "http://";) == NULL 
> && g_strrstr(uri, "https://";) == NULL){
> +//   
> if(!((uri[0]=='h'&&uri[1]=='t'&&uri[2]=='t'&&uri[3]=='p')&&((uri[4]==':'&&uri[5]=='/'&&uri[6]=='/')||(uri[4]=='s'&&uri[5]==':'&&uri[6]=='/'&&uri[7]=='/'{
> + if(g_strrstr(uri, "://") && !g_strrstr(uri, "http://";) && 
> !g_strrstr(uri, "https://";)){
>   Arg spawnarg;
>   spawnarg = (Arg)PROTOCOL_HANDLER((char *)uri);
>   spawn(c, &spawnarg);
> @@ -507,7 +507,7 @@
>   g_object_set(G_OBJECT(settings), "auto-load-images", loadimage, NULL);
>   g_object_set(G_OBJECT(settings), "enable-plugins", plugin, NULL);
>   g_object_set(G_OBJECT(settings), "enable-scripts", script, NULL);
> - g_object_set(G_OBJECT(settings), "enable-spatial-navigation", true, 
> NULL);
> + //g_object_set(G_OBJECT(settings), "enable-spatial-navigation", true, 
> NULL);
>  
>   g_free(uri);
>  




Re: [dev] Usable typesetting system?

2010-08-22 Thread Martin Kopta
> >Also, work with images is pretty much impossible
>
> Can you elaborate? Do you mean that it is hard to draw an image or
> it is hard to include an image or it is hard to predict where the
> image will end up in the document?

I meant that placing images is pretty much imposible and if you try anything
else than 'place image randomly somewhere', you are doomed to fail, spitting
blood of rage. That itself isn't the core issue. Problem is designing page
layout by your own will, which is kind of /unsupported/.

> For ConTeXt you can download context minimals. The install size is
> around 200MB (most of which is fonts), which is much smaller than
> TeXLive that can be around 1GB.

Everything with size of MB or more is just too big.

> >I am currently looking for some replacement with:
> >
> >* input as plain text (NOT xml)
> >* simple syntax/commands/language
> >* output as PDF (acceptable as thesis), may be indirectly
> >* usable compilator (readable overall output, warnings and errors)
> >* overall good design
> >
> >I guess my demands are too high, but if you know about something interesting,
> >please, let me know.
>
> ConTeXt fits all points. The error messages in ConTeXt are more
> readable than plain TeX/LaTeX, but still somewhat cryptic if you are
> not used to TeX error messages.

I will try ConTeXt then.

> Aditya


Thank you,
 dum8d0g


pgp98wKsvJoE7.pgp
Description: PGP signature


Re: [dev] Usable typesetting system?

2010-08-22 Thread Martin Kopta
> [1] http://lout.wiki.sourceforge.net/

Very interesting, thank you.

dum8d0g


pgpeAHfLIXWfY.pgp
Description: PGP signature


Re: [dev] Usable typesetting system?

2010-08-22 Thread Martin Kopta
> Are you planning on writing any papers (effectively, do you plan to
> become an academic)? If so, it's worth bearing in mind that some
> subject areas tend to distribute the "conference/journal/arxiv style"
> as LaTeX packages;

Good point. TeX being de facto standard in academic field may be unpleasant,
but it is clear fact. Maybe I should just stop whining and learn it properly.

Best regards,
 dum8d0g


pgpGBdeUn4Kdw.pgp
Description: PGP signature


Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-22 Thread sqweek
On 16 August 2010 02:49, anonymous  wrote:
> I don't think this should be written in shell scripting language: it
> is not too easy to calculate what date it will be tomorrow without
> libc and it should be very fast.

I wanted to do some date manipulation in rc awhile back and ended up
writing some utils to manipulate ISO8601 dates.

% 8601/date   #current date in -MM-DDTHH:MM:SS+TZ:TZ
% 8601/delta `{8601/date} + P1DT  #gives tomorrows date (the P1DT is
an 8601 "period" format, in this case 1 Day. could equivalently use
PT24H or PT86400S. or PT12H43200S if you were so inclined...)

 Never got around to licensing it but feel free to use it,
http://sqweek.dnsdojo.org/hg/8601/
-sqweek



[dev] st on OpenBSD?

2010-08-22 Thread Anthony J. Bentley
Hi guys,

I am interested in using st on OpenBSD, but it does not compile since
OpenBSD does not implement posix_openpt et al:

st.c: In function 'ttynew':
st.c:243: warning: implicit declaration of function 'posix_openpt'
st.c:245: warning: implicit declaration of function 'grantpt'
st.c:247: warning: implicit declaration of function 'unlockpt'
st.c:249: warning: implicit declaration of function 'ptsname'
st.c:249: warning: assignment makes pointer from integer without a cast
st.c:253: error: 'O_NDELAY' undeclared (first use in this function)
st.c:253: error: (Each undeclared identifier is reported only once
st.c:253: error: for each function it appears in.)
*** Error code 1

It looks like there was once effort to make it work[1] but I don’t
guess it’s still in… any advice?

1: http://lists.suckless.org/dwm/0806/6070.html



Re: [dev] Usable typesetting system?

2010-08-22 Thread Kurt H Maier
On Sun, Aug 22, 2010 at 6:13 PM, Martin Kopta  wrote:
> Problem is designing page
> layout by your own will, which is kind of /unsupported/.

That's because TeX is supposed to do the page layout.  If you want
such fine-grained control, use a desktop publishing suite like Quark
XPress or Scribus.  If you want to typeset a document, use TeX.

> Everything with size of MB or more is just too big.

This is easy to say, but the only reason the alternatives are smaller
is because they leverage fonts and tools that people generally already
have on a linux or unix system.  TeX doesn't, for a variety of
reasons, but it's foolish to pretend that (for instance) markdown.pl
is all you need to typeset and publish a document.


-- 
# Kurt H Maier



Re: [dev] Re: Digest of dev@suckless.org issue 40 (5783-5832)

2010-08-22 Thread Suraj Kurapati
Please trim your quoted text and do not top-post.

http://catb.org/~esr/jargon/html/T/top-post.html



Re: [dev] Usable typesetting system?

2010-08-22 Thread Antoni Grzymala
Alexander Teinum dixit (2010-08-22, 17:01):

> I might create a parser for a language that I just invented. It’s
> somewhat like Common Lisp.
> 
> (h1 A heading)
> (p This is (strong awefully) nice.)
> (h2 Another heading)
> 
> Or, it could be written this way…
> 
> (h1
> A heading)
> (p
> This is (strong awefully) nice.)
> (h2
> Another heading)
> 
> Writing a parser for this is ten times easier than writing one for
> Markdown. And this language is infinitely times more extensible.

If you like the syntax, why not just use cl-typesetting [1]?

[1] http://www.fractalconcept.com:8000/asp/cl-typesetting

-- 
[a]