diff options
author | Karl Berry <karl@freefriends.org> | 2015-04-18 22:52:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-04-18 22:52:45 +0000 |
commit | 16aa5a7c87f18a2483d0d61795899f886781b51c (patch) | |
tree | 1d72f00b2a4185425393598402fe055c61d1de58 /Master/texmf-dist/tex/context/base/strc-bkm.mkiv | |
parent | e68dc4d5506d46bf72823234f902bc76d1f70352 (diff) |
context, from www.pragma-ade.com/context/beta/cont-tmf.zip (18apr15)
git-svn-id: svn://tug.org/texlive/trunk@36923 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/strc-bkm.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/strc-bkm.mkiv | 68 |
1 files changed, 52 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/context/base/strc-bkm.mkiv b/Master/texmf-dist/tex/context/base/strc-bkm.mkiv index 9d2ebd796c6..9688a1f93b1 100644 --- a/Master/texmf-dist/tex/context/base/strc-bkm.mkiv +++ b/Master/texmf-dist/tex/context/base/strc-bkm.mkiv @@ -74,7 +74,11 @@ \def\strc_bookmarks_bookmark_yes[#1]#2% {\begingroup \simplifycommands - \ctxcommand{overloadbookmark("#1",\!!bs\detokenize\expandafter{\normalexpanded{#2}}\!!es)}% + \ifnum\thenamedheadlevel{#1}>\zerocount + \clf_overloadbookmark{#1}{\detokenize\expandafter{\normalexpanded{#2}}}% + \else + \strc_lists_write_to[#1][]{#2}{}% todo: a dedicated bookmark writer + \fi \endgroup} \def\strc_bookmarks_bookmark_nop[#1]#2% @@ -106,27 +110,59 @@ \ifthirdargument \setupcurrentbookmark[#3]% no every so not all possible \else\ifsecondargument - \doifassignmentelse{#2}{\let\m_bookmarks_opened\empty\setupcurrentbookmark[#2]}\donothing + \doifelseassignment{#2}{\let\m_bookmarks_opened\empty\setupcurrentbookmark[#2]}\donothing \fi\fi - \ctxcommand{registerbookmark { - names = "\m_bookmarks_names", - opened = "\m_bookmarks_opened", - force = "\bookmarkparameter\c!force", - number = "\bookmarkparameter\c!number", - }}% + \clf_registerbookmark + names {\m_bookmarks_names}% + opened {\m_bookmarks_opened}% + force {\bookmarkparameter\c!force}% + number {\bookmarkparameter\c!number}% + \relax \endgroup} \appendtoks - \ctxcommand{setupbookmarks { - separatorset = "\bookmarkparameter\c!numberseparatorset", - conversionset = "\bookmarkparameter\c!numberconversionset", - starter = \!!bs\bookmarkparameter\c!numberstarter\!!es, - stopper = \!!bs\bookmarkparameter\c!numberstopper\!!es, - segments = "\bookmarkparameter\c!numbersegments", - showblocktitle = "\bookmarkparameter\c!sectionblock", - }}% + \clf_setupbookmarks + separatorset {\bookmarkparameter\c!numberseparatorset}% + conversionset {\bookmarkparameter\c!numberconversionset}% + starter {\bookmarkparameter\c!numberstarter}% + stopper {\bookmarkparameter\c!numberstopper}% + segments {\bookmarkparameter\c!numbersegments}% + showblocktitle {\bookmarkparameter\c!sectionblock}% + \relax \to \everysetupbookmark +%D There is a plugin mechanism but this is for experts only. The intermediate +%D data structures are stable. +%D +%D \starttyping +%D \startluacode +%D structures.bookmarks.installhandler("check before","before",function(levels) +%D logs.report("extra bookmarks","before (normal bookmarks)") +%D inspect(levels) +%D logs.report("extra bookmarks","before (extra bookmarks)") +%D inspect(structures.bookmarks.extras.get()) +%D return levels +%D end) +%D structures.bookmarks.installhandler("check after", "after", function(levels) +%D logs.report("extra bookmarks","after (merged bookmarks)") +%D inspect(levels) +%D return levels +%D end) +%D \stopluacode +%D \starttyping +%D +%D This mechanism was added when bookmark inclusion became (optional) part of graphic +%D inclusion (which is needed by Taco). +%D +%D \starttyping +%D \getfiguredimensions[somefile.pdf] +%D \dorecurse {\noffigurepages} { +%D \startTEXpage +%D \externalfigure[somefile.pdf][interaction=bookmark,page=\recurselevel] +%D \stopTEXpage +%D } +%D \starttyping + \protect \endinput % \starttext |