Debian Codegraph @

translations/manual/snippets.pot

raw
1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) Kovid Goyal
3 # This file is distributed under the same license as the calibre package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: calibre 9.15.0\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2026-09-18 07:37+0530\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <[email protected]>\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #: ../../../home/kovid/work/calibre/manual/snippets.rst:2
20 msgid "Snippets"
21 msgstr ""
22
23 #: ../../../home/kovid/work/calibre/manual/snippets.rst:6
24 msgid "The calibre E-book editor supports *snippets*. A snippet is a piece of text that is either re-used often or contains a lot of redundant text. The editor allows you to insert a snippet with only a few key strokes. For example, suppose you often find yourself inserting link tags when editing HTML files, then you can simply type ``<a`` in the editor and press |ct|. The editor will expand it to::"
25 msgstr ""
26
27 #: ../../../home/kovid/work/calibre/manual/snippets.rst:15
28 msgid "Not only that, the word ``filename`` will be selected, with the cursor placed over it, so that you can easily type in the real filename, using the editor's nifty :ref:`editor_auto_complete` feature. And once you are done typing the filename, press |ct| again and the cursor will jump to the position in between the ``<a>`` tags so you can easily type in the text for the link."
29 msgstr ""
30
31 #: ../../../home/kovid/work/calibre/manual/snippets.rst:21
32 msgid "The snippets system in the editor is very sophisticated, there are a few built-in snippets and you can create your own to suit your editing style."
33 msgstr ""
34
35 #: ../../../home/kovid/work/calibre/manual/snippets.rst:24
36 msgid "The following discussion of the built-in snippets should help illustrate the power of the snippets system."
37 msgstr ""
38
39 #: ../../../home/kovid/work/calibre/manual/snippets.rst:28
40 msgid "You can also use snippets in the text entry fields in the :guilabel:`Search & replace` panel, however, placeholders (using |ct| to jump around) will not work."
41 msgstr ""
42
43 #: ../../../home/kovid/work/calibre/manual/snippets.rst:33
44 msgid "The built-in snippets"
45 msgstr ""
46
47 #: ../../../home/kovid/work/calibre/manual/snippets.rst:35
48 msgid "The built-in snippets are described below. Note that you can override them by creating your own snippets with the same trigger text."
49 msgstr ""
50
51 #: ../../../home/kovid/work/calibre/manual/snippets.rst:39
52 msgid "Inserting filler text [Lorem]"
53 msgstr ""
54
55 #: ../../../home/kovid/work/calibre/manual/snippets.rst:41
56 msgid "The first built-in snippet, and the simplest is used to insert filler text into a document. The filler text is taken from `De finibus bonorum et malorum <https://en.wikipedia.org/wiki/De_finibus_bonorum_et_malorum>`_ a philosophical work by Cicero (translated to English). To use it simply type ``Lorem`` in an HTML file and press |ct|. It will be replaced by a couple of paragraphs of filler."
57 msgstr ""
58
59 #: ../../../home/kovid/work/calibre/manual/snippets.rst:48
60 msgid "The definition of this snippet is very simple, the trigger text is defined as ``Lorem`` and the template is defined simply as the literal text to be inserted. You can easily customize it to use your favorite form of filler text."
61 msgstr ""
62
63 #: ../../../home/kovid/work/calibre/manual/snippets.rst:53
64 msgid "Inserting a self-closing HTML tag [<>]"
65 msgstr ""
66
67 #: ../../../home/kovid/work/calibre/manual/snippets.rst:55
68 msgid "Now let's look at a simple example of the powerful concept of *placeholders*. Say you want to insert the self-closing tag ``<hr/>``. Just type ``<>``, and press |ct|, the editor will expand the snippet to::"
69 msgstr ""
70
71 #: ../../../home/kovid/work/calibre/manual/snippets.rst:61
72 msgid "Here, the ``|`` symbol represents the current cursor position. You can then type ``hr`` and press |ct| to move the cursor to after the end of the tag. This snippet is defined as::"
73 msgstr ""
74
75 #: ../../../home/kovid/work/calibre/manual/snippets.rst:68
76 msgid "Placeholders are simply the dollar ($) sign followed by a number. When the snippet is expanded by pressing |ct| the cursor is positioned at the first placeholder (the placeholder with the lowest number). When you press |ct| again the cursor jumps to the next placeholder (the placeholder with the next higher number)."
77 msgstr ""
78
79 #: ../../../home/kovid/work/calibre/manual/snippets.rst:75
80 msgid "Inserting an HTML link tag [<a]"
81 msgstr ""
82
83 #: ../../../home/kovid/work/calibre/manual/snippets.rst:77
84 msgid "HTML link tags all share a common structure. They have an ``href`` attribute and some text between the opening and closing tags. A snippet to make typing them more efficient will introduce us to some more features of placeholders. To use this snippet, simply type ``<a`` and press |ct|. The editor will expand this to::"
85 msgstr ""
86
87 #: ../../../home/kovid/work/calibre/manual/snippets.rst:85
88 msgid "Not only that, the word ``filename`` will be selected, with the cursor placed over it, so that you can easily type in the real filename, using the editor's nifty :ref:`editor_auto_complete` feature. And once you are done typing the filename, press |ct| again and the cursor will jump to the position in between the ``<a>`` tags so you can easily type in the text for the link. After you are done typing the text, press |ct| again to jump to the point after the closing tag. This snippet is defined as::"
89 msgstr ""
90
91 #: ../../../home/kovid/work/calibre/manual/snippets.rst:96
92 msgid "There are a couple of new features here. First the ``$1`` placeholder has become more complex. It now includes some *default text* (the word ``filename``). If a placeholder contains default text, the default text is substituted for the placeholder when the snippet is expanded. Also when you jump to a placeholder with default text using |ct|, the default text is selected. In this way, you can use default text to act as a reminder to you to fill in important parts of the template. You can specify default text for a placeholder by using the syntax: ``${<number>:default text}``."
93 msgstr ""
94
95 #: ../../../home/kovid/work/calibre/manual/snippets.rst:105
96 msgid "The other new feature is that the second placeholder has an asterisk after it (``${2*}``). This means that any text that was selected before expanding the template is substituted for the placeholder. To see this in action, select some text in the editor, press |ct|, type ``<a`` and press |ct| again, the template will be expanded to::"
97 msgstr ""
98
99 #: ../../../home/kovid/work/calibre/manual/snippets.rst:114
100 msgid "Inserting an HTML image tag [<i]"
101 msgstr ""
102
103 #: ../../../home/kovid/work/calibre/manual/snippets.rst:116
104 msgid "This is very similar to inserting an HTML link, as we saw above. It allows you to quickly input an ``<img src=\"filename\" alt=\"description\" />`` tag and jump between the ``src`` and ``alt`` attributes::"
105 msgstr ""
106
107 #: ../../../home/kovid/work/calibre/manual/snippets.rst:124
108 msgid "Insert an arbitrary HTML tag [<<]"
109 msgstr ""
110
111 #: ../../../home/kovid/work/calibre/manual/snippets.rst:126
112 msgid "This allows you to insert an arbitrary full HTML tag (or wrap previously selected text in the tag). To use it, simply type ``<<`` and press |ct|. If you want to wrap selected text, first select the text, press |ct| then type ``<<`` and press |ct| again. The editor will expand it to::"
113 msgstr ""
114
115 #: ../../../home/kovid/work/calibre/manual/snippets.rst:134
116 msgid "Type the tag name, for example: ``span`` and press |ct|, that will result in::"
117 msgstr ""
118
119 #: ../../../home/kovid/work/calibre/manual/snippets.rst:138
120 msgid "You will note that the closing tag has been automatically filled with ``span``. This is achieved with yet another feature of placeholders, *mirroring*. Mirroring simply means that if you specify the same placeholder more than once in a template, the second and all later positions will be automatically filled in with whatever you type in the first position, when you press |ct|. The definition for this snippet is::"
121 msgstr ""
122
123 #: ../../../home/kovid/work/calibre/manual/snippets.rst:148
124 msgid "As you can see, the first placeholder ($1) has been specified twice, the second time in the closing tag, which will simply copy whatever you type in the opening tag."
125 msgstr ""
126
127 #: ../../../home/kovid/work/calibre/manual/snippets.rst:153
128 msgid "Inserting an arbitrary HTML tag with a class attribute [<c]"
129 msgstr ""
130
131 #: ../../../home/kovid/work/calibre/manual/snippets.rst:155
132 msgid "This is very similar to the insert arbitrary tag example above, except that it assumes that you want to specify a class for the tag::"
133 msgstr ""
134
135 #: ../../../home/kovid/work/calibre/manual/snippets.rst:161
136 msgid "This will allow you to first type the tag name, press |ct|, type the class name, press |ct| type the contents of the tag and press |ct| one last time to jump out of the tag. The closing tag will be auto-filled."
137 msgstr ""
138
139 #: ../../../home/kovid/work/calibre/manual/snippets.rst:167
140 msgid "Creating your own snippets"
141 msgstr ""
142
143 #: ../../../home/kovid/work/calibre/manual/snippets.rst:169
144 msgid "Snippets really shine because you can create your own to suit your editing style. To create your own snippets go to :guilabel:`Edit->Preferences->Editor settings->Manage snippets` in the editor. This will pop-up an easy to use dialog to help you create your own snippets. Simply click the :guilabel:`Add snippet` button and you will see a dialog that looks like:"
145 msgstr ""
146
147 #: ../../../home/kovid/work/calibre/manual/snippets.rst:175
148 msgid "The create your own snippets tool"
149 msgstr ""
150
151 #: ../../../home/kovid/work/calibre/manual/snippets.rst:180
152 msgid "First give your snippet a name, something descriptive, to help identify the snippet in the future. Then specify the *trigger*. A trigger is simply the text that you have to type in the editor before pressing |ct| in order to expand the snippet."
153 msgstr ""
154
155 #: ../../../home/kovid/work/calibre/manual/snippets.rst:185
156 msgid "Then specify the snippet template. You should start with one of the examples above and modify it to suit your needs. Finally, specify which file types you want the snippet to be active for. This way you can have multiple snippets with the same trigger text that work differently in different file types."
157 msgstr ""
158
159 #: ../../../home/kovid/work/calibre/manual/snippets.rst:190
160 msgid "The next step is to test your newly created snippet. Use the :guilabel:`Test` box at the bottom. Type in the trigger text and press |ct| to expand the snippet and jump between placeholders."
161 msgstr ""