Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2017-06-20 09:25:05 +02:00
commit 5e439d41f8
2 changed files with 33 additions and 10 deletions

View File

@ -13600,8 +13600,14 @@ Copyright information is printed on the back of the title page.
Copyright \copy 2016 Free Software Foundation, Inc. Copyright \copy 2016 Free Software Foundation, Inc.
@end example @end example
@node Texinfo @samp{Top} node @node Info directory file
@subsection Texinfo @samp{Top} node @subsection Info directory file
@cindex @samp{dir} file, in Texinfo export
@cindex Texinfo export, @samp{dir} file
@cindex Info directory file, in Texinfo export
@cindex Texinfo export, Info directory file
@cindex @code{install-info} parameters, in Texinfo export
@cindex Texinfo export, @code{install-info} parameters
@cindex #+TEXINFO_DIR_CATEGORY @cindex #+TEXINFO_DIR_CATEGORY
@cindex #+TEXINFO_DIR_TITLE @cindex #+TEXINFO_DIR_TITLE
@ -13612,7 +13618,7 @@ This Info file's metadata has variables for category, title, and description:
@code{#+TEXINFO_DIR_DESC} that establish where in the Info hierarchy the file @code{#+TEXINFO_DIR_DESC} that establish where in the Info hierarchy the file
fits. fits.
Here's an example that writes to the @samp{Top} node: Here is an example that writes to the Info directory file:
@example @example
#+TEXINFO_DIR_CATEGORY: Emacs #+TEXINFO_DIR_CATEGORY: Emacs
@ -13661,6 +13667,13 @@ entry:
:END: :END:
@end example @end example
@cindex The Top node, in Texinfo export
@cindex Texinfo export, Top node
The text before the first headline belongs to the @samp{Top} node, i.e., the
node in which a reader enters an Info manual. As such, it is expected not to
appear in printed output generated from the @file{.texi} file. @inforef{The
Top Node,,texinfo}, for more information.
@node Indices @node Indices
@subsection Indices @subsection Indices
@ -13849,6 +13862,9 @@ Texts,,texinfo} for an equivalent example using Texinfo code.
#+TEXINFO_PRINTED_TITLE: GNU Sample #+TEXINFO_PRINTED_TITLE: GNU Sample
This manual is for GNU Sample (version @{@{@{version@}@}@},
@{@{@{updated@}@}@}).
* Copying * Copying
:PROPERTIES: :PROPERTIES:
:COPYING: t :COPYING: t

View File

@ -628,7 +628,8 @@ holding export options."
"@titlepage\n" "@titlepage\n"
(when (plist-get info :with-title) (when (plist-get info :with-title)
(concat (concat
(format "@title %s\n" (or (plist-get info :texinfo-printed-title) title "")) (format "@title %s\n"
(or (plist-get info :texinfo-printed-title) title ""))
(let ((subtitle (plist-get info :subtitle))) (let ((subtitle (plist-get info :subtitle)))
(when subtitle (when subtitle
(format "@subtitle %s\n" (format "@subtitle %s\n"
@ -654,10 +655,17 @@ holding export options."
"@end titlepage\n\n" "@end titlepage\n\n"
;; Table of contents. ;; Table of contents.
(and (plist-get info :with-toc) "@contents\n\n") (and (plist-get info :with-toc) "@contents\n\n")
;; Configure Top Node when not for Tex ;; Configure Top Node when not for TeX. Also include contents
;; from the first section of the document.
"@ifnottex\n" "@ifnottex\n"
"@node Top\n" "@node Top\n"
(format "@top %s\n" title) (format "@top %s\n" title)
(let* ((first-section
(org-element-map (plist-get info :parse-tree) 'section
#'identity info t '(headline)))
(top-contents
(org-export-data (org-element-contents first-section) info)))
(and (org-string-nw-p top-contents) (concat "\n" top-contents)))
(and copying "@insertcopying\n") (and copying "@insertcopying\n")
"@end ifnottex\n\n" "@end ifnottex\n\n"
;; Menu. ;; Menu.
@ -1368,11 +1376,10 @@ contextual information."
"Transcode a SECTION element from Org to Texinfo. "Transcode a SECTION element from Org to Texinfo.
CONTENTS holds the contents of the section. INFO is a plist CONTENTS holds the contents of the section. INFO is a plist
holding contextual information." holding contextual information."
(org-trim
(concat contents
"\n"
(let ((parent (org-export-get-parent-headline section))) (let ((parent (org-export-get-parent-headline section)))
(and parent (org-texinfo-make-menu parent info)))))) (when parent ;ignore very first section
(org-trim
(concat contents "\n" (org-texinfo-make-menu parent info))))))
;;;; Special Block ;;;; Special Block