From MAILER-DAEMON Sat Apr 14 12:09:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SJ5XN-0004di-6h
	for mharc-help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:09:21 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53937)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1SJ5XL-0004da-2c
	for help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:09:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1SJ5XJ-00014J-0r
	for help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:09:18 -0400
Received: from pianeta.di.unito.it ([130.192.156.1]:39446)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1SJ5XI-000147-MD
	for help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:09:16 -0400
X-MailScanner-From: bettini@dsi.unifi.it
X-SpamCheck: not spam, SpamAssassin (not cached, score=-102.254, required 3,
	autolearn=not spam, AUTHENTICATEDUSER -100.00, AWL -0.45,
	BAYES_00 -1.90, RCVD_IN_DNSWL_LOW -0.70, RDNS_NONE 0.79)
X-AntiVirus: Email Clean
X-dipinfo-MailScanner-ID: q3EFdn0F015943
X-dipinfo-MailScanner-Information: Please contact Department of Computer
	Science technical staff for more information
Received: from pianeta.di.unito.it ([130.192.156.1])
	by pianeta.di.unito.it (INFO-DIP) with ESMTP id q3EFdn0F015943
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO
	AuthenticatedUser=bettini ) for <help-source-highlight@gnu.org>;
	Sat, 14 Apr 2012 17:39:52 +0200 (CEST)
X-DKIM: OpenDKIM Filter v2.4.1 pianeta.di.unito.it q3EFdn0F015943
Message-ID: <4F899A44.2090801@dsi.unifi.it>
Date: Sat, 14 Apr 2012 17:39:48 +0200
From: Lorenzo Bettini <bettini@dsi.unifi.it>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:11.0) Gecko/20120329 Thunderbird/11.0.1
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F53B69D.5080506@gmail.com>
In-Reply-To: <4F53B69D.5080506@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 130.192.156.1
Subject: Re: [Help-source-highlight] LilyPond language files completed
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Apr 2012 16:09:20 -0000

Federico, Lilypond lang def file is not in git HEAD :)

thanks for your work :)
cheers
	Lorenzo

On 03/04/2012 07:38 PM, Federico Bruni wrote:
> Hi,
>
> find attached the files for the LilyPond language.
> It's not perfect but it's a good start.
>
> I didn't make a Git patch, including the changes needed in Makefile.am
> and lang.map
> But I can do it, if you want me to.
>
> BTW, I can't understand why Git "complains" about this "No newline at
> end of file":
>
> -tml = tml.lang
> \ No newline at end of file
> +tml = tml.lang
> +ly = lilypond.lang
>
> I've googled a bit but I couldn't find any good answer.
>
> Cheers,
> Federico
>
>
> _______________________________________________
> Help-source-highlight mailing list
> Help-source-highlight@gnu.org
> https://lists.gnu.org/mailman/listinfo/help-source-highlight


-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


From MAILER-DAEMON Sat Apr 14 12:20:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SJ5iL-0005lW-9t
	for mharc-help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:20:41 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52356)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1SJ5iH-0005lK-TF
	for help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:20:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1SJ5iE-00041T-VB
	for help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:20:37 -0400
Received: from mail-wi0-f171.google.com ([209.85.212.171]:44025)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1SJ5iE-000414-Me
	for help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:20:34 -0400
Received: by wibhj13 with SMTP id hj13so5708868wib.12
	for <help-source-highlight@gnu.org>;
	Sat, 14 Apr 2012 09:20:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=OTwdRsI027O1LCoT8PrcEST8CHsGey62a/4Y0brv60U=;
	b=d0mlH6D3M+CgU/kgzpa5/JtLrT4OP8dGLKIvrNedHdFq0fPBuRSoBASUoaxric/S6v
	zyCHiXjeqd6pwe4ttD4b+U5/XksW3LR4wBLztQrt4+oxk8HIm7PO5RmgFQygmey+PS12
	xFkDE+KL3EMaIVrY33luD1O04mXyabxcvXH2gbE1Sq/zSCUxG38vemc+yMU8WB598GzV
	TXokupRvnnOz7Us1LsnhopFC+b6MTCq0H5UZ/UJo4c3sJF670T+ey46ukoGHHZex+uLt
	yTkUER2FAEvk0W/KM6M65j0F7LFiZcN6z3nQ91Fbcxhlgi5LcvkG4FGbH16Yo4PY1mm0
	DOWA==
