public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Self-documenting Lua modules
@ 2020-08-11  9:19 Albert Krewinkel
       [not found] ` <87h7t9ilp2.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Albert Krewinkel @ 2020-08-11  9:19 UTC (permalink / raw)
  To: pandoc-discuss

Dear *,

I'm working on some code to improve Lua bindings and integration
and would appreciate feedback on the approach.

In a PR discussion on GitHub, jgm describes the problem which I'm
now trying to solve:

> I'm getting a bit worried about the ongoing maintenance cost of
> shadowing large parts of the pandoc (and related) API with Lua.
> In the present case: if I make further changes to doclayout,
> then this custom Lua code needs to be updated, and so does the
> documentation. However, I'm not sure anything would
> automatically alert us to the need to do these things, which
> raises a danger of breakage as things get out of sync
> (especially if you ever stop being such an active contributor to
> the project).

Currently, pandoc's Lua documentation and Lua bindings are
entirely separate. The missing documentation for the new table
format recently is an excellent example of the problems we are
facing and highlights the shortcomings of our current method.

The idea is thus to co-locate documentation and code. Here is a
first prototype, using a potential `paths` module for filepath
handling as an example:
<https://github.com/hslua/hslua-module-paths>
Explicit typing of function parameters should give better
compile-time guarantees, while keeping documentation close to the
code should reduce the risk of an outdated manual. The
documentation for this module can be generated by running `cabal
run tools/print-docs.hs`.

If anyone has experience with this kind of approach, can comment
on the code, or wants to share other ideas that could help us make
pandoc's Lua code more robust, then I'd love to hear about it.

Cheers,
Albert

--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-12 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11  9:19 Self-documenting Lua modules Albert Krewinkel
     [not found] ` <87h7t9ilp2.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2020-08-11 22:06   ` Gabriel Nützi
     [not found]     ` <22D9BE00-5CC2-4AD6-B146-7F5CFA014E19-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-08-12 14:37       ` Albert Krewinkel
     [not found]         ` <87bljghqw8.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2020-08-12 17:46           ` John MacFarlane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).