From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id D66E122BA4 for ; Thu, 3 Oct 2024 21:55:38 +0200 (CEST) Received: from mail.posixcafe.org ([45.76.19.58]) by 9front; Thu Oct 3 15:54:22 -0400 2024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posixcafe.org; s=20200506; t=1727985232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aeXI8ASfve8+yliKmiB51m1DZj4RZhatiaYfXnNd+RU=; b=Rz8TPKpbuvzg5IDMGa2rvCgQ7mci2hNoXuTrZqjYfd8XFaQNu76UQ7Eu3TVGP8vfdayGkA GGlA6MMVOZPtevQl6b/yCE04ufXJIBqNlbxUXzaERLqryyS551101VqaH8Ujjhnf9pbpAR xNWmylHomRrb9a1nG30vmuYaJ/2VjtA= Received: from [192.168.168.200] (173-22-56-200.client.mchsi.com [173.22.56.200]) by mail.posixcafe.org (OpenSMTPD) with ESMTPSA id 560a88b2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <9front@9front.org>; Thu, 3 Oct 2024 14:53:49 -0500 (CDT) Message-ID: Date: Thu, 3 Oct 2024 14:54:18 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: 9front@9front.org References: Content-Language: en-US From: Jacob Moody In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: compliant self-healing ORM map/reduce-oriented content-driven framework Subject: Re: [9front] LN macro Reply-To: 9front@9front.org Precedence: bulk On 10/3/24 07:40, mkf9 wrote: > Hello. > I have a patch for ms2html, which adds a new macro to insert hyperlinks > into documents, currently, the best solution we have currently is > hard-coding html tags, > example in htmlroff: > .html a > this is a link > .html a > > or in ms2html: > ._H > this is a link > ._H > > both of which are not very good. It'd be nice if we had a > common way to insert hyper links into html and pdf (and possibly ps) > documents, without hard-coding any thing specific to those formats. > > this is what .LN macro tries to solve, at least for ms2html, for now. > i'll send a patch for htmlroff and mhtml later on. > > comments are welcome. :) > > diff d8973bdc75d5e7c7a35855f78ade347c01f985f1 uncommitted > --- a/sys/src/cmd/ms2html.c > +++ b/sys/src/cmd/ms2html.c > @@ -87,13 +87,14 @@ > F g_br, g_ft, g_sp, g_de, g_lf, g_so, g_rm, g_in; > F g_nr, g_ig, g_RT, g_BS, g_BE, g_LB, g_ta; > > -/* macros to include ML in output */ > -F g__H, g__T; > +/* macros to include HTML in output */ > +F g__H, g__T, g_LN; > > Goobie gtab[] = > { > { "_T", g__T, }, > { "_H", g__H, }, > + { "LN", g_LN, }, > { "1C", g_ignore, }, > { "2C", g_ignore, }, > { "AB", g_AB, }, > @@ -2264,6 +2265,25 @@ > printargs(argc, argv); > Bprint(&bout, "\n"); > titleseen = 1; > +} > + > +/* HTML tag */ > +void > +g_LN(int argc, char **argv) > +{ > + static int onlink = 0; > + if(onlink) > + { > + Bprint(&bout, "\n"); > + onlink = 0; > + } > + else > + { > + Bprint(&bout, " + printargs(argc, argv); > + Bprint(&bout, "\">\n"); > + onlink = 1; > + } > } > > void Seems OK to me, but you'll want to format this code in accordance to style(6).