diff options
author | William Cohen <wcohen@redhat.com> | 2009-12-17 17:15:02 -0500 |
---|---|---|
committer | William Cohen <wcohen@redhat.com> | 2009-12-17 17:15:02 -0500 |
commit | cb2358b793fb1bb0c963241d986f1de2e4bf5cd3 (patch) | |
tree | 1adce5e59de6eef6d2c0a612355260c41c2fafa5 /doc | |
parent | 4180475982d87f720897baa6f988a48b4c654ee5 (diff) | |
download | systemtap-steved-cb2358b793fb1bb0c963241d986f1de2e4bf5cd3.tar.gz systemtap-steved-cb2358b793fb1bb0c963241d986f1de2e4bf5cd3.tar.xz systemtap-steved-cb2358b793fb1bb0c963241d986f1de2e4bf5cd3.zip |
Add function to generate saner html file names for langref.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/.latex2html-init | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/.latex2html-init b/doc/.latex2html-init new file mode 100644 index 00000000..541fc497 --- /dev/null +++ b/doc/.latex2html-init @@ -0,0 +1,28 @@ +$CUSTOM_TITLES = 1; +$CUSTOM_TITLES_LENGTH = 6; + +# modified version of make_long_title +# does not include the section number in the title (name) of the file +sub custom_title_hook { + local($_)= @_; + local($num_words) = $CUSTOM_TITLES_LENGTH; + #RRM: scan twice for short words, due to the $4 overlap + # Cannot use \b , else words break at accented letters + $_ =~ s/(^|\s)\s*($GENERIC_WORDS)(\'|(\s))/$4/ig; + $_ =~ s/(^|\s)\s*($GENERIC_WORDS)(\'|(\s))/$4/ig; + #remove leading numbering, unless that's all there is. + local($sec_num); + if (!(/^\d+(\.\d*)*\s*$/)&&(s/^\s*(\d+(\.\d*)*)\s*/$sec_num=$1;''/e)) + { $num_words-- }; + &remove_markers; s/<[^>]*>//g; #remove tags + #revert entities, etc. to TeX-form... + s/([\200-\377])/"\&#".ord($1).";"/eg; + $_ = &revert_to_raw_tex($_); + + # get $LONG_TITLES number of words from what remains + $_ = &get_first_words($_, $num_words) if ($num_words); + # ...and cleanup accents, spaces and punctuation + $_ = join('', (0 ? $sec_num : ''), $_); + s/\\\W\{?|\}//g; s/\s/_/g; s/\W/_/g; s/__+/_/g; s/_+$//; + $_; +} |