lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev LINK, List Page, and HTLink (was: What the heck is up with this


From: Klaus Weide
Subject: lynx-dev LINK, List Page, and HTLink (was: What the heck is up with this?)
Date: Tue, 4 May 1999 08:42:23 -0500 (CDT)

On Mon, 3 May 1999, John Bley wrote:
> On Sat, 1 May 1999, Klaus Weide wrote:
> 
> > You can see in the code my recent attempt to do this more half-heartedly
> > (conservatively) for *some* link types, by adding title info to the
> > (mostly unused) HTLinkType.  If you tested with say "chapter" and "up"
> > instead of "bookmark" and "start", you should see something different.
> 
> Indeed I do.  I see the destination URLs instead of the titles.  What 
> good is that?  We have the titles, they (in theory) provide extra 
> information about the URLs, why not display them?  They're useful.

For

  <LINK HREF="s.html" REL="chapter" TYPE="text/html">
  <LINK HREF="s.html" REL="up" TYPE="text/html">

I see

   #[1]chapter [2]up

on the rendered page, and

     * [1](chapter)file://localhost/home/kweide/public-html/s.html
     * [2](up)file://localhost/home/kweide/public-html/s.html

on the list page.  Maybe not pretty, but it proves that the information
is getting there.

Hmm, it appears I see this only because of some code I have in LYList.c
that isn't in dev.25.  Either Tom lost part of a patch, or more
likely I sent an incomplete patch - very sorry.  Now I understand why
no one has complained about the ugly format...

Please apply the following.  As I said, it mostly shows that the
information is "getting there" this way, i.e. by putting it in the HTLink
structure, but the details (how and where to put it in the structure,
and the display format) can be much improved.

Let me know if with this patch you still don't get a List Page display as
above.

  Klaus


--- lynx2-8-2.old/src/LYList.c  Fri Apr 23 09:56:34 1999
+++ lynx2-8-2/src/LYList.c      Tue May  4 08:28:35 1999
@@ -53,6 +53,7 @@
     static char tempfile[LY_MAXPATH];
     FILE *fp0;
     char *Address = NULL, *Title = NULL, *cp = NULL;
+    char *LinkTitle = NULL;  /* Rel stored as property of link, not of dest */
     BOOLEAN intern_w_post = FALSE;
     char *desc = "unknown field or link";
 
@@ -154,6 +155,16 @@
        }
        address =  HTAnchor_address(dest);
        title = titles ? HTAnchor_title(parent) : NULL;
+       if (dest_intl) {
+           HTSprintf0(&LinkTitle, "(internal)");
+       } else if (titles && child->mainLink.type &&
+                  dest == child->mainLink.dest &&
+                  !strncmp(HTAtom_name(child->mainLink.type),
+                           "RelTitle: ", 10)) {
+           HTSprintf0(&LinkTitle, "(%s)", 
HTAtom_name(child->mainLink.type)+10);
+       } else {
+           FREE(LinkTitle);
+       }
        StrAllocCopy(Address, address);
        FREE(address);
        LYEntify(&Address, TRUE);
@@ -169,7 +180,7 @@
 
        fprintf(fp0, "<li><a href=\"%s\"%s>%s%s%s%s%s</a>\n", Address,
                        dest_intl ? " TYPE=\"internal link\"" : "",
-                       dest_intl ? "(internal) " : "",
+                       LinkTitle ? LinkTitle : "",
                        ((HTAnchor*)parent != dest) && Title ? "in " : "",
                        (char *)(Title ? Title : Address),
                        (Title && cp) ? " - " : "",
@@ -178,6 +189,7 @@
        FREE(Address);
        FREE(Title);
     }
+    FREE(LinkTitle);
 
     if (hidden_links > 0) {
        if (refs > 0)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]