Commit Graph
54 Commits
Author SHA1 Message Date
jessica parsons 5e2f73aec4 update my name to the current one 2024-03-29 23:41:29 -07:00
David Seifert 7afa5c6242 Make C99 clean
* Clang 16 (and likely GCC 14) will enforce strict C99 semantics
  and break old K&R C declarations and require correct C89
  function prototypes.

Bug: https://bugs.gentoo.org/870952
Clang: https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213/9
2022-10-27 11:08:49 -07:00
david parsons ef25172009 start tweaking in preprocessor support; start with a rough m4 framework 2022-10-22 20:33:17 -07:00
david parsons 25f24b5bf4 rework how flags are initialized & configured for <?theme commands 2022-07-29 23:59:48 -07:00
david parsons f02cee798f accidentally mixed code and declarations in theme.c, which makes old versions of gcc puke 2020-11-27 08:09:06 -08:00
david parsons c4b97d6cf7 use mkd_free_flags() in all the demo programs 2020-04-08 12:26:13 -07:00
david parsons 2e900346a0 make the published mkd_flag_t opaque and add a new function (mkd_flags()) to generate a flag structure and return it in malloced memory 2020-03-07 19:56:22 -08:00
david parsons 43c5c0496b fix up theme default settings 2019-12-10 22:37:51 -08:00
david parsons b9e867b574 redo the whole flags dealie as an opaque blob 2019-12-07 22:49:52 -08:00
david parsons cf74d6d218 make all instances of 'main()' be integer functions (sigh) 2018-09-16 14:41:42 -07:00
Andrew Gwozdziewycz b8eccaf7a7 Add missing -t flag for template file handling. 2018-03-09 00:31:59 -08:00
david parsons 61d5703bfd change the variable name for the output file to output_file (to avoid confusion with all of the functions that use output as a output file descriptor variable) and use malloc instead of alloca to allocate it (possible ms-windows defect with how alloca works?) 2018-02-28 11:56:49 -08:00
david parsons beeb569412 Correct makepage & theme to use the new set_flag() return scheme (0==success, !0==pointer to bogus flag) 2017-09-25 12:44:43 -07:00
david parsons dfa77baba7 (the return from notspecial() was reversed) 2017-02-04 23:56:46 -08:00
david parsons ce4d3f4cac gethopt()ify theme 2017-02-02 21:17:52 -08:00
david parsons 9b792090ce Tweak the show_flags() function so that if it's called verbosely
it will show synonyms for named flags.   (Calling it verbosely is
done by the `V` option, which is overloaded for verbosity when listing
flags.)
2017-01-26 23:40:04 -08:00
david parsons eaafb13ada Add --h1-title as an option to configure.sh; this enables code that uses
the first h1 in a document as the document title (in mkd2html & theme)
2017-01-24 15:47:57 -08:00
david parsons 7f67c5e71d Check for the existance of alloca (for theme) and whether it requires alloca.h 2015-10-30 22:27:43 -07:00
david parsons 18115591ac Theme really wants the old behavior of --with-(foo), so pass those settings into theme in a #define 2015-07-14 12:17:21 -07:00
david parsons abfd8b0020 Allow the magic output filename -, which means send output to
stdout instead of to a file.
2014-08-07 23:37:09 -07:00
david parsons 199213eb2e Modify theme so that I can pass in options (with -C & -c; -o is used) 2012-04-03 13:23:21 -07:00
david parsons 6eacbc931b I macro if(e) into if( (e) ) if gcc or clang are detected 2012-01-24 09:53:51 -08:00
david parsons 094b09800e 1. In configure.inc, check for (and comment disapprovingly) if someone is inflicting clang on discount.
2. strip types off `main()`s so that stupid clang won't die.
2011-10-06 23:26:33 -07:00
david parsons d4ea79f47a Add a -E flag to theme to allow <?theme expansions
everywhere (except in html comments) instead of being
context-sensitive
2011-07-13 10:56:24 -07:00
david parsons 3b24127f58 Add <?theme config?>, which writes a listing of all of the runtime
settings to the output file.
2010-11-10 23:22:23 -08:00
David Parsons ecf0b01d3f When figuring where to put the .html for an output file, take into
account the teeny detail that the source filename might not have an
extension to strip off.
2010-06-16 18:14:33 -07:00
david parsons f078ee6069 Tweak the fdate() function so that it takes the document date,
and if that doesn't exist and there's a file date, that one.
2009-11-28 22:07:40 -08:00
David Parsons 94c0e700b4 1. Add a new flag (MKD_NOTABLES) to turn off the table extension.
2. Theme is /still/ broken for generating output files -- try to fix again.
3. Add more table test cases.
2009-08-02 10:32:02 -07:00
David Parsons 8ca7a50e70 mkd_text() is now mkd_generateline(); the new
function `mkd_line()` formats a line into a string,
similarly to `mkd_toc()`, `mkd_xml()`, and so on.

