summaryrefslogtreecommitdiffstats
path: root/genman.txr
Commit message (Collapse)AuthorAgeFilesLines
* genman: guard against symbol hash collisions.Kaz Kylheku2023-08-221-6/+10
| | | | | | | | * genman.txr (process-ambiguities): Keep track of calculated hashes and error out when there is a duplicate. When the time comes, we will have to resolve those somehow, and also change the doc function to do it the same way.
* genman: move all hashes into do block.Kaz Kylheku2023-08-221-3/+3
| | | | | | * genman.txr (symhash, tagma, tochash): Define in @(do ...) block with defvar for consistency ith other hashes.
* genman: remove special handling of "NAME".Kaz Kylheku2023-08-221-2/+0
| | | | | | | | | * genman.txr: remove the manual insertion of the mapping of the "lbAB" tag to the new hash for "NAME", the first section of the man page. This is an outdated dud that does nothing. The tag is being properly processed without this hack and the new hash-title function will assign it to a different hash.
* doc: new hashing scheme for navigation, doc lookup.Kaz Kylheku2023-08-221-69/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not an easy change to make because it breaks the validity of existing URLs in the wild which point to specific sections of the TXR manual. Some of my recent changes to capitalization of numerous headings have already broken many URLs, so we might as well bite the bullet and do this now. The problem with the current scheme is that entire section titles are hashed: all the words of a title, not just the names of functions. Whenever we add a new function, macro or variable which is documented together with related functions in the same paragraph under the same heading, the heading changes, and the hash changes. For instance, the hash for the hash-map identifier is actually the hash of the string "Function <tt>hash-map</tt>". Under the new scheme, section titles are hashed in a more complicated way that is robust against most edits. If a title contains any symbols marked up with <tt>, then the leftmost such symbol is taken as the title. Otherwise, the whole title is mapped to lower case. There is no longer a stdlib/doc-syms.tl file, and the special disambiguated "D-<HEX>" codes are also gone. Symbols are no longer associated with section hashes or disambiguation section codes. The hash of a symbol is a 32 bit CRC-32 checksum, expressed as S-<HEX> where <HEX> is 8 hex digits. A section which defines symbols has not only a <a name="..."> for its own hash but also additional <a name="...>" elements for each of the symbols that it defines. If a section defines an ambiguous symbol (one that is also defined with a different meaning in a different section), then that symbol is not linked to either section; it is mapped to the generated disambiguating section. * genman.txr (dupes): Renamed to dupe-hashes for clarity. (tagnum): Hash removed. (direct): New hash. Tracks the assocation between sections hashes and hashes of symbols that are defined only in those symbols (no ambiguity) and thus the symbol hashes can navigate directly to the sections. Serves as a complement to the disamb hash. (colli): There are no collisions now, so initialize this to empty. (hash-str): Function removed. (hash-title): This function becomes more complicated. If a title has at least one <tt>..</tt> item, then that is taken in its place. Either way, the title is transformed and enumerated against duplication and hashed with crc32 instead of the original custom hashing function. (enumerate): Function removed: enumeration of titles is done inside hash-title. All manipulations of symhash using material from HTML now use html-decode, so that we hash the original symbol name like "str<" and not "str&lt;". When filtering the BODY, we have a new case: whenever we see a <a name="...">, we now check the new direct hash to see if there is a list of symbol hashes for the given section. If so, we generate additional <a name="..."> definitions for all the symbol hashes. At the end of the file, the "missing from image" processing is condensed, and the generation of the stdlib/doc-syms.tl file is removed. * stdlib/doc-syms.tl: Removed. * stdlib/doc-lookup.tl: Don't load doc-syms. Use crc32 plus formatting to conver a symbol to the hash that is used in the document and try the lookup with that.
* New function: hash-map.Kaz Kylheku2023-06-281-0/+2
| | | | | | | | | | | | | | | | | | | | hash-map converts a function mapping over a sequence into a hash table. * hash.[ch] (hash_map): New function. * tests/010/hash.tl: Test case. * genman.txr: The hash-map identifier introduces a hash collision. We have to deal with that somehow now. (colli): We put the conflicting entries into a new hash called colli which maps them to an increment value. (hash-title): Increment the hash code h by the amount indicated in colli, if the title is found there. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
* doc: remove extraneous symbols from doc-syms.Paul A. Patience2022-02-121-13/+16
| | | | | | | * genman.txr: Remove from the name list those names that are not TXR symbols, so that they don't appear in doc-syms. * stdlib/doc-syms.tl: Updated.
* genman, lib, tests: use defvarl where possible.Paul A. Patience2021-07-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * genman.txr (dupes, tagnum): Replace defvar with defvarl. * stdlib/doc-lookup.tl (os-symbol): Same. * tests/011/macros-3.tl (x): Same. * tests/011/mandel.txr (x-centre, y-centre, width, i-max, j-max, n) (r-max, pixel-size, x-offset, y-offset): Same. (file, colour-max): Delete (unused) variables. * tests/012/circ.tl (x): Replace defvar with defvarl. * tests/012/stack.tl (stack-limited): Same. * tests/012/struct.tl (s): Same. * tests/013/maze.tl (vi, pa, sc): Delete variables. Use function arguments instead. (usage): Fix typo. * tests/014/dgram-stream.tl (family): Rename to... (*family*): ...this. * tests/014/socket-basic.tl (socktype): Rename to... (*socktype*): ...this. (%iters%): Replace defvar with defvarl.
* doc: check the contents of doc-syms.Paul A. Patience2021-07-011-3/+22
| | | | | | | * genman.txr: Before generating stdlib/doc-syms.tl, check that the symbols going into that file (i.e., into the doc-syms variable) are actually contained in the TXR image (allowing for some exceptions). Also, reindent some lines.
* file layout: moving share/txr/stdlib to stdlib.Kaz Kylheku2021-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This affects run-time also. Txr installations where the executable is not in directory ending in ${bindir} will look for stdlib rather than share/txr/stdlib, relative to the determined installation directory. * txr.c (sysroot_init): If we detect relative to the short name, or fall back on the program directory, use stdlib rather than share/txr/stdlib as the stdlib_path. * INSTALL: Update some installation notes not to refer to share/txr/stdlib but stdlib. * Makefile (STDLIB_SRCS): Refer to stdlib, not share/txr/stdlib. (clean): In unconfigured mode, remove the old share/txr/stdlib entirely. Remove .tlo files from stdlib. (install): Install lib materials from stdlib. * txr.1: Updated documentation under Deployment Directory Structure. * share/txr/stdlib/{asm,awk,build,cadr}.tl: Renamed to stdlib/{asm,awk,build,cadr}.tl. * share/txr/stdlib/{compiler,conv,copy-file,debugger}.tl: Renamed to stdlib/{compiler,conv,copy-file,debugger}.tl. * share/txr/stdlib/{defset,doc-lookup,doc-syms,doloop}.tl: Renamed to stdlib/{defset,doc-lookup,doc-syms,doloop}.tl. * share/txr/stdlib/{each-prod,error,except,ffi}.tl: Renamed to stdlib/{each-prod,error,except,ffi}.tl. * share/txr/stdlib/{getopts,getput,hash,ifa}.tl: Renamed to stdlib/{getopts,getput,hash,ifa}.tl. * share/txr/stdlib/{keyparams,match,op,optimize}.tl: Renamed to stdlib/{keyparams,match,op,optimize}.tl. * share/txr/stdlib/{package,param,path-test,pic}.tl: Renamed to stdlib/{package,param,path-test,pic}.tl. * share/txr/stdlib/{place,pmac,quips,save-exe}.tl: Renamed to stdlib/{place,pmac,quips,save-exe}.tl. * share/txr/stdlib/{socket,stream-wrap,struct,tagbody}.tl: Renamed to stdlib/{socket,stream-wrap,struct,tagbody}.tl. * share/txr/stdlib/{termios,trace,txr-case,type}.tl: Renamed to stdlib/{termios,trace,txr-case,type}.tl. * share/txr/stdlib/{ver,vm-param,with-resources,with-stream}.tl: Renamed to stdlib/{ver,vm-param,with-resources,with-stream}.tl. * share/txr/stdlib/yield.tl: Renamed to stdlib/yield.tl. * share/txr/stdlib/{txr-case,ver}.txr: Renamed to stdlib/{txr-case,ver}.txr. * gencadr.txr: Update to stdlib/place.tl. * genman.txr: Update to stdlib/cadr.tl.
* doc: sort doc-syms, and html-decode.Kaz Kylheku2021-05-131-1/+14
| | | | | | | | | | | * genman.txr: generate doc-syms as a sorted list fed to hash-from-pairs. Now the symbols won't jump around so much whenever we update it. Also, the names must be HTML-decoded. For instance "str<" was being stored as "str&lt;" causing (doc 'str<) to fail. We use TXR @(output) to adjust the formatting as if it were maintained by hand. * share/txr/stdlib/doc-syms.tl: Regenerated.
* doc: implement typesetting of keystrokes.Kaz Kylheku2021-04-131-0/+12
| | | | | | | | | | | | | | | | | | | | This commit relies on parallel improvements in man2html, up through commit ac186529b6b5f80906c3215a67c98505db7bb156 "Implement .M2HT request for HTML passthrough." * genman.txr: Add CSS block targetting the kbd element, providing 3D styling for keyboard input. * txr.1: Define two new macros, .key and .keyn. These are defined in three different ways: in man page output, we put square brackets around keystrokes. In typeset groff output, we put a square border around them using a box macro cribbed from groff documentation. In HTML, we use .M2HT to wrap a <kbd> tag around the keystrokes. Documentatio is updated to use these macros for all keystrokes. We no longer separate keystroke sequence elements with commas.
* lib: new function for documentation lookup.Kaz Kylheku2021-04-031-0/+1
| | | | | | | | | | | | | | | | * genman.txr: dump contents of symhash into a doc-syms.tl library file, as a defvarl form. * lisplib.c (doc_instantiate, doc_set_entries): New static functions. (lisplib_init): Register autoload for doc-lookup module to symbols doc and *doc-url*. * share/txr/stdlib/doc-lookup.tl: New file. * share/txr/stdlib/doc-syms.tl: Likewise. * txr.1: Documented.
* doc: style items better, without grid style.Kaz Kylheku2021-03-311-6/+11
| | | | | | * genman.txr: Use an alternative solution for dl.items elemens which places short items to the left of their definining text, while allowing long items to overhang.
* doc: add grid styling to itemized lists.Kaz Kylheku2021-03-301-1/+14
| | | | | * genman.txr: add CSS rules targeting <dl class="items">, which are now supported in man2html.
* html doc: "collapse all" shouldn't hide whole TOC.Kaz Kylheku2018-10-291-7/+9
| | | | | | | | | | | | * genman.txr: show the toggle as "expand all" initially. Assign the sections of the TOC to the "tocsec" class, and then select the elements by class rather than by the dl element type. This avoids selecting the dl that wraps the entire TOC. (xpanded): New boolean variable. (toggleall): Base toggle on boolean variable rather than the state of the first section dl element. Toggle the xpanded variable.
* genman: use hash function written in Lisp.Kaz Kylheku2018-06-281-2/+6
| | | | | | | | | | | Planning to support seeded hashing, so the behavior of the hashing function will change. But we need a stable hash for the section URL's in the HTML doc; so let's preserve the existing function as Lisp code. * genman.txr (hash-str): New string hashing function. This behaves like the existing hash-equal behaves on 32 bits. (hash-title): Use hash-str instead of hash-equal.
* doc: put [+]/[-] open/collapse markers on right.Kaz Kylheku2017-07-081-3/+3
| | | | | | | * genman.txr (closedtxt, opentxt): Add leading space. In TOC filtering code, insert the toggle elements just before the closing </dt> rather than before opening <a>.
* doc: Fix issue of missing collapse UI on Awk section.Kaz Kylheku2016-09-111-0/+3
| | | | | * genman.txr: Recognize the form of the table-of-contents line with the extra blank line generated by the .coSS macro.
* doc html: TOC indentation issue on Chrome.Kaz Kylheku2016-09-091-1/+1
| | | | | | | | * genman.txr: Hack: put <dd> before nested <dl> element in table of contents. Without this, the nested lists are rendered flush left by Google Chrome. With this, they are indented. Chrome adds ugly whitespace around the embedded definition lists, but it's better than no identation.
* Drop between TXR and Lisp syms in HTML Doc.Kaz Kylheku2016-06-031-20/+9
| | | | | | | | | | | | | | | Dropping the document feature that hyperlinks in the TXR section resolve to TXR topics, and TXR Lisp hyperlinks go to TXR Lisp topics. All multiple uses of symbols are handled through the new mechanism of disambiguating topic navigators. * genman.txr (txrhash, txlhash, tgthash): Variables removed. (symhash): One variable, replacing those three. BODY collecting loop no longer collects LOOKUP variable, since body lines are not associated with a particular hash.
* Topic disambiguation "sub-pages" in HTML doc.Kaz Kylheku2016-06-031-3/+33
| | | | | | | | | | | | | | | | | | | | The purpose of this change is to handle situations where a symbol has multiple meanings, resulting in different topic areas of the document where we might want to navigate. For instance, there is an equal function in the TXR Lisp library, and an equal method that users can define. * genman.txr (tochash, disamb, dist-counter): New variables. (process-ambiguities): New Lisp function. When collecting symbol/jump-tag associations, collect the lists of jump tags rather than just the first jump tag. Then process the hash using process-ambiguities to handle the cases with multiple entries, which are prepared in the disamb hash. The contents of the disamb hash turn into HTML material at the end of the page. An in-line style sheet is now added; it adds vertical space between the navigation menus so they appear as if they were separate web pages.
* Replace new hash limit constants with variables.Kaz Kylheku2016-05-281-0/+2
| | | | | | | | | | | | | | | | | | | * genman.txr: Call set-hash-str-limit to set a generous limit for string hashing, which restores the old hash values in the HTML document, preserving the validity of existing URLs. * hash.c (hash_str_limit, hash_rec_limit): New static variables. (HASH_STR_LIMIT, HASH_REC_LIMIT): Preprocessor symbols removed. (hash_c_str, equal_hash): Use hash_str_limit. (gethash_c, gethash, gethash_f, gethash_n, remhash, hash_equal): Use hash_rec_limit. (set_hash_str_limit, set_hash_rec_limit): New static functions. (hash_init): Register sys:set-hash-str-limit and sys:set-hash-rec-limit intrinsics.
* HTML doc: markup in lower case.Kaz Kylheku2015-12-151-45/+45
| | | | | | | | Requires updated man2html which puts out lower case. * genman.txr: All matched and generated HTML is lower case. * txr.1 (NP*): Use lower case h4 tag in M2SS macro.
* HTML doc: fix back jumping flaw.Kaz Kylheku2015-12-141-5/+13
| | | | | | | | | | | | | Issue: wrong [+] changes to [-], leading to inconsistent state. * genman.txr: In TOC extraction and transformation, we fix the stupid broken <DT>....<DD> that man2html puts out and turn it into <DT>...</DT>. This way a DL now has a DT element as its previous sibling. (tocjump): When we see a DL now, we get the correct element which has the expand/collapse: the previous sibling which is a DT containing the anchor.
* Handle browsers with JS disabled.Kaz Kylheku2015-12-131-0/+3
| | | | | * genvim.txr: Below Contents, place a note for users who have disabled Javascript.
* Remove redundant title tag.Kaz Kylheku2015-12-131-1/+1
| | | | | * genvim.txr: For some reason, we were generating a second <title> tag, with different contents.
* HTML doc: expand TOC section on jumpback.Kaz Kylheku2015-12-121-2/+21
| | | | | | | | | | | | When a section number is clicked, if the table of contents section which contains it is collapsed, open it, and its parents. * genman.txr: (tocjump): New JS function. add onclick action to jump-back links, which calls tocjump JS function which does the expansion. The name anchor entries in the TOC are tagged with a "tocanchor: class so they can be more specifically selected by the tocjump function.
* HTML doc: jump back to TOC feature.Kaz Kylheku2015-12-121-2/+5
| | | | | | | | | Section numbers are now hyperlinks which jump back to their respective table of contents entry. * genman.txr (toc-tag): New function. Generate link anchors into section titles. Generate name anchors in TOC.
* HTML doc: add doctype header and content-type.Kaz Kylheku2015-12-071-0/+2
|
* HTML doc: table of contents improvements.Kaz Kylheku2015-12-071-2/+54
| | | | | | * genman.txr: TOC extraction code renames Index to Contents, and adds expand/collapse links. Javascript added to handle expand/collapse.
* Fix wrong HTML references caused by identical section names.Kaz Kylheku2015-08-251-2/+7
| | | | | | | | | | For instance, both entries in the TOC titled "Overview" navigate to the the same section when we click on them. * genman.txr (tagnum): New hash for counting duplicate occurrences of section title. (enumerate): New function for adding numeric suffix to titles which are the same as previously seen titles.
* * genman.txr: Simplify double plass over BODY into single pass.Kaz Kylheku2015-07-031-30/+28
|
* * genman.txr: Take advantage of \@ escape in quasilit.Kaz Kylheku2015-07-011-1/+1
| | | | | | | * genvim.txr (txr_escat): New match category containing \@. Colorized a String. (txr_quasilit): Contains txr_escat. Thus, \@ looks like any other escape inside a quasilit.
* * genman.txr: Bugfix: reproduce the correct opening bracketKaz Kylheku2015-07-011-1/+2
| | | | before a function link.
* * genman.txr: New filter to add hyperlinks within code inKaz Kylheku2015-06-261-0/+26
| | | | more places such as examples and summary lists.
* * genman.txr: indentation.Kaz Kylheku2015-06-261-10/+10
|
* * genman.txr: Point to hacked manutils.Kaz Kylheku2015-06-221-4/+2
|
* * genman.txr: Rewrite the man2html-generated inner name links with hashKaz Kylheku2015-06-201-24/+54
| | | | | | values derived from the title text, so that when sections are inserted or deleted, the URL's remain stable. The PREAMBLE is gone, and VERSION is collected when processsing the body.
* * genman.txr (month-name): Filter removed.Kaz Kylheku2015-06-201-5/+3
| | | | Page date is converted to a time value, and later formatted.
* * genman.txr: Add PayPal donation button.Kaz Kylheku2014-09-301-0/+9
| | | | | * txr.1: Avoid escapes at the end of a line; man2html doesn't handle this properly.
* * genman.txr: TXR is now bolded in the title.Kaz Kylheku2014-09-301-2/+2
| | | | * txr.1: More formatting and wording fixes.
* * txr.1: Substantially revised with rich troff markup,Kaz Kylheku2014-09-261-5/+37
| | | | | | | and restructured in some places. * genman.txr: No longer generate the whole document in monospaced font. Add hyperlinks.
* Capitalization of TXR.Kaz Kylheku2014-02-271-2/+2
|
* * genman.txr: Updated.txr-56Kaz Kylheku2012-02-051-2/+2
| | | | | | * txr.vim: Fixed mistakes in a few regex character classes, causing upper case letters not to be recognized as part of a variable name, and character hex constant.
* * genman.txr: Updated for recent man page changes.Kaz Kylheku2011-12-281-1/+1
|
* * genman.txr: Fix empty NAME section.Kaz Kylheku2011-12-141-4/+7
|
* * genman.txr: Use filter for mapping month digits to names.Kaz Kylheku2011-11-011-38/+9
| | | | Added comment about where to find the right man2html.
* Fix month name.txr-035Kaz Kylheku2010-10-051-1/+1
|
* Show "git head" version in bleeding-edge document.Kaz Kylheku2010-01-171-2/+2
|
* Fix man page date.txr-028Kaz Kylheku2010-01-161-9/+9
|