/* manual_Manual.cpp
*
* Copyright (C) 1992-2007,2010,2011,2014-2017,2019,2020,2022-2025 Paul Boersma
*
* This code is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* This code is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this work. If not, see .
*/
#include "ManPagesM.h"
void manual_Manual_init (ManPages me);
void manual_Manual_init (ManPages me) {
MAN_BEGIN (U"Manual", U"ppgb", 20110101)
INTRO (U"The documentation system for the Praat program.")
NORMAL (U"You will get a manual window every time you choose anything from a #Help menu or press a #Help button.")
ENTRY (U"How to find what you are looking for")
NORMAL (U"You can navigate the manual in several ways:")
LIST_ITEM (U"\\bu To go to the Intro, use the #Home button.")
LIST_ITEM (U"\\bu To go to the information behind a %link (a piece of blue text), just click on it.")
LIST_ITEM (U"\\bu To go forward and backward through a tutorial with numbered pages, use “##1 >#” and “##< 1#”.")
LIST_ITEM (U"\\bu To %revisit previous pages, use the #< and #> buttons.")
LIST_ITEM (U"\\bu To browse %alphabetically, use the horizontal scroll bar and the buttons "
"named “##< 1#” and “##1 >#”, or the ##Search for page (list)...# command in the “Go to” menu.")
LIST_ITEM (U"\\bu To find a page with a %%known title%, use the ##Search for page...# command.")
NORMAL (U"The fastest way to find what you want is usually the #Search button.")
ENTRY (U"Search")
NORMAL (U"In the text field after the Search button, you can type strings, separated by spaces. "
"When you press the Return (or Enter) key, or click the #Search button, "
"all manual pages are searched for the combination of strings that you typed. "
"The titles of the 20 best matching pages are displayed as links.")
NORMAL (U"##Example:# to know how to create a pitch contour from a sound, type")
CODE (U"sou pit")
NORMAL (U"and press Return. The best matches should appear on top. These should include "
"##Sound: To Pitch (ac)...# and ##Sound: To Pitch (cc)...#.")
NORMAL (U"The search is case-insensitive. For instance, the search string “$script” will give you all "
"the pages that contain the words %script, %Script, %description, %PostScript, or %SCRIPT, and so on.")
NORMAL (U"#Background. The search algorithm uses the following heuristics:")
LIST_ITEM (U"\\bu A match in the page title is better than one in the rest of the text.")
LIST_ITEM (U"\\bu Pages with many matches are better than those with few.")
ENTRY (U"Your own manual pages")
NORMAL (U"To create your own manual pages, create @ManPages text files.")
MAN_END
MAN_PAGES_BEGIN R"~~~(
################################################################################
"ManPages"
© Paul Boersma 2023-04-20
You can create a documentation or education system with files that you and others
can read into Praat (with the @@Read from file...@ command).
Your files will become a hypertext system very similar to the usual @Manual.
Example 1: a single document
============================
If you create a single ManPages text file, it will look like a manual with a single page.
Here is an example:
`
ManPagesTextFile
"Welkom" "miep" 19970820 0
"Hallo allemaal!"
"Belangrijk..."
"Hoogge\e""erd publiek!"
"Einde."
`
A ManPages text file should start with the following information:
1. The word “ManPagesTextFile” on the first line.
2. The title of the manual page, between double quotes.
This will be drawn at the top of the page.
The name of the ManPages text file should be derived from this title (see below).
3. The author of the manual page, between double quotes.
This will be drawn at the bottom of the page.
4. The date you created or modified the page,
in the format year \-- month (two digits) \-- day (two digits), without spaces.
5. The recording time. If this is not zero,
three sound buttons (see below) will appear at the top of the page.
6. A sequence of paragraph types and texts.
You put the types between < and >, and the texts between double quotes
(if your text contains a double quote, you should write two double quotes).
The format of a ManPages text file is rather free, as long as the first line is correct,
the four required pieces of information are there in the correct order,
and there is a correct alternation between paragraph texts and types.
If you put multiple elements on a line, there should be at least one space between them.
You may distribute texts across multiple lines, as long as you do not add any spaces:
`
"Hoogge\e""erd
publiek!"
`
This will have exactly the same effect as above.
Example 2: multiple documents
=============================
The above example with a single document is not very useful.
You will usually want to refer to other documents:
`
ManPagesTextFile
"Welcome" "Paul Boersma" 19970820 1.0
"Welcome to Paul's transcription course."
"Groups of speech sounds"
"You can listen to the following sounds
from the languages of the world,
pronounced by a %single speaker (#me):"
"@Vowels, quite problematic for Dutch students!"
"@@Dorsal fricatives@, equally problematic!"
`
With the symbol “`@`”, you create a %link to another ManPages text file.
A link will be drawn in blue on your screen.
In this example, you have created links to the files `Vowels.man`
and `Dorsal_fricatives.man` in the same folder as the current file
(all `.man` files have to be in the same folder; this makes it likely
that their names are unique).
If the link contains spaces or other non-alphanumeric symbols,
you have to use three “`@`” symbols, as shown;
with a single word, you may use a single “`@`”.
In resolving the file name, the ManPages system replaces spaces
and other special symbols with underscores,
and converts any initial lower-case character by its upper-case variant.
For instance, if your link is “`@@back vowels@`”,
the file name will be `Back_vowels.man`.
The title in the second line of `Back_vowels.man` must be equal to the link name,
though capitalization of the first letter is allowed.
Thus, the title of `Back_vowels.man` will probably be “Back vowels”.
Likewise, the starting file with the title “Welcome” should have the name `Welcome.man`
if any other files refer to it.
Paragraph types
===============
A normal paragraph will have type ``. The hypertext system will
leave a blank space between paragraphs with this type.
The first paragraph of a manual page will normally have the type ``.
Though this may look the same as ``, the search system of the @Manual
may take account of the distinction.
Headings (like the title “Paragraph types” of this subsection)
have type ``. This will be drawn in a larger character size.
For lists, you use the type ``. You will often combine this with %button symbols,
like in the following:
`
"Choose a colour:"
"\bu @Red."
"\bu @Green."
"\bu @Blue."
`
For text that should appear with a fixed character width, you use the type ``.
For a paragraph that should be connected with the following paragraph
without leaving a blank space (probably a definition), you use the type ``.
For a paragraph with a blank left margin, you use the type ``.
For a paragraph with an embedded script (a picture), you use the type `