|
@@ -731,7 +731,7 @@ caption keyword."
|
|
|
(org-export-data caption info))
|
|
|
(org-ascii--current-text-width element info) info)))))
|
|
|
|
|
|
-(defun org-ascii--build-toc (info &optional n keyword local)
|
|
|
+(defun org-ascii--build-toc (info &optional n keyword scope)
|
|
|
"Return a table of contents.
|
|
|
|
|
|
INFO is a plist used as a communication channel.
|
|
@@ -742,10 +742,10 @@ depth of the table.
|
|
|
Optional argument KEYWORD specifies the TOC keyword, if any, from
|
|
|
which the table of contents generation has been initiated.
|
|
|
|
|
|
-When optional argument LOCAL is non-nil, build a table of
|
|
|
-contents according to the current headline."
|
|
|
+When optional argument SCOPE is non-nil, build a table of
|
|
|
+contents according to the specified scope."
|
|
|
(concat
|
|
|
- (unless local
|
|
|
+ (unless scope
|
|
|
(let ((title (org-ascii--translate "Table of Contents" info)))
|
|
|
(concat title "\n"
|
|
|
(make-string
|
|
@@ -767,7 +767,7 @@ contents according to the current headline."
|
|
|
(or (not (plist-get info :with-tags))
|
|
|
(eq (plist-get info :with-tags) 'not-in-toc))
|
|
|
'toc))))
|
|
|
- (org-export-collect-headlines info n (and local keyword)) "\n"))))
|
|
|
+ (org-export-collect-headlines info n scope) "\n"))))
|
|
|
|
|
|
(defun org-ascii--list-listings (keyword info)
|
|
|
"Return a list of listings.
|
|
@@ -1516,8 +1516,13 @@ information."
|
|
|
((string-match-p "\\<headlines\\>" value)
|
|
|
(let ((depth (and (string-match "\\<[0-9]+\\>" value)
|
|
|
(string-to-number (match-string 0 value))))
|
|
|
- (localp (string-match-p "\\<local\\>" value)))
|
|
|
- (org-ascii--build-toc info depth keyword localp)))
|
|
|
+ (scope
|
|
|
+ (cond
|
|
|
+ ((string-match ":target +\\(\".+?\"\\|\\S-+\\)" value) ;link
|
|
|
+ (org-export-resolve-link
|
|
|
+ (org-strip-quotes (match-string 1 value)) info))
|
|
|
+ ((string-match-p "\\<local\\>" value) keyword)))) ;local
|
|
|
+ (org-ascii--build-toc info depth keyword scope)))
|
|
|
((string-match-p "\\<tables\\>" value)
|
|
|
(org-ascii--list-tables keyword info))
|
|
|
((string-match-p "\\<listings\\>" value)
|