Received: by 10.180.104.231 with SMTP id gh7mr5086466wib.10.1334420432822;
	Sat, 14 Apr 2012 09:20:32 -0700 (PDT)
Received: from [192.168.1.130] (2-231-9-43.ip204.fastwebnet.it. [2.231.9.43])
	by mx.google.com with ESMTPS id ff9sm5486159wib.2.2012.04.14.09.20.31
	(version=SSLv3 cipher=OTHER); Sat, 14 Apr 2012 09:20:31 -0700 (PDT)
Message-ID: <4F89A40B.3070804@gmail.com>
Date: Sat, 14 Apr 2012 18:21:31 +0200
From: Federico Bruni <fedelogy@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:11.0) Gecko/20120327 Thunderbird/11.0.1
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F53B69D.5080506@gmail.com> <4F899A44.2090801@dsi.unifi.it>
In-Reply-To: <4F899A44.2090801@dsi.unifi.it>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.212.171
Subject: Re: [Help-source-highlight] LilyPond language files completed
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Apr 2012 16:20:40 -0000

Il 14/04/2012 17:39, Lorenzo Bettini ha scritto:
> Federico, Lilypond lang def file is not in git HEAD :)
>
> thanks for your work :)
> cheers
>      Lorenzo

s/not/now :-)
thanks!


From MAILER-DAEMON Sat Apr 14 12:29:10 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SJ5qY-0008PM-1y
	for mharc-help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:29:10 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51847)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1SJ5qV-0008PE-Lq
	for help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:29:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1SJ5qT-0006Ui-V7
	for help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:29:07 -0400
Received: from pianeta.di.unito.it ([130.192.156.1]:40358)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1SJ5qT-0006Qy-Ge
	for help-source-highlight@gnu.org; Sat, 14 Apr 2012 12:29:05 -0400
X-MailScanner-From: bettini@dsi.unifi.it
X-SpamCheck: not spam, SpamAssassin (not cached, score=-102.253, required 3,
	autolearn=not spam, AUTHENTICATEDUSER -100.00, AWL -0.45,
	BAYES_00 -1.90, RCVD_IN_DNSWL_LOW -0.70, RDNS_NONE 0.79)
X-AntiVirus: Email Clean
X-dipinfo-MailScanner-ID: q3EGT1vY023825
X-dipinfo-MailScanner-Information: Please contact Department of Computer
	Science technical staff for more information
Received: from pianeta.di.unito.it ([130.192.156.1])
	by pianeta.di.unito.it (INFO-DIP) with ESMTP id q3EGT1vY023825
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO
	AuthenticatedUser=bettini ) for <help-source-highlight@gnu.org>;
	Sat, 14 Apr 2012 18:29:01 +0200 (CEST)
X-DKIM: OpenDKIM Filter v2.4.1 pianeta.di.unito.it q3EGT1vY023825
Message-ID: <4F89A5CC.2060507@dsi.unifi.it>
Date: Sat, 14 Apr 2012 18:29:00 +0200
From: Lorenzo Bettini <bettini@dsi.unifi.it>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:11.0) Gecko/20120329 Thunderbird/11.0.1
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F53B69D.5080506@gmail.com> <4F899A44.2090801@dsi.unifi.it>
	<4F89A40B.3070804@gmail.com>
In-Reply-To: <4F89A40B.3070804@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 130.192.156.1
Subject: Re: [Help-source-highlight] LilyPond language files completed
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Apr 2012 16:29:09 -0000

On 04/14/2012 06:21 PM, Federico Bruni wrote:
> Il 14/04/2012 17:39, Lorenzo Bettini ha scritto:
>> Federico, Lilypond lang def file is not in git HEAD :)
>>
>> thanks for your work :)
>> cheers
>> Lorenzo
>
> s/not/now :-)

ooppsss... O:)


-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