There are a whole bunch of new public functions now,
so I'm pushing the version up to 1.4.0
2009-05-12 10:49:51 -07:00
David Parsons 93560cbefb In theme.c and xmlpage.c, use mkd_generatecss() instead
of the unfortunately named `mkd_style()` to print out the
stylesheets.
2009-05-12 07:00:23 -07:00
David Parsons 2dcf207a49 1. Rework the way I process html blocks; now I walk through and look at
tokens instead of just matching the beginning of the line.  This will
   hopefully make it handle user html in a more graceful manner.
2. Fix theme so it won't dump the generated html into the parent directory
   when I give it a directory name to themify.
2009-04-27 17:21:06 -07:00
David Parsons a59e83ec29 Add support for table-of-contents generation (code supplied by Jjgod Jiang)
and a function that generates a rudimentary xhmtl page from a markdown
document (idea from Tim Channon)
2008-09-26 11:39:32 -07:00
david parsons 89b513d761 If theme is given a directory argument, attempt to open the
file ``index'' in that directory.
2008-09-02 22:09:58 -07:00
david parsons 713dc135c4 Correct a misspelling of ``template'' 2008-04-14 01:46:41 -07:00
david parsons 5c6115c601 1. Add the new amalloc module, which (if enabled with
--enable-amalloc) replaced malloc and its ilk with
    versions that attempt to maintain a linked list of
    allocated blocks that can be printed to stderr with
    the `adump()` function.

2.  Clean up a couple more places where I leak memory
    during the first level parse.

3.  tweak cstring.h to try to chase down places where
    the C compiler might optimize EXPAND() into producing
    broken code.
2008-04-03 11:22:07 -07:00
david parsons 41c153a48a Replace all alloca()s with malloc() 2008-03-13 16:49:46 -07:00
david parsons ee8b9dd2a9 1. Change emphasis to make it less greedy; *** was <strong><em>, is now
`<em><strong>` (prepwork for properly blocking emphasis blocks)
2. In the `fchdir()` version of `popd()`, don't forget to define
   `rc` before I use it.
2008-03-03 22:44:54 -08:00
David Parsons aee5f3bff0 More MS-DOS compatability; fchdir() is not defined in all versions
of mingw/msys, so fake it there with getcwd() and chdir().
2008-03-03 22:33:25 -08:00
david parsons 88a3fe3447 Tweak the logic where I attempt to get the document author 2008-02-28 00:21:59 -08:00
david parsons ba86426101 Check for the existance of pwd.h and getpwuid() before doing fancy
"get password information for author and root" gymnastics.
2008-02-25 10:32:05 -08:00
david parsons dd79f848b7 1. version[] -> markdown_version[]
2. clean up \-escapes so that only special characters will be escaped.
 3. Use the entity &#0; as a token break.
 4. check for the existance of goddamn gcc
2008-02-18 10:09:23 -08:00
david parsons 8a80038fad Write a manpage for theme(1) 2008-01-23 17:20:45 -08:00
david parsons 52bc316ff9 1. in mkdio.h, tweak the MMIOT abstract type from `void\*'' to `void''.
2. in `theme.c` ...
    1. use a keyword table instead of an inline islike() cascade.
    2. make `?theme source?` print the **basename** of the pagename, and
    3. add the new `?theme path?` to print the dirname of the pagename
3. when configuring, check for a sane (reentrant) `basename()` function.
4. when giving the package version#, say `discount` instead of `markdown`
2008-01-23 11:43:54 -08:00
david parsons d5266835af Forgot a comment in the xref section of mkd-functions.3
Add the -V option to theme
2008-01-19 00:29:16 -08:00
david parsons 186eb7ca5a The smartypants code was checking smarties _after_ doing quote
substitution.  This messed up 's and 't.
Also make <?theme include(x)?> actually work.
2008-01-18 15:31:42 -08:00
david parsons fa43fd7e27 Support <?theme include(file)?> 2008-01-18 14:04:20 -08:00
david parsons da30b6224f Check more carefully about inside tag/outside tag changes; if we're inside
tag text, emphasis and linkylinky isn't anymore.
2008-01-18 11:18:00 -08:00
david parsons 0cdbbea9f9 Add support for <style> and <script> html blocks.
`<script>` blocks are added by the simple expedient of adding "`SCRIPT`" to
the blocktags[] table, but `<style>` blocks need to be written into the
document `<head>`, so they have to be stored as a different type and
output with the new function `mkd_style()` and **not** by `mkd_generatehtml()`
2008-01-17 12:38:40 -08:00
david parsons 37044fd38d In linkytitle(), a ) shouldn't drop out of the title string unless at
least two quotes have been seen.
2008-01-16 16:56:58 -08:00
david parsons 841101bbc6 theme pulls document author and date from the document status,
if at all possible.   Also put in a new flag `-f`, which forces
a write to the file by the simple expedient of removing the
old one before running.
2008-01-15 13:48:04 -08:00