summaryrefslogtreecommitdiff
path: root/bk_whlp.c (follow)
Commit message (Collapse)AuthorAge
* Add \s for 'strong' text, i.e. bold rather than italics. I've missedSimon Tatham2013-03-10
| | | | | | | | | | | | | | this a couple of times in Halibut markup recently (in particular, it's handy to have a typographical distinction between 'this term is emphasised because it's new' and 'this term is emphasised because I want you to pay attention to it'), so here's an implementation, basically parallel to \e. One slight oddity is that strong text in headings will not be distinguished in some output formats, since they already use bolded text for their headings. [originally from svn r9772]
* Revamp of the Halibut error handling mechanism.Simon Tatham2012-08-29
| | | | | | | | | | | | | | | | I'm not quite sure why I ever thought it was a good idea to have a central variadic error() function taking an integer error code followed by some list of arguments that depend on that code. It now seems obvious to me that it's a much more sensible idea to have a separate function per error, so that we can check at compile time that the arguments to each error call are of the right number and type! So I've done that instead. A side effect is that the errors are no longer formatted into a fixed-size buffer before going to stderr, so I can remove all the %.200s precautions in the format strings. [originally from svn r9639]
* Introduce global (cross-backend) \cfg{contents} and \cfg{index}Simon Tatham2006-06-02
| | | | | | | commands, allowing the fixed words "Contents" and "Index" generated in various output formats to be reconfigured into other languages. [originally from svn r6724]
* Missing error handling: the HTML and WinHelp back ends would bothSimon Tatham2006-05-18
| | | | | | segfault if they were unable to open their output files. [originally from svn r6704]
* Failed to initialise state.curr_topic early enough, causingSimon Tatham2004-07-13
| | | | | | | uninitialised-memory references and a segfault. Quite why this never happened when I tested it at home, I have no idea! [originally from svn r4326]
* nit: s/case-sensitive/case-insensitive/ in comment about nasty indexingJacob Nevins2004-06-21
| | | | | | hack. [originally from svn r4311]
* Moderately nasty workaround for the fact that Windows Help's indexSimon Tatham2004-06-19
| | | | | | | | | mechanism is case-insensitive with respect to sorting the list of index entries. We now append nonbreaking spaces to the ends of some index terms to ensure they are considered distinct. (Nasty, but it seems to work.) [originally from svn r4294]
* Switch the memory allocation macros from the Halibut onesSimon Tatham2004-06-12
| | | | | | | | | | | | | (mknew/mknewa/resize) to the PuTTY ones (snew/snewn/sresize). snewn and mknewa have their arguments opposite ways round; this may make the change initially painful but in the long term will free me of a nasty context switch every time I move between codebases. Also sresize takes an explicit type operand which is used to cast the return value from realloc, thus enforcing that it must be correct, and arranging that if anyone tries to compile Halibut with a C++ compiler there should be a lot less pain. [originally from svn r4276]
* Character-set-isation and configurability in the WinHelp backend.Simon Tatham2004-05-23
| | | | | | | | | Newly configurable things are: bullet and quote characters as usual, the ": " that goes between a section number and its title, the "." coming after numbered-list item numbers, and the text "Title page" that appears at the top of the .cnt file. [originally from svn r4248]
* Kurt Jung points out that nav menus ought to be WHLP_PARA_SCROLL,Simon Tatham2004-05-16
| | | | | | not _NONSCROLL. [originally from svn r4228]
* Windows Help backend was only accepting \cfg{winhelp-filename} if itSimon Tatham2004-05-03
| | | | | | | | | had a parent pointer (owing to putting the test inside the wrong if block). This meant that the fake config directive added by --winhelp=foo.hlp worked fine, but the one at the top of PuTTY's first doc file didn't. Fixed. [originally from svn r4190]
* The Windows Help backend now uses libcharset to the maximum extentSimon Tatham2004-04-20
| | | | | | | | | | it can. (Which isn't much, since I currently don't know how to indicate that a help file is encoded in anything other than Win1252, and so the only use I found for libcharset was to replace the previous pathetic 8859-1 conversion so that extra things like the trademark sign are supported.) [originally from svn r4102]
* Infrastructure changes for character set support. ustrtoa,Simon Tatham2004-04-20
| | | | | | | | | | | ustrfroma, utoa_dup and ufroma_dup now take a charset parameter, and also have a variety of subtly distinct forms. Also, when a \cfg directive is seen in the input file, the precise octet strings for each parameter are kept in their original form as well as being translated into Unicode, so that when they represent filenames they can be used verbatim. [originally from svn r4097]
* Better robustness when backends encounter a Unicode character notSimon Tatham2004-04-19
| | | | | | representable in the output character set. [originally from svn r4094]
* Initial work on PS and PDF output. Because these two backends shareSimon Tatham2004-04-13
| | | | | | | | | | | | | | | | | | | an enormous amount of preprocessing and differ only in their final output form, I've introduced a new type of layer called a `pre-backend' (bk_paper.c is one). This takes all the information passed to a normal backend and returns an arbitrary void *, which is cached by the front end and passed on to any backend(s) which state a desire for the output of that particular pre-backend. Thus, all the page layout is done only once, and the PS and PDF backends process the same data structures into two output files. Note that these backends are _very_ unfinished; all sorts of vital things such as section numbers, list markers, and title formatting are missing, the paragraph justification doesn't quite work, and advanced stuff like indexes and PDF interactive features haven't even been started. But this basic framework generates valid output files and is a good starting point, so I'm checking it in. [originally from svn r4058]
* Arrange a mechanism whereby each backend can be passed a filenameSimon Tatham2004-04-01
| | | | | | | | | from its command-line option (`--text=foo.txt') and automatically convert it into one or more notional \cfg directives. In the HTML case this mechanism enables single-file mode as well as setting the filename. [originally from svn r4018]
* Add \cfg / -C directives to allow the user to choose the output fileSimon Tatham2004-04-01
| | | | | | name (or name schema, in HTML). [originally from svn r4017]
* Oops; uninitialised variable.Simon Tatham2004-03-31
| | | | [originally from svn r4011]
* Simplify treatment of the copyright notice, now I've also simplifiedSimon Tatham2004-03-30
| | | | | | | | | the preamble: \copyright paragraphs are now treated identically to normal paragraphs (so they appear precisely where they're put instead of in a fixed location), _except_ that the Windows Help backend also copies their text into the help file's copyright slot. [originally from svn r4001]
* Obsoleted the `\preamble' command. Preamble text is now taken to beSimon Tatham2004-03-25
| | | | | | | | | | any ordinary displayable paragraph(s) appearing before the first chapter heading, meaning in particular that you can put lists, code paragraphs etc in preambles. Of course, `\preamble' is still supported for backwards compatibility, but it's now a zero-effect paragraph marker. [originally from svn r3981]
* Add a \quote{...} directive, working like <blockquote> in HTML.Simon Tatham2004-03-25
| | | | [originally from svn r3978]
* Cleanups to complete the man page backend. Also, an additional newSimon Tatham2004-03-24
| | | | | | | | | | | | | markup feature: a \c line in a code paragraph can now be followed by an optional \e line indicating emphasised bits of its preceding \c. This allows discretionary bolding and (italic/underline) emphasis within code paragraphs, but without introducing an escape character or breaking any existing input files. Users are warned that not all backends are required to actually render these hints, and so they should avoid depending on them 100% to convey semantic information unless they know they're writing for a restricted range of backends. [originally from svn r3965]
* Man-page back end for Halibut. Also, a couple of additional markupSimon Tatham2004-03-23
| | | | | | | | | features commonly used in man pages: (a) the ability to nest paragraph breaks, code paragraphs and other lists inside list items, and (b) description lists as normally used in man pages to describe command-line options. [originally from svn r3954]
* WinHelp backend segfaults when it finds a nonexistent cross-Simon Tatham2003-01-09
| | | | | | | | reference. (The broken link will already have been reported in the mid-end, but this won't inhibit output generation, so the onus is still on us to at the very least not go *crash*.) [originally from svn r2507]
* Rename Buttress to Halibut. I _think_ I've caught everything in this pass.Simon Tatham2002-08-05
| | | | [originally from svn r1800]
* The .CNT workaround didn't work in all cases (specifically,Simon Tatham2001-12-10
| | | | | | | | | top-level leaf nodes simply can't be done, because you can't lower the level of the node to 0 to compensate for the bug because the parser rejects it). A different workaround is now in place for those cases. [originally from svn r1465]
* Allow the user to specify the Help topic ID string for particularSimon Tatham2001-12-06
| | | | | | | | | | sections. Useful if another program needs to jump to a particular topic. (Really we should support the proper CTXOMAP / HELP_WM_HELP system for doing this, but I don't like numeric IDs; you'd have to parse a bunch of #defines in order to sensibly synchronise the IDs between help file and code.) [originally from svn r1457]
* Create a .CNT contents file alongside the .HLP. (The .CNT file isSimon Tatham2001-12-06
| | | | | | | | | deliberately incorrect, to compensate for a bug in WinHelp. With any luck MS will never fix the bug and this .CNT will continue to work forever. Since WinHelp is theoretically obsolete, this sounds reasonably likely.) [originally from svn r1456]
* Remove the text-mode trappings (_emphasis_ and `code') in the indexSimon Tatham2001-12-04
| | | | | | | terms and section titles. They were unfortunately screwing up index sorting, so they had to go. [originally from svn r1455]
* Oops - missed out a set_font call which was bizarrely causingSimon Tatham2001-12-04
| | | | | | strikethrough on bullets. *boggle* [originally from svn r1454]
* In winhelp.c: allowed user to configure the Font section to theirSimon Tatham2001-12-04
| | | | | | | | | | | | | | liking, as planned. In bk_whlp.c, this has now allowed me to stop emphasis and code from looking silly in section titles, and also allowed me to implement an ersatz horizontal rule in the form of eighty centred nonbreaking spaces in a strike-through font. I know it's vile, but better suggestions are welcome. I think the Windows Help backend is now pretty much Go: I was getting intermittent screwups earlier but I think those were Samba cache persistence problems rather than evil segfaults. All that's really missing now is external context references. [originally from svn r1453]
* Bah, and update the todo at the top of the file. :-)Simon Tatham2001-12-04
| | | | [originally from svn r1452]
* *giggle* Index terms were getting processed even in the navigationSimon Tatham2001-12-04
| | | | | | menus at the bottom of help topics. Now fixed. What a cool bug :-) [originally from svn r1451]
* Indexing in the Help backend now seems to work! Woo!Simon Tatham2001-12-04
| | | | [originally from svn r1450]
* This update should bring the Windows Help back end up toSimon Tatham2001-12-04
| | | | | | | near-complete functionality. All that's missing now is indexing and horizontal rules. [originally from svn r1449]
* Most of a Windows Help back end now appears to work. Missing areSimon Tatham2001-12-04
hierarchical topic navigation (menus at the bottom of non-leaf topics, and the Up button) and index support; also I want to give users the ability to specify context IDs for particular topics. Oh, and I haven't found a plausible way to express a horizontal rule in either .RTF or .HLP format. But everything else appears to be there. [originally from svn r1447]