From MAILER-DAEMON Wed Apr 18 20:17:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SKf42-0005wQ-Ec
	for mharc-help-source-highlight@gnu.org; Wed, 18 Apr 2012 20:17:34 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51064)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <britton.kerin@gmail.com>) id 1SKf40-0005w9-01
	for help-source-highlight@gnu.org; Wed, 18 Apr 2012 20:17:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <britton.kerin@gmail.com>) id 1SKf3y-0004zP-5E
	for help-source-highlight@gnu.org; Wed, 18 Apr 2012 20:17:31 -0400
Received: from mail-iy0-f169.google.com ([209.85.210.169]:61962)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <britton.kerin@gmail.com>) id 1SKf3x-0004yw-UQ
	for help-source-highlight@gnu.org; Wed, 18 Apr 2012 20:17:30 -0400
Received: by iajr24 with SMTP id r24so13878177iaj.0
	for <help-source-highlight@gnu.org>;
	Wed, 18 Apr 2012 17:17:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=J+AUAAvY/05u1pTiCbyXZNtXM1To5pTvvYFeP4uRzVY=;
	b=ymcUza47y4jb/n5QMrhporOaqaTb0UFaM4BrUxAwb0B8oRu8zIFTMguTOQN81uAqB7
	8VqhhUQY5rden5+JwO9qNQlXSKvmvHPlWO331/srF4Vilf/YeAxdPp85OyPoeoVAWYFe
	doR79x28P554LzzbqWrKsq/d0MtfsTVMErugVGutMTHUnEMj3CYrzqTEexVgfDuEol2J
	eAL7/Q7B7BcBY67lUtJb/Lp4CBKujQUlN67xwNiEtsG1lf/ITPZYIIAOqDXojTUJ5koM
	CQuBZUfCK0mllyEcSQhnxkodr3Q0c8bSI/FzpBqf03kROroK0mUaMy2tc/OXg0V3ExJ9
	3b3Q==
MIME-Version: 1.0
Received: by 10.50.183.225 with SMTP id ep1mr3840280igc.1.1334794647389; Wed,
	18 Apr 2012 17:17:27 -0700 (PDT)
Received: by 10.231.251.212 with HTTP; Wed, 18 Apr 2012 17:17:27 -0700 (PDT)
Date: Wed, 18 Apr 2012 16:17:27 -0800
Message-ID: <CAC4O8c9MtxFfhTmsHPpKCd1mewJdpKpZ5OQ+Ba4wAEH961ABrw@mail.gmail.com>
From: Britton Kerin <britton.kerin@gmail.com>
To: help-source-highlight@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.210.169
Subject: [Help-source-highlight] cross-linking all mentioned source files
	for API generation?
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Apr 2012 00:17:33 -0000

Hi.  I'm using source-highlight to generate API docs straight from headers,
sort of like Robodoc, doxygen etc but withouth having to mark everything up.
And you can drill down into the sources at need.

This works really nice I think with a few small issues.  One is that it would be
nice to be able to automatically make links from all explicit mentions of source
files. Right now I post-process the generated HTML like this:

