Commit graph

34 commits

Author SHA1 Message Date
Xavier Mendez
7ef947dd17 examples: hoedown_markdown was typedef'ed for some reason! 2013-10-09 15:02:24 +02:00
Xavier Mendez
aef3d53eab Let the examples use the new API! 🎉 2013-10-06 20:44:57 +02:00
Xavier Mendez
6d3acbd672 API-v2: Rename hoedown_callbacks to hoedown_renderer 2013-10-06 16:31:42 +02:00
Devin Torres
f8c7a584f0 All exposed structs are now opaque typedefs 2013-10-02 14:12:16 -05:00
Devin Torres
3d9ca45d67 Add TOC nesting level option to hoedown_html_renderer
Closes #19.
2013-09-30 19:30:52 -05:00
Devin Torres
2c95da1d7a More cleanup and API coalescing 2013-09-23 19:35:54 -05:00
Xavier Mendez
0b6572bc56 Normalize examples; return as expected 2013-09-21 15:29:41 +02:00
Xavier Mendez
5ec7d0b42b Simplify & fix the reading loop in the examples (closes #12) 2013-09-21 15:20:56 +02:00
Xavier Mendez
1de960a54a General cleanup on file endings 2013-09-20 19:07:30 +02:00
Xavier Mendez
7d69ddd4af Some cleanup on examples/ 2013-09-20 19:06:25 +02:00
Xavier Mendez
2845a9e5c2 Remove unnecessary preambles 2013-09-20 19:00:37 +02:00
Devin Torres
189b325f19 Begin code reorganization 2013-09-20 01:14:14 -05:00
Vicent Marti
23d4fcda11 smartypants: Silence the warning with a (void) cast 2011-11-22 08:10:52 +01:00
jbergstroem
809c8bf15f fix: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result 2011-09-28 23:18:18 +02:00
Vicent Marti
877aa79c9e Fix compilation for Smartypants example 2011-09-13 00:21:33 +02:00
Vicent Marti
b8ed678a98 Enforce const on input document 2011-09-02 21:28:47 +02:00
Vicent Marti
13359d5898 Create a standalone markdown object
This was the next logical step on the interface revamp for 2.0.

The old API was doing very fishy stuff with allocation: the `rndr`
struct was being called once for every `sd_markdown` call, and the
amount stack space filled with it was just inappropriate (256 bytes
just from the char table and 300 more from pointers in the callback
table).

By creating the renderer on the heap and reusing it, we save a lot of
time on initialization code, at the expense of not being able to
change the enabled extensions on each parse (something which is not
that common anyway).

This will make wrapping Sundown in higher level languages more direct,
given that every other language has OO design, which maps better to
the concept of a reusable renderer.
2011-09-01 05:02:26 +02:00
Vicent Marti
dd979be0ed Experimental: New Renderer management
No more dynamic allocation. Explicit is better than implicit.
2011-08-04 16:22:38 +02:00
Vicent Marti
e07028b856 Experimental: Custom allocation of the HTML renderer 2011-08-04 13:14:59 +02:00
Vicent Marti
72c9453882 Merge branch 'master' of github.com:tanoku/sundown 2011-07-24 23:29:23 +02:00
Matt Stancliff
ce1c48aee6 Fix sdhtml_renderer call
The previous commit changed the function signature
without changing a call to the new function signature.
2011-07-23 11:31:08 -07:00
Vicent Marti
7455702aaf Fix fwrite warning in sundown.c 2011-07-19 21:55:07 +02:00
Vicent Marti
5d201dbcdc Rename Upskirt to Sundown
It is by the goodness of God that in our country we have those
three unspeakably precious things:

    freedom of speech,
    freedom of conscience,
    and the prudence never to practice either of them.

                -- Mark Twain, Following the Equator (1897)
2011-07-19 01:10:05 +02:00
Krzysztof Kowalczyk
22ccf400a9 msvc fixes 2011-06-01 19:30:19 +02:00
Vicent Marti
7408928cc8 Everybody's writing Go bindings! 2011-05-24 19:10:19 +03:00
Vicent Marti
beb7b68899 Run the Upskirt executable with no extensions 2011-05-22 15:45:49 +03:00
Joseph Koshy
cf50f681b9 Fix an error message. 2011-05-15 21:23:05 -07:00
Vicent Marti
eb6f5474c2 Upskirt now renders HTML by default
The XHTML renderer has been changed to HTML by default, with a new
renderer flag called "HTML_USE_XHTML" that enables closing tags.
2011-05-06 20:29:41 +03:00
Vicent Marti
789bcd98e1 SmartyPants is now smart
SmartyPants is no longer an extension flag for the (X)HTML renderer, but
a separate method.

The new function `ups_xhtml_smartypants` external method is a
SmartyPants post-processor that takes an HTML document (e.g. a document
that has just been rendered with `ups_markdown`) and performs
SmartyPants substitutions in it.

This is the same approach that the original SmartyPants takes.
Postprocessing the HTML instead of performing the substitutions at the
Markdown level allows us to work around many problems of the old
implementation:

	- Double quotes now properly open/close between different HTML
	tags and blocks.

	- Support for ``double quoting style'' has been added, and no
	longer conflicts with Markdown code blocks.

	- The limitations of the Upskirt parser (which was splitting
	SmartyPants replacements mid-word in some cases because of active
	character callbacks) no longer apply. All SmartyPants substitutions
	work in all situations.

	- The new parser is easily extendable with more substitutions.

The new SmartyPants parser is slightly faster than the old one.
2011-05-05 17:47:37 +03:00
Vicent Marti
9c7100e69f Fix compilation after inlining buffers 2011-04-26 14:00:38 +03:00
Vicent Marti
a76c5f40bd Fix HTML tag detection 2011-04-17 14:05:55 +03:00
Vicent Marti
7c6160bcce Newline after line break 2011-04-17 13:48:50 +03:00
Vicent Marti
481b099032 Add support for syntaxes in fenced code blocks 2011-04-16 13:14:28 +03:00
Vicent Marti
e1e5ea96ff Initial commit 2011-04-15 11:36:46 +03:00