├── .github
└── FUNDING.yml
├── LICENSE
├── README.md
├── Specification.pod6
└── assets
├── LICENSE
├── bigtitle-social-logo.png
├── podlite_logo.pdf
├── podlite_logo.png
└── podlite_logo_256x256.png
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 | open_collective: podlite
3 | github: zag
4 | patreon: # Replace with a single Patreon username
5 |
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12 | polar: # Replace with a single Polar username
13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14 | thanks_dev: # Replace with a single thanks.dev username
15 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The Artistic License 2.0
2 |
3 | Copyright (c) 2000-2015, The Perl Foundation.
4 |
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | This license establishes the terms under which a given free software
11 | Package may be copied, modified, distributed, and/or redistributed.
12 | The intent is that the Copyright Holder maintains some artistic
13 | control over the development of that Package while still keeping the
14 | Package available as open source and free software.
15 |
16 | You are always permitted to make arrangements wholly outside of this
17 | license directly with the Copyright Holder of a given Package. If the
18 | terms of this license do not permit the full use that you propose to
19 | make of the Package, you should contact the Copyright Holder and seek
20 | a different licensing arrangement.
21 |
22 | Definitions
23 |
24 | "Copyright Holder" means the individual(s) or organization(s)
25 | named in the copyright notice for the entire Package.
26 |
27 | "Contributor" means any party that has contributed code or other
28 | material to the Package, in accordance with the Copyright Holder's
29 | procedures.
30 |
31 | "You" and "your" means any person who would like to copy,
32 | distribute, or modify the Package.
33 |
34 | "Package" means the collection of files distributed by the
35 | Copyright Holder, and derivatives of that collection and/or of
36 | those files. A given Package may consist of either the Standard
37 | Version, or a Modified Version.
38 |
39 | "Distribute" means providing a copy of the Package or making it
40 | accessible to anyone else, or in the case of a company or
41 | organization, to others outside of your company or organization.
42 |
43 | "Distributor Fee" means any fee that you charge for Distributing
44 | this Package or providing support for this Package to another
45 | party. It does not mean licensing fees.
46 |
47 | "Standard Version" refers to the Package if it has not been
48 | modified, or has been modified only in ways explicitly requested
49 | by the Copyright Holder.
50 |
51 | "Modified Version" means the Package, if it has been changed, and
52 | such changes were not explicitly requested by the Copyright
53 | Holder.
54 |
55 | "Original License" means this Artistic License as Distributed with
56 | the Standard Version of the Package, in its current version or as
57 | it may be modified by The Perl Foundation in the future.
58 |
59 | "Source" form means the source code, documentation source, and
60 | configuration files for the Package.
61 |
62 | "Compiled" form means the compiled bytecode, object code, binary,
63 | or any other form resulting from mechanical transformation or
64 | translation of the Source form.
65 |
66 |
67 | Permission for Use and Modification Without Distribution
68 |
69 | (1) You are permitted to use the Standard Version and create and use
70 | Modified Versions for any purpose without restriction, provided that
71 | you do not Distribute the Modified Version.
72 |
73 |
74 | Permissions for Redistribution of the Standard Version
75 |
76 | (2) You may Distribute verbatim copies of the Source form of the
77 | Standard Version of this Package in any medium without restriction,
78 | either gratis or for a Distributor Fee, provided that you duplicate
79 | all of the original copyright notices and associated disclaimers. At
80 | your discretion, such verbatim copies may or may not include a
81 | Compiled form of the Package.
82 |
83 | (3) You may apply any bug fixes, portability changes, and other
84 | modifications made available from the Copyright Holder. The resulting
85 | Package will still be considered the Standard Version, and as such
86 | will be subject to the Original License.
87 |
88 |
89 | Distribution of Modified Versions of the Package as Source
90 |
91 | (4) You may Distribute your Modified Version as Source (either gratis
92 | or for a Distributor Fee, and with or without a Compiled form of the
93 | Modified Version) provided that you clearly document how it differs
94 | from the Standard Version, including, but not limited to, documenting
95 | any non-standard features, executables, or modules, and provided that
96 | you do at least ONE of the following:
97 |
98 | (a) make the Modified Version available to the Copyright Holder
99 | of the Standard Version, under the Original License, so that the
100 | Copyright Holder may include your modifications in the Standard
101 | Version.
102 |
103 | (b) ensure that installation of your Modified Version does not
104 | prevent the user installing or running the Standard Version. In
105 | addition, the Modified Version must bear a name that is different
106 | from the name of the Standard Version.
107 |
108 | (c) allow anyone who receives a copy of the Modified Version to
109 | make the Source form of the Modified Version available to others
110 | under
111 |
112 | (i) the Original License or
113 |
114 | (ii) a license that permits the licensee to freely copy,
115 | modify and redistribute the Modified Version using the same
116 | licensing terms that apply to the copy that the licensee
117 | received, and requires that the Source form of the Modified
118 | Version, and of any works derived from it, be made freely
119 | available in that license fees are prohibited but Distributor
120 | Fees are allowed.
121 |
122 |
123 | Distribution of Compiled Forms of the Standard Version
124 | or Modified Versions without the Source
125 |
126 | (5) You may Distribute Compiled forms of the Standard Version without
127 | the Source, provided that you include complete instructions on how to
128 | get the Source of the Standard Version. Such instructions must be
129 | valid at the time of your distribution. If these instructions, at any
130 | time while you are carrying out such distribution, become invalid, you
131 | must provide new instructions on demand or cease further distribution.
132 | If you provide valid instructions or cease distribution within thirty
133 | days after you become aware that the instructions are invalid, then
134 | you do not forfeit any of your rights under this license.
135 |
136 | (6) You may Distribute a Modified Version in Compiled form without
137 | the Source, provided that you comply with Section 4 with respect to
138 | the Source of the Modified Version.
139 |
140 |
141 | Aggregating or Linking the Package
142 |
143 | (7) You may aggregate the Package (either the Standard Version or
144 | Modified Version) with other packages and Distribute the resulting
145 | aggregation provided that you do not charge a licensing fee for the
146 | Package. Distributor Fees are permitted, and licensing fees for other
147 | components in the aggregation are permitted. The terms of this license
148 | apply to the use and Distribution of the Standard or Modified Versions
149 | as included in the aggregation.
150 |
151 | (8) You are permitted to link Modified and Standard Versions with
152 | other works, to embed the Package in a larger work of your own, or to
153 | build stand-alone binary or bytecode versions of applications that
154 | include the Package, and Distribute the result without restriction,
155 | provided the result does not expose a direct interface to the Package.
156 |
157 |
158 | Items That are Not Considered Part of a Modified Version
159 |
160 | (9) Works (including, but not limited to, modules and scripts) that
161 | merely extend or make use of the Package, do not, by themselves, cause
162 | the Package to be a Modified Version. In addition, such works are not
163 | considered parts of the Package itself, and are not subject to the
164 | terms of this license.
165 |
166 |
167 | General Provisions
168 |
169 | (10) Any use, modification, and distribution of the Standard or
170 | Modified Versions is governed by this Artistic License. By using,
171 | modifying or distributing the Package, you accept this license. Do not
172 | use, modify, or distribute the Package, if you do not accept this
173 | license.
174 |
175 | (11) If your Modified Version has been derived from a Modified
176 | Version made by someone other than you, you are nevertheless required
177 | to ensure that your Modified Version complies with the requirements of
178 | this license.
179 |
180 | (12) This license does not grant you the right to use any trademark,
181 | service mark, tradename, or logo of the Copyright Holder.
182 |
183 | (13) This license includes the non-exclusive, worldwide,
184 | free-of-charge patent license to make, have made, use, offer to sell,
185 | sell, import and otherwise transfer the Package with respect to any
186 | patent claims licensable by the Copyright Holder that are necessarily
187 | infringed by the Package. If you institute patent litigation
188 | (including a cross-claim or counterclaim) against any party alleging
189 | that the Package constitutes direct or contributory patent
190 | infringement, then this Artistic License to you shall terminate on the
191 | date that such litigation is filed.
192 |
193 | (14) Disclaimer of Warranty:
194 | THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
195 | IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
196 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
197 | NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
198 | LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
199 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
200 | DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
201 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 | **Podlite is a lightweight block-based markup language designed for flexibility and ease of use.**
9 |
10 | Unbound by any specific domain, programming language, or concept, Podlite stands out as a universal markup language. It's versatile enough to be successfully implemented across various development fields, from web development to scientific research.
11 |
12 | Podlite is not limited to any specific application domain, programming language, or concept.
13 |
14 | In addition, the support for Markdown markup as a standard block adds convenience and allows for the use of familiar syntax for text formatting.
15 |
16 | One of the key features of Podlite is its extensibility. This allows for defining unique and domain-specific blocks and expanding the language's functionality according to the requirements of your project.
17 |
18 | Its flexibility makes it an ideal tool for creating documentation, blogs, educational materials, and much more.
19 |
20 | Podlite aims to provide users with a means for creativity and expressing ideas in a structured form, while ensuring ease of use and high flexibility in content creation.
21 |
22 | Supported file extensions:
23 |
24 | | Processor mode | Extensions
25 | | ------------------| -----------
26 | | `Pod` mode | `.podlite`, `.pod6` (supported through history)
27 | | | `*.*` - processes files under supported MIME types and/or extracts Podlite markup
28 | | `Markdown` mode | `.md`, `.markdown`
29 |
30 | [The specification](https://github.com/podlite/podlite-specs/blob/main/Specification.pod6) for the Podlite markup language is written using Podlite markup itself.
31 |
32 |
> - placement links,
62 | =item Declarator block,
63 | =item C<:formatted> attribute,
64 | =item C<:like> attribute.
65 | =end CHANGES
66 |
67 | =head1 Podlite
68 |
69 | D is an easy-to-use markup language with a simple, consistent
70 | underlying document object model. Podlite can be used for writing language
71 | documentation, for documenting programs and modules, as well as for
72 | other types of document composition.
73 |
74 | The Podlite is a purely descriptive mark-up notation, with no presentational
75 | components.
76 |
77 |
78 | =head2 General syntactic structure
79 |
80 | Podlite documents are specified using D, which are
81 | used to declare configuration information and to delimit blocks of
82 | textual content.
83 |
84 | Every directive starts either with an equals sign (C<=>) followed
85 | immediately by an identifier.
86 |
87 | An D composed of an alphabetical character followed by
88 | any combination of alphanumeric characters. Alphabetic and numeric
89 | definitions encompass relevant Unicode characters. The underscore
90 | is consistently treated as alphabetic. Additionally, an identifier
91 | can include isolated apostrophes or hyphens, given that the subsequent
92 | character is alphabetic.
93 |
94 | Directives that start with C<=> can be indented like the code they
95 | interleave, but their initial C<=> must still be the first non-whitespace
96 | character on their line.
97 |
98 | An indented Podlite block is considered to have a I,
99 | determined by the indentation of its opening delimiter.
100 |
101 | In other words, if a directive is indented from the left margin, the
102 | column at which the first character of its opening delimiter appears is
103 | thereafter considered the first column of the entire block's contents.
104 |
105 | The virtual margin treats leading tabs as aligning to tabstops spaced
106 | every C<($?TABSTOP // 8)> characters.
107 |
108 | =head2 Podlite blocks
109 |
110 | The content of a document is specified within one or more D.
111 | Every Podlite block may be declared in any of three forms:
112 | I>, I>, or I>.
114 | All of these forms are equivalent.
115 |
116 | Anything in a document that is neither a Podlite directive nor contained
117 | within a Podlite block is treated as "ambient" material. Typically this
118 | would be the source code of the program that the Podlite is documenting.
119 | Podlite parsers still parse this text into the internal representation of the
120 | file, representing it as a "ambient" block. Renderers
121 | will I ignore such blocks.
122 | This is the D of the parser.
123 |
124 | All directives have a defined terminator and the Podlite parser always reverts to
125 | D<"ambient"|Ambient mode; parser modes> at the end of each Podlite directive or
126 | block.
127 |
128 | The C<=pod> block puts the parser in D<"pod" mode|Pod mode; parser modes>,
129 | treating all text between blocks as implicit paragraph Podlite, even if
130 | it's not inside an explicit block.
131 |
132 | To keep the parser in "pod" mode, enclose the desired Podlite region
133 | in a C<=pod> block:
134 |
135 | =begin code :allow
136 | B<=begin pod>
137 |
138 | =head1 A heading
139 |
140 | This is Podlite too. Specifically, this is a simple C block
141 |
142 | $this = pod('also'); # Specifically, a code block
143 |
144 | B<=end pod>
145 | =end code
146 |
147 | The contents of files with the extensions C<.podlite> and C<.pod6> are
148 | implicitly wrapped in a C<=pod> directive.
149 |
150 | For C<.md> and C<.markdown> files, the parser operates in D<"Markdown"
151 | mode|Markdown mode; parser modes> for the entire file, treating all
152 | text as markdown even if it is not inside an C<=markdown> block.
153 |
154 | Any other file extension puts the parser in default mode. The L
155 | block|#Include block > has a mechanism to override this behavior by using
156 | the C<:mime-type> attribute for the included files.
157 |
158 |
159 | =head3 Delimited blocks
160 |
161 | Delimited blocks are bounded by C<=begin> and C<=end> markers, both of
162 | which are followed by a valid Podlite identifier, which is the
163 | D of the block. Typenames that are entirely lowercase (for
164 | example: C<=begin head1>) or entirely uppercase (for example: C<=begin
165 | SYNOPSIS>) are reserved.
166 |
167 | After the typename, the rest of the C<=begin> marker line is treated as
168 | configuration information for the block. This information is used in
169 | different ways by different types of blocks, but is always specified using
170 | any of:
171 |
172 | =for table :nested :caption("Block configuration syntax") :id
173 | Value is... Specify with... Or with...
174 | =============== =================== ==============
175 | Boolean (true) C«:key» C«:key(1)»
176 | Boolean (false) C«:!key» C«:key(0)»
177 | String C«:key» C«:key('str')»
178 | List C«:key<1 2 3>» C«:key[1,2,3]»
179 | Hash C«:key{a=>1, b=>2}»
180 |
181 | All option keys and values must, of course, be constants since Podlite is a
182 | specification language, not a programming language. Specifically, option
183 | values cannot be closures.
184 |
185 | The configuration section may be extended over subsequent lines by
186 | starting those lines with an C<=> in the first (virtual) column followed
187 | by a whitespace character.
188 |
189 | The lines following the opening delimiter and configuration are the
190 | data or contents of the block, which continue until the block's matching
191 | C<=end> marker line. For most block types, these contents may be
192 | indented if you wish, without them being treated as L. Indented text is only treated as code within
194 | C<=pod>, L|#Nesting blocks>, L|#Lists>, C<=code>,
195 | and L blocks.
196 |
197 | The general syntax is:
198 |
199 | =begin code :allow< R >
200 | =begin R R
201 | = R
202 | R
203 | =end R
204 | =end code
205 |
206 | For example:
207 |
208 | =begin code
209 | =begin table :caption
210 | Constants 1
211 |
212 | Variables 10
213 |
214 | Subroutines 33
215 |
216 | Everything else 57
217 | =end table
218 |
219 | =begin Name :required
220 | = :width(50)
221 | The applicant's full name
222 | =end Name
223 |
224 | =begin Contact :optional
225 | The applicant's contact details
226 | =end Contact
227 | =end code
228 |
229 | Note that no blank lines are required around the directives; blank
230 | lines within the contents are always treated as part of the contents.
231 | This is a universal feature of Podlite.
232 |
233 | Note also that in the following specifications, a "blank line" is a line
234 | that is either empty or that contains only whitespace characters. That
235 | is, a blank line matches the following pattern: C^^ \h* $$/>. Podlite uses
236 | blank lines as delimiters, rather than empty lines, to minimize unpleasant
237 | surprises when stray spaces or tabs mysteriously turn up in hitherto
238 | empty lines.
239 |
240 |
241 | =head3 Paragraph blocks
242 |
243 | Paragraph blocks are introduced by a C<=for> marker and terminated by
244 | the next Podlite directive or the first blank line (which is I
245 | considered to be part of the block's contents). The C<=for> marker is
246 | followed by the name of the block and optional configuration
247 | information. The general syntax is:
248 |
249 | =begin code :allow< R >
250 | =for R R
251 | = R
252 | R
253 | =end code
254 |
255 | For example:
256 |
257 | =begin code
258 | =for table :caption
259 | Constants 1
260 | Variables 10
261 | Subroutines 33
262 | Everything else 57
263 |
264 | =for Name :required
265 | = :width(50)
266 | The applicant's full name
267 |
268 | =for Contact :optional
269 | The applicant's contact details
270 |
271 | =end code
272 |
273 |
274 | =head3 Abbreviated blocks
275 |
276 | Abbreviated blocks are introduced by an C<'='> sign in the
277 | first column, which is followed immediately by the typename of the
278 | block. The rest of the line is treated as block data, rather than as
279 | configuration. The content terminates at the next Podlite directive or the
280 | first blank line (which is not part of the block data). The general
281 | syntax is:
282 |
283 | =begin code :allow< R >
284 | =R R
285 | R
286 |
287 | =end code
288 |
289 | For example:
290 |
291 | =begin code
292 | =table
293 | Constants 1
294 | Variables 10
295 | Subroutines 33
296 | Everything else 57
297 |
298 | =Name The applicant's full name
299 | =Contact The applicant's contact details
300 |
301 | =end code
302 |
303 | Note that abbreviated blocks cannot specify configuration information. If
304 | configuration is required, use a C<=for> or C<=begin>/C<=end> instead.
305 |
306 |
307 | =head3 Block equivalence
308 |
309 | The underlying documentation model treats all block
310 | specifications (delimited, paragraph, and abbreviated) the same way.
311 | It is possible to choose the form is most convenient for a particular
312 | documentation task. In the descriptions that follow, the abbreviated
313 | form will generally be used, but should be read as standing for all
314 | three forms equally.
315 |
316 | For example, although L<#Headings> shows only:
317 |
318 | =begin code
319 | =head1 Top Level Heading
320 | =end code
321 |
322 | this automatically implies that you could also write that block as:
323 |
324 | =begin code
325 | =for head1
326 | Top Level Heading
327 | =end code
328 |
329 | or:
330 |
331 | =begin code
332 | =begin head1
333 | Top Level Heading
334 | =end head1
335 | =end code
336 |
337 |
338 | =head3 Standard configuration options
339 |
340 | Podlite predefines a small number of standard configuration options that can be
341 | applied uniformly to any built-in block type. These include:
342 |
343 | =begin defn
344 | C<:caption>
345 |
346 | This option assigns a title to the given block, which is typically used to create
347 | a L
.
348 |
349 | =end defn
350 |
351 | =begin defn
352 | C<:id>
353 |
354 | This option enables the explicit definition of identifiers for blocks and use those
355 | IDs for linking purposes (see L<#Links>).
356 |
357 | =end defn
358 |
359 | =begin defn
360 | C<:nested>
361 |
362 | This option specifies that the block is to be nested within its current
363 | context. For example, nesting might be applied to block quotes, to textual
364 | examples, or to commentaries. In addition the L|#Code blocks>,
365 | L|#Lists>, L|#I/O blocks>, and L|#I/O blocks>
366 | blocks all have implicit nesting.
367 |
368 | Nesting of blocks is usually rendered by adding extra indentation to the
369 | block contents, but may also be indicated in other ways:
370 | by boxing the contents, by changing the font or size of the nested text,
371 | or even by folding the text (so long as a visible placeholder is provided).
372 |
373 | Occasionally it is desirable to nest content by more than one level:
374 |
375 | =begin code
376 | =begin para :nested
377 | =begin para :nested
378 | =begin para :nested
379 | "We're going deep, deep, deep undercover!"
380 | =end para
381 | =end para
382 | =end para
383 | =end code
384 |
385 | This can be simplified by giving the C<:nested> option a positive integer
386 | value:
387 |
388 | =begin code :allow
389 | =begin para B<:nested(3)>
390 | "We're going deep, deep, deep undercover!"
391 | =end para
392 | =end code
393 |
394 | You can also give the option a value of zero, to defeat any implicit
395 | nesting that might normally be applied to a paragraph. For example, to
396 | specify a block of code that should appear I its usual
397 | nesting:
398 |
399 | =begin code :allow
400 | =comment Don't nest this code block in the usual way...
401 | B<=begin code :nested(0)>
402 |
403 | 1 2 3 4 5 6
404 | 123456789012345678901234567890123456789012345678901234567890
405 | |------|-----------------------|---------------------------|
406 | line instruction comments
407 | number code
408 |
409 | V<=end code>
410 | =end code
411 |
412 | Note that C<:!nested> could also be used for this purpose:
413 |
414 | =begin code
415 | =Z<>begin code :!nested
416 | =end code
417 |
418 | =end defn
419 |
420 | =begin defn
421 | C<:numbered>
422 |
423 | This option specifies that the block is to be numbered. The most common
424 | use of this option is to create L and
425 | L, but it can be applied to any block.
426 |
427 | The numbering conventions for headings and lists are specified in those
428 | sections, but it is up to individual renderers to decide how to display
429 | any numbering associated with other types of blocks.
430 |
431 | Note that numbering is never explicit; it is always implied by context.
432 |
433 | =end defn
434 |
435 | =begin defn
436 | C<:checked>
437 |
438 | This attribute indicates that a checkbox should be added to that block.
439 | It is possible to apply a C<:checked> attributes to any block.
440 | The most common use of this option is to create L.
441 |
442 | For an unchecked checkbox the C<:!checked> is used.
443 |
444 | The task list item marker (checkbox) is added to the output.
445 | In HTML output, this would be represented as an
446 | C<> element.
447 |
448 | The specification does not define how these checkboxes are interacted with.
449 | Implementors are free to choose whether they render them as disabled,
450 | unchangeable elements, or handle dynamic interactions like checking and unchecking
451 | in the final rendered document.
452 |
453 | =end defn
454 |
455 | =begin defn
456 | C<:folded>
457 |
458 | This option specifies whether the block is foldable and, if specified,
459 | whether it should be collapsed or expanded by default. This feature is
460 | useful in managing the length of documents and focusing the reader's
461 | attention on certain sections as needed.
462 |
463 | A C<:!folded> or C<:folded(0)> expands the callout by default, and a
464 | C<:folded> or C<:folded(1)> collapses it instead.
465 |
466 | =begin code :allow
467 | =for table B<:folded> :caption('Culinary Techniques for Sustainability')
468 | Sous-vide Low energy consumption
469 | ---------- -------------------------
470 | Steaming Preserves nutrients
471 | Baking Efficient for batch cooking
472 | =end code
473 |
474 | When applied to a block element, such as a heading, the attribute typically
475 | affects all headings with lower-level content, creating a hierarchical
476 | folding effect.
477 |
478 | For example:
479 |
480 | =begin code :allow
481 | =for B
482 | Green Energy Overview
483 | =end code
484 |
485 | =begin comment
486 | TODO: my be it may sense to add a C<:folded-caption> attribute to
487 | define a custom title for the collapsed block.
488 |
489 | The C<:folded-caption> attribute enables the definition of a custom title
490 | for the collapsed block. If no caption is provided, rendering systems
491 | may automatically use the C<:caption> attribute. In the absence of
492 | the C<:caption> attribute, the first line or paragraph of the block
493 | serves as the default title. For semantic blocks, the name of the block
494 | may be used as the default title.
495 |
496 |
497 | =begin code
498 | =picture :folded(1) :folded-caption("Wind Turbine Fields")
499 | Images/wind_turbines.jpg
500 | Wind turbines stand tall against the sky, harnessing
501 | the power of the wind to generate energy
502 | =end code
503 | =end comment
504 | =end defn
505 |
506 | =begin defn
507 | C<:lang>
508 |
509 | This option is used to L about the programming language used in a specific code block.
511 | This helps ensure that the code is displayed and interpreted correctly
512 | by rendering engines or syntax highlighters.
513 |
514 | Here's a table that lists a few programming languages along with their possible
515 | values for the C<:lang> attribute:
516 |
517 | =begin table :caption("Matching languages and lang attribute values")
518 |
519 | Programming language Possible C<:lang> values
520 | -------------------- -------------------------
521 | C++ cpp
522 | CSS css
523 | HTML html
524 | Java java
525 | JavaScript javascript
526 | Python python
527 | Raku raku
528 |
529 | =end table
530 |
531 | If the language is not specified, the default language is used based
532 | on the file extension or mime type of the current document.
533 |
534 | =end defn
535 |
536 | =begin defn
537 | C<:allow>
538 |
539 | This option expects a list of markup codes that are to be recognized
540 | within any C> codes that appear in (or are implicitly applied to)
541 | the current block. The option is most often used on C<=code> blocks to
542 | allow mark-up within those otherwise verbatim blocks, though it can be
543 | used in I block that contains verbatim text. See L<#Formatting
544 | within code blocks>.
545 |
546 | =end defn
547 |
548 | =head2 Selectors
549 |
550 | Selectors consist of patterns that help identify and filter specific blocks
551 | within documents. Each pattern contains optional source of blocks and block names.
552 |
553 | The general syntax is:
554 |
555 | =begin code :allow< R >
556 | R
557 | or
558 | [ R | ] R
559 | =end code
560 |
561 | ...where
562 |
563 | =item EXTERNAL_SOURCE - optional source of blocks for filtering, default current document,
564 | =item BLOCK_SELECTOR - list of block names, filter for
565 |
566 | For example:
567 |
568 | =begin table :nested
569 |
570 | Selector Description
571 | _______________________________________ ___________________________________________________
572 | head1, head2, item1 all head1, head2 and item1 blocks from document
573 |
574 | file:article.pod6 | head1, head2 all head1 and head2 blocks from article.pod6 file
575 |
576 | file:./includes/*.pod6 | head1, head2 all head1 and head2 blocks from pod6 files placed
577 | in includes directory
578 |
579 | doc:Data::Dumper | code all code blocks from a module documentation
580 |
581 | file:/docs/**/*.md | head1 search headers with first level for all ".md" files
582 | within the "docs" directory and its subdirectories.
583 |
584 | =end table
585 |
586 | Please note that while the Selector blocks provide a way to query and filter specific elements
587 | within Markdown files, Markdown itself doesn't have formal named blocks like the Podlite syntax.
588 | Instead, Markdown uses a lightweight markup to structure content. The above table provides a mapping
589 | between Podlite block names and their corresponding Markdown elements.
590 |
591 | =begin table :nested :caption("A table of correspondences for some Podlite blocks and markdown blocks")
592 |
593 | Podlite Markdown Describtion
594 | _______________________________________ ______________ _____________________________________
595 | C<=head1>, C<=head2>, ... #, ##, ... Heading level 1,2...
596 |
597 | C<=nested> ">" blockquote
598 |
599 | C<=para> block of text paragraph
600 |
601 | C> [^1]: footnote. footnote
602 |
603 | C<=Html> text HTML block
604 |
605 | C> ~~text~~ Strikethrough, "O for Overstrike"
606 |
607 | C> ^text^ Superscript, "H for High text"
608 |
609 | C> ~text~ Subscript, "J for Junior text"
610 |
611 | C>, C<=formula> $,$$, ```math Mathematical formulas
612 |
613 | =end table
614 |
615 | The most common use of Selectors is to create L