# Generate cross linked header and source files as a simple form of API
# documentation (and for browsable source).
.PHONY: xlinked_source_html
xlinked_source_html:
	rm -f $@/*.[ch]
	find . -name "*.[ch]" -exec cp \{\} $@ \;
	cd $@ ; source-highlight --gen-references=inline *.[ch]
	# This gets a bit wild.  We use ||= to take advantage of non-lexical
	# vars which aren't reinitialized every time through implicit -p loop,
	# to save prohibitively expensive per-line recomputation of known file
	# name regular expression.  The link-for-filename substitution has a
	# negative look-ahead assertion which trims off some file name text
	# that source-highlight itself produces.
	cd $@ ; \
          perl -p -i \
            -e '$$fre ||= join("|", split("\n", `ls -1 *.[ch]`));' \
            -e '$$fre_dot_escape_done ||= ($$fre =~ s/\./\\./g);' \
            -e 's/((?:$$fre)(?!\.html|\:\d+))/<a href="$$1.html">$$1<\/a>/g;' \
            *.html
	rm $@/*.[ch]

I'm not sure exactly how source-highlight could go about building this sort
of thing in.  Or maybe it already does and I missed it somehow.

Also, in those cases where source-highlight generates in-line references
to multiple different functions (presumably because multiple ctags database
entries exist for a symbol) it might be nice to be able to provide some sort
of explicit disambiguation hint in the sources themselves.  The ambiguity
is or course the result of processing everything together, but other strategies
are more complicated.  A small feature like this would let you get about what
you do from doxygen or the like without having to instrument every function,
but only a few in select places for disambiguation.

Just random thoughts.

Britton


From MAILER-DAEMON Sat Apr 21 11:35:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SLcLW-0002EQ-CE
	for mharc-help-source-highlight@gnu.org; Sat, 21 Apr 2012 11:35:34 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52492)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <britton.kerin@gmail.com>) id 1SLcLQ-0002CU-RJ
	for help-source-highlight@gnu.org; Sat, 21 Apr 2012 11:35:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <britton.kerin@gmail.com>) id 1SLcLL-0005ux-6V
	for help-source-highlight@gnu.org; Sat, 21 Apr 2012 11:35:28 -0400
Received: from mail-iy0-f169.google.com ([209.85.210.169]:52829)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <britton.kerin@gmail.com>) id 1SLcLK-0005ti-Sp
	for help-source-highlight@gnu.org; Sat, 21 Apr 2012 11:35:23 -0400
Received: by iajr24 with SMTP id r24so18317074iaj.0
	for <help-source-highlight@gnu.org>;
	Sat, 21 Apr 2012 08:35:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type:content-transfer-encoding;
	bh=E0kseLhIzjfnx0rK3kOqQAxbUm7Od1iQJO4xOSv1dt8=;
	b=pqp03T4hjfMtCRqkj3UV6eJ7D9WiRLTKgD4s3whfJdSiopj8UxerqJIZD8m8CcBsGA
	wQkLzJtCe4Q8pekecMEzdvzB2ooQjYaqMrTl5znoKBnXcybXieFI7qWBbIgJ7L+uyoAG
	4le4wqXMsaFge7ap7oi+vK+JMbSsGipDAZv9Kh7pRIUULU/VoSIyxzm6EjiyWN5SHQIy
	DIBUoKTVBaHQr9UfAxvY7wqSa4ZSXxM7WY8DmSb1O6zm0KojekS0e0DZ0nIobQq4Q7M1
	TdWAY9baj7D9J6xh3HY1SkR5oFYRLw4qHno4Ym+Y4cYxewO/tPOGB2RekudND7A42V2M
	mjYA==
MIME-Version: 1.0
Received: by 10.42.97.194 with SMTP id p2mr7707570icn.36.1335022520138; Sat,
	21 Apr 2012 08:35:20 -0700 (PDT)
Received: by 10.231.251.212 with HTTP; Sat, 21 Apr 2012 08:35:20 -0700 (PDT)
In-Reply-To: <CAC4O8c9MtxFfhTmsHPpKCd1mewJdpKpZ5OQ+Ba4wAEH961ABrw@mail.gmail.com>
References: <CAC4O8c9MtxFfhTmsHPpKCd1mewJdpKpZ5OQ+Ba4wAEH961ABrw@mail.gmail.com>
Date: Sat, 21 Apr 2012 07:35:20 -0800
Message-ID: <CAC4O8c_D8tzE1gsjeXuDsWGUGKoBAF4xYFPuNAw7q-YFvrRL-g@mail.gmail.com>
From: Britton Kerin <britton.kerin@gmail.com>
To: help-source-highlight@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.210.169
Subject: Re: [Help-source-highlight] cross-linking all mentioned source
	files for API generation?
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 21 Apr 2012 15:35:32 -0000

Here is a slight refinement to the previous recipe that avoids matches of
partial file names at the trailing end of longer file names:

# Generate cross linked header and source files as a simple form of API
# documentation (and for browsable source).
.PHONY: xlinked_source_html
xlinked_source_html:
	rm -rf $@
	mkdir $@
	find . -name "*.[ch]" -exec cp \{\} $@ \;
	cd $@ ; source-highlight --gen-references=3Dinline *.[ch]
	# This gets a bit wild.  We use ||=3D to take advantage of non-lexical
	# vars which aren't reinitialized every time through implicit -p loop,
	# to save prohibitively expensive per-line recomputation of known file
	# name regular expression.  The link-for-filename substitution has some
	# negative look-behind and look-ahead assertions which prevent partial
	# file names from matching and trim off some file name text that
	# source-highlight itself produces.
	cd $@ ; \
          perl -p -i \
            -e '$$frgx ||=3D join("|", split("\n", `ls -1 *.[ch]`));' \
            -e '$$fre_dot_escape_done ||=3D ($$frgx =3D~ s/\./\\./g);' \
            -e 's/((?<!\w)(?:$$frgx)(?!\.html|\:\d+))' \
            -e ' /<a href=3D"$$1.html">$$1<\/a>/gx;' \
            *.html
	rm $@/*.[ch]
	rm $@/tags


On Wed, Apr 18, 2012 at 4:17 PM, Britton Kerin <britton.kerin@gmail.com> wr=
ote:
> Hi. =A0I'm using source-highlight to generate API docs straight from head=
ers,
> sort of like Robodoc, doxygen etc but withouth having to mark everything =
up.
> And you can drill down into the sources at need.
>
> This works really nice I think with a few small issues. =A0One is that it=
 would be
> nice to be able to automatically make links from all explicit mentions of=
 source
> files. Right now I post-process the generated HTML like this:
>
> # Generate cross linked header and source files as a simple form of API
> # documentation (and for browsable source).
> .PHONY: xlinked_source_html
> xlinked_source_html:
> =A0 =A0 =A0 =A0rm -f $@/*.[ch]
> =A0 =A0 =A0 =A0find . -name "*.[ch]" -exec cp \{\} $@ \;
> =A0 =A0 =A0 =A0cd $@ ; source-highlight --gen-references=3Dinline *.[ch]
> =A0 =A0 =A0 =A0# This gets a bit wild. =A0We use ||=3D to take advantage =
of non-lexical
> =A0 =A0 =A0 =A0# vars which aren't reinitialized every time through impli=
cit -p loop,
> =A0 =A0 =A0 =A0# to save prohibitively expensive per-line recomputation o=
f known file
> =A0 =A0 =A0 =A0# name regular expression. =A0The link-for-filename substi=
tution has a
> =A0 =A0 =A0 =A0# negative look-ahead assertion which trims off some file =
name text
> =A0 =A0 =A0 =A0# that source-highlight itself produces.
> =A0 =A0 =A0 =A0cd $@ ; \
> =A0 =A0 =A0 =A0 =A0perl -p -i \
> =A0 =A0 =A0 =A0 =A0 =A0-e '$$fre ||=3D join("|", split("\n", `ls -1 *.[ch=
]`));' \
> =A0 =A0 =A0 =A0 =A0 =A0-e '$$fre_dot_escape_done ||=3D ($$fre =3D~ s/\./\=
\./g);' \
> =A0 =A0 =A0 =A0 =A0 =A0-e 's/((?:$$fre)(?!\.html|\:\d+))/<a href=3D"$$1.h=
tml">$$1<\/a>/g;' \
> =A0 =A0 =A0 =A0 =A0 =A0*.html
> =A0 =A0 =A0 =A0rm $@/*.[ch]
>
> I'm not sure exactly how source-highlight could go about building this so=
rt
> of thing in. =A0Or maybe it already does and I missed it somehow.
>
> Also, in those cases where source-highlight generates in-line references
> to multiple different functions (presumably because multiple ctags databa=
se
> entries exist for a symbol) it might be nice to be able to provide some s=
ort
> of explicit disambiguation hint in the sources themselves. =A0The ambigui=
ty
> is or course the result of processing everything together, but other stra=
tegies
> are more complicated. =A0A small feature like this would let you get abou=
t what
> you do from doxygen or the like without having to instrument every functi=
on,
> but only a few in select places for disambiguation.
>
> Just random thoughts.
>
> Britton


