Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Write the first (clumsy) pass at a mkd-callbacks manpage, and .Xr

 it the other manpages as appropriate.
  • Loading branch information...
commit 9131d15a85a1524992e782dcb21398de707c445c 1 parent 3aa4343
David Parsons authored
4 Makefile.in
@@ -15,6 +15,8 @@ OBJS=mkdio.o markdown.o dumptree.o generate.o \
15 15 resource.o docheader.o version.o toc.o css.o \
16 16 xml.o Csio.o xmlpage.o basename.o emmatch.o @AMALLOC@
17 17
  18 +MAN3PAGES=mkd-callbacks.3 mkd-functions.3 markdown.3 mkd-line.3
  19 +
18 20 all: $(PGMS) $(SAMPLE_PGMS)
19 21
20 22 install: $(PGMS)
@@ -31,7 +33,7 @@ install.samples: $(SAMPLE_PGMS) install
31 33
32 34 install.man:
33 35 @INSTALL_DIR@ $(DESTDIR)/$(MANDIR)/man3
34   - @INSTALL_DATA@ mkd-functions.3 markdown.3 mkd-line.3 $(DESTDIR)/$(MANDIR)/man3
  36 + @INSTALL_DATA@ $(MAN3PAGES) $(DESTDIR)/$(MANDIR)/man3
35 37 for x in mkd_line mkd_generateline; do \
36 38 ( echo '.\"' ; echo ".so man3/mkd-line.3" ) > $(DESTDIR)/$(MANDIR)/man3/$$x.3;\
37 39 done
1  markdown.3
@@ -103,6 +103,7 @@ and
103 103 functions return a MMIOT* on success, null on failure.
104 104 .Sh SEE ALSO
105 105 .Xr markdown 1 ,
  106 +.Xr mkd-callbacks 3 ,
106 107 .Xr mkd-functions 3 ,
107 108 .Xr mkd-line 3 ,
108 109 .Xr markdown 7 ,
1  markdown.7
@@ -1001,6 +1001,7 @@ John Gruber
1001 1001 .Sh SEE ALSO
1002 1002 .Xr markdown 1 ,
1003 1003 .Xr markdown 3 ,
  1004 +.Xr mkd-callbacks 3 ,
1004 1005 .Xr mkd-functions 3 ,
1005 1006 .Xr mkd-extensions 7 .
1006 1007 .Pp
71 mkd-callbacks.3
... ... @@ -0,0 +1,71 @@
  1 +.\"
  2 +.Dd January 18, 2008
  3 +.Dt MKD_CALLBACKS 3
  4 +.Os Mastodon
  5 +.Sh NAME
  6 +.Nm mkd_callbacks
  7 +.Nd functions that modify link targets
  8 +.Sh LIBRARY
  9 +Markdown
  10 +.Pq libmarkdown , -lmarkdown
  11 +.Sh SYNOPSIS
  12 +.Fd #include <mkdio.h>
  13 +.Ft char*
  14 +.Fn (*mkd_callback_t) "const char*" "const int" "void*"
  15 +.Ft void
  16 +.Fn (*mkd_free_t) "char *" "void*"
  17 +.Ft void
  18 +.Fn mkd_e_url "MMIOT *document" "mkd_callback_t edit"
  19 +.Ft void
  20 +.Fn mkd_e_flags "MMIOT *document" "mkd_callback_t edit"
  21 +.Ft void
  22 +.Fn mkd_e_free "MMIOT *document" "mkd_free_t dealloc"
  23 +.Ft void
  24 +.Fn mkd_e_data "MMIOT *document" "void *data"
  25 +.Sh DESCRIPTION
  26 +.Pp
  27 +.Nm Discount
  28 +provides a small set of data access functions to let a
  29 +library user modify the targets given in a `[]' link, and to
  30 +add additional flags to the generated link.
  31 +.Pp
  32 +The data access functions are passed a character pointer to
  33 +the url being generated, the size of the url, and a data pointer
  34 +pointing to a user data area (set by the
  35 +.Fn mkd_e_data
  36 +function.) After the callback function is called (either
  37 +.Fn mkd_e_url
  38 +or
  39 +.Fn mkd_e_flags )
  40 +the data freeing function (if supplied) is called and passed the
  41 +character pointer and user data pointer.
  42 +.Sh EXAMPLE
  43 +The
  44 +.Fn mkd_basename
  45 +function (in the module basename.c) is implemented by means of
  46 +mkd callbacks; it modifies urls that start with a `/' so that
  47 +they begin with a user-supplied url base by allocating a new
  48 +string and filling it with the base + the url. Discount plugs
  49 +that url in in place of the original, then calls the basename
  50 +free function (it only does this when
  51 +.Fn mkd_e_url
  52 +or
  53 +.Fn mkd_e_flags
  54 +returns nonzero) to deallocate this memory.
  55 +.Pp
  56 +Note that only one level of callbacks are supported; if you
  57 +wish to do multiple callbacks, you need to write your own
  58 +code to handle them all.
  59 +.Sh SEE ALSO
  60 +.Xr markdown 1 ,
  61 +.Xr markdown 3 ,
  62 +.Xr mkd-line 3 ,
  63 +.Xr markdown 7 ,
  64 +.Xr mkd-extensions 7 ,
  65 +.Xr mmap 2 .
  66 +.Pp
  67 +basename.c
  68 +.Pp
  69 +http://daringfireball.net/projects/markdown/syntax
  70 +.Sh BUGS
  71 +Error handling is minimal at best.
1  mkd-extensions.7
@@ -169,6 +169,7 @@ David Parsons
169 169 .Sh SEE ALSO
170 170 .Xr markdown 1 ,
171 171 .Xr markdown 3 ,
  172 +.Xr mkd-callbacks 3 ,
172 173 .Xr mkd-functions 3 ,
173 174 .Xr mkd-line 3 ,
174 175 .Xr mkd-extensions 7 .

0 comments on commit 9131d15

Please sign in to comment.
Something went wrong with that request. Please